From 5ec606e3b60f655e85eff02e48fb6bcc0c4274c1 Mon Sep 17 00:00:00 2001 From: DarkFeather Date: Tue, 16 Oct 2018 17:41:39 -0500 Subject: [PATCH] Adding RavenNetListener to support network raw API --- Makefile | 2 +- PKGBUILD | 4 ++-- Raven.csharp | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 6dab5b2..c907935 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ clean: test: compile script -c "mono ./raven.mono -c raven-test.conf -v" ${pkgdir}/tmp/raven-test.log -install: compile /usr/sbin/pwgen +install: compile mkdir -p ${pkgdir}/opt cp raven.mono ${pkgdir}/opt/raven.mono if [ ! -d ${CONFDIR} ]; then mkdir -p ${CONFDIR}; cp sample-confs/* ${CONFDIR}; fi diff --git a/PKGBUILD b/PKGBUILD index 9571e08..15a8e19 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -8,8 +8,8 @@ arch=("x86_64") url="https://aninix.net/foundation/TheRaven" license=('custom') groups=() -depends=('mono>=5.0.0' 'curl' 'grep' 'bash>=4.4' 'git>=2.13' 'pushbullet-cli' 'lynx' 'wget') -makedepends=('make>=4.2') +depends=('mono>=5.0.0' 'curl' 'grep' 'bash>=4.4' 'git>=2.13' 'pushbullet-cli' 'lynx' 'wget' 'nmap>=7.70') +makedepends=('make>=4.2' 'pwgen') checkdepends=() optdepends=() provides=('theraven') diff --git a/Raven.csharp b/Raven.csharp index 8a8f211..ac332f4 100644 --- a/Raven.csharp +++ b/Raven.csharp @@ -39,6 +39,8 @@ namespace AniNIX.TheRaven { public Dictionary MailerCount = new Dictionary(); // Messages may only be sent up to a maximum to the admins. + private RavenNetListener _netListener; + /// /// Show the settings used by this Raven. /// @@ -77,6 +79,7 @@ namespace AniNIX.TheRaven { this.Port = Int32.Parse(loginDefaults["port"]); this.Nick = loginDefaults["username"]; this._nickServPass = loginDefaults["password"]; + this._netListener = new RavenNetListener(loginDefaults["password"]); channels=new List(); foreach (String channel in conf.ReadSectionLines("Rooms")) { @@ -160,7 +163,7 @@ namespace AniNIX.TheRaven { //TODO Add helptext break; case "-c": - if (i < args.Length-1) _configFile = String.Format("/usr/local/etc/TheRaven/{0}",args[++i]); + if (i < args.Length-1) _configFile = args[++i]; break; case "--version": ReportMessage.Log(Verbosity.Always,"AniNIX::TheRaven version 0.2"); @@ -249,6 +252,9 @@ namespace AniNIX.TheRaven { /// public void LoopOnTraffic() { ReportMessage.Log(Verbosity.Verbose,"Looping on trafffic now! We're useful!"); + // Start a network listener to allow relaying traffic via ncat into IRCd. + this._netListener.NetListener(this._connection); + // Loop on main connect to ircd while (true) { IRCServerMessage response = _connection.Read(); if (response != null && response.message != null && response.message.Length > 3 && response.message.Substring(0,2).Equals("r.")) {