summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzido <zido@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-31 15:38:42 +0000
committerzido <zido@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-31 15:38:42 +0000
commita8aadf64c9e04ac2572a22f94c89bf54aee0edf1 (patch)
tree40e3c2eede9121477e4f32d4d4bb19225479b448
parent271543e76dde5d249d3ee8649f6005151f2fd3a3 (diff)
downloadhercules-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
-rw-r--r--Changelog-Trunk.txt4
-rw-r--r--src/map/irc.c16
-rw-r--r--src/map/irc.h6
3 files changed, 26 insertions, 0 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 455a125c4..004ef00f7 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/03/31
+ * Started work on commands for the IRC Bot, At the moment you can use !eakami <message>
+ to broadcast a message, edit ALLOWED_NICK in irc.c to change the nickname
+ of the person that is allowed to use it (Shitty authentication method, I know,
+ but i'll make user/pass method soon enough.) [Zido]
* Modified a bit the skill packets of Sharp-Shooting and Brandish Spear in
hopes of fixing it. [Skotlex]
* Should fix a bug in GM stealth mode (@hide). [Lance]
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;
}
diff --git a/src/map/irc.h b/src/map/irc.h
index fe48c51ff..044aeddf9 100644
--- a/src/map/irc.h
+++ b/src/map/irc.h
@@ -1,5 +1,7 @@
#include "map.h"
+#define MAX_ADMINS 25 // [Zido]
+
extern short use_irc;
extern short irc_announce_flag;
@@ -24,4 +26,8 @@ struct IRC_Session_Info {
char username[30];
char password[33];
};
+
+/*struct IRC_Authed {
+ char host[256];
+};*/ //(WIP, Don't remove) [Zido]
typedef struct IRC_Session_Info IRC_SI;