浏览代码

- IRC Bot can now auto-join when kicked from the channel

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6170 54d463be-8e91-2dee-dedb-b68131a5f0ec
Zido 19 年之前
父节点
当前提交
bc11c8b54f
共有 3 个文件被更改,包括 14 次插入0 次删除
  1. 1 0
      Changelog-Trunk.txt
  2. 3 0
      conf-tmpl/irc_athena.conf
  3. 10 0
      src/map/irc.c

+ 1 - 0
Changelog-Trunk.txt

@@ -4,6 +4,7 @@ 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.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 
 2006/04/18
 2006/04/18
+	* The IRC Bot can now autojoin when kicked, set in irc_athena. [Zido]
 	* Added @who to the IRC Bot, outputs all online characters. [Zido]
 	* Added @who to the IRC Bot, outputs all online characters. [Zido]
 	* Changed the memory manager fatal errors when allocating memory to print
 	* Changed the memory manager fatal errors when allocating memory to print
 	  out the size request as well as the file and line where they originated.
 	  out the size request as well as the file and line where they originated.

+ 3 - 0
conf-tmpl/irc_athena.conf

@@ -23,6 +23,9 @@ irc_server: irc.deltaanime.net
 //IRC Server Port
 //IRC Server Port
 irc_port: 6667
 irc_port: 6667
 
 
+//Autojoin channel when kicked (on=1,off=0)
+irc_autojoin: 0
+
 //IRC Channel
 //IRC Channel
 irc_channel: #
 irc_channel: #
 
 

+ 10 - 0
src/map/irc.c

@@ -41,6 +41,8 @@ typedef int socklen_t;
 
 
 short use_irc=0;
 short use_irc=0;
 
 
+short irc_autojoin=0;
+
 short irc_announce_flag=1;
 short irc_announce_flag=1;
 short irc_announce_mvp_flag=1;
 short irc_announce_mvp_flag=1;
 short irc_announce_jobchange_flag=1;
 short irc_announce_jobchange_flag=1;
@@ -313,6 +315,12 @@ void irc_parse_sub(int fd, char *incoming_string)
 				irc_send(send_string);
 				irc_send(send_string);
 				printf("Done\n");
 				printf("Done\n");
 			}
 			}
+
+			// Autojoin on kick [Zido]
+			else if((strcmpi(command,"kick")==0)&&(irc_autojoin==1)) {
+				sprintf(send_string,"JOIN %s",target);
+				irc_send(send_string);
+			}
 		}
 		}
 
 
 		// Names Reply [Zido]
 		// Names Reply [Zido]
@@ -526,6 +534,8 @@ int irc_read_conf(char *file) {
 			strcpy(irc_ip_str,w2);
 			strcpy(irc_ip_str,w2);
 		else if(strcmpi(w1,"irc_port")==0)
 		else if(strcmpi(w1,"irc_port")==0)
 			irc_port=atoi(w2);
 			irc_port=atoi(w2);
+		else if(strcmpi(w1,"irc_autojoin")==0)
+			irc_autojoin=atoi(w2);
 		else if(strcmpi(w1,"irc_channel")==0)
 		else if(strcmpi(w1,"irc_channel")==0)
 			strcpy(irc_channel,w2);
 			strcpy(irc_channel,w2);
 		else if(strcmpi(w1,"irc_trade_channel")==0)
 		else if(strcmpi(w1,"irc_trade_channel")==0)