diff options
author | zido <zido@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-31 15:38:42 +0000 |
---|---|---|
committer | zido <zido@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-31 15:38:42 +0000 |
commit | a8aadf64c9e04ac2572a22f94c89bf54aee0edf1 (patch) | |
tree | 40e3c2eede9121477e4f32d4d4bb19225479b448 /src/map/irc.c | |
parent | 271543e76dde5d249d3ee8649f6005151f2fd3a3 (diff) | |
download | hercules-a8aadf64c9e04ac2572a22f94c89bf54aee0edf1.tar.gz hercules-a8aadf64c9e04ac2572a22f94c89bf54aee0edf1.tar.bz2 hercules-a8aadf64c9e04ac2572a22f94c89bf54aee0edf1.tar.xz hercules-a8aadf64c9e04ac2572a22f94c89bf54aee0edf1.zip |
Started work on commands for the IRC Bot.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5827 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/irc.c')
-rw-r--r-- | src/map/irc.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/map/irc.c b/src/map/irc.c index 0104fcfb7..f1f6b0e0a 100644 --- a/src/map/irc.c +++ b/src/map/irc.c @@ -35,6 +35,7 @@ typedef int socklen_t; #include "map.h"
#include "pc.h"
#include "irc.h"
+#include "intif.h" //For GM Broadcast [Zido]
short use_irc=0;
@@ -48,6 +49,9 @@ IRC_SI *irc_si=NULL; char irc_nick[30]="";
char irc_password[32]="";
+// #define AUTH_PASS "setpasshere" //(WIP, don't remove) Password to use commands) [Zido]
+#define ALLOWED_NICK "" //Allowed nickname to use commands [Zido]
+
char irc_channel[32]="";
char irc_trade_channel[32]="";
@@ -195,6 +199,9 @@ void irc_send(char *buf) void irc_parse_sub(int fd, char *incoming_string)
{
+ int i=0;
+ int authed=0;
+ char kami[256]; //[Zido]
char source[256];
char command[256];
char target[256];
@@ -250,6 +257,15 @@ void irc_parse_sub(int fd, char *incoming_string) }
}
+ //if((strcmpi(command,"privmsg")==0)&&(strcmpi(message,"pass "AUTH_PASS"")==0)&&(target[0]!='#'))
+
+ // Broadcast [Zido] (Work in Progress)
+ if((strcmpi(command,"privmsg")==0)&&(sscanf(message,"!eakami %s",kami)>0)&&(strcmp(ALLOWED_NICK,source_nick)==0)) {
+ intif_GMmessage(kami,strlen(kami)+1,0);
+ sprintf(send_string,"NOTICE %s :Message Sent",source_nick);
+ irc_send(send_string);
+ }
+
return;
}
|