summaryrefslogtreecommitdiff
path: root/src/map/irc-bot.h
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-04-22 18:28:18 -0300
committershennetsind <ind@henn.et>2013-04-22 18:28:18 -0300
commit19b8cbb835e867febb597b34187f6bbca48cbe7b (patch)
tree02ffe058dc91d2b79c81783cbd50afc295c25d76 /src/map/irc-bot.h
parentd8d392b0a37c122b303d04e92ebc7fb826e53bce (diff)
downloadhercules-19b8cbb835e867febb597b34187f6bbca48cbe7b.tar.gz
hercules-19b8cbb835e867febb597b34187f6bbca48cbe7b.tar.bz2
hercules-19b8cbb835e867febb597b34187f6bbca48cbe7b.tar.xz
hercules-19b8cbb835e867febb597b34187f6bbca48cbe7b.zip
Hercules April 22 MEGA-ULTRA-LONG Patch~!
http://hercules.ws/board/topic/470-hercules-april-22-patch/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/irc-bot.h')
-rw-r--r--src/map/irc-bot.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/map/irc-bot.h b/src/map/irc-bot.h
new file mode 100644
index 000000000..d1bf0866d
--- /dev/null
+++ b/src/map/irc-bot.h
@@ -0,0 +1,58 @@
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Base Author: shennetsind @ http://hercules.ws
+
+
+#ifndef _IRC_BOT_H_
+#define _IRC_BOT_H_
+
+#define IRC_FUNC_LENGTH 30
+
+struct hChSysCh;
+
+struct irc_func {
+ char name[IRC_FUNC_LENGTH];
+ void (*func)(int, char*, char*, char*, char*);
+};
+
+struct irc_bot_interface {
+ int fd;
+ bool isIn;
+ unsigned int last_try;
+ unsigned char fails;
+ unsigned long ip;
+ unsigned short port;
+ /* */
+ struct hChSysCh *channel;
+ /* */
+ struct {
+ struct irc_func **list;
+ unsigned int size;
+ } funcs;
+ /* */
+ void (*init) (void);
+ void (*final) (void);
+ /* */
+ int (*parse) (int fd);
+ void (*parse_sub) (int fd, char *str);
+ void (*parse_source) (char *source, char *nick, char *ident, char *host);
+ /* */
+ struct irc_func* (*func_search) (char* function_name);
+ /* */
+ int (*connect_timer) (int tid, unsigned int tick, int id, intptr_t data);
+ int (*identify_timer) (int tid, unsigned int tick, int id, intptr_t data);
+ int (*join_timer) (int tid, unsigned int tick, int id, intptr_t data);
+ /* */
+ void (*send)(char *str);
+ void (*relay) (char *name, char *msg);
+ /* */
+ void (*pong) (int fd, char *cmd, char *source, char *target, char *msg);
+ void (*join) (int fd, char *cmd, char *source, char *target, char *msg);
+ void (*privmsg) (int fd, char *cmd, char *source, char *target, char *msg);
+} irc_bot_s;
+
+struct irc_bot_interface *ircbot;
+
+void ircbot_defaults(void);
+
+#endif /* _IRC_BOT_H_ */