added simple anti flood system
[NeonServV5.git] / src / ClientSocket.h
index c00d743c3ce8f70907b303b28a4d5c0afe58b57f..7926767c973b0135b6077c2cc1f3938e8ee2884b 100644 (file)
@@ -22,7 +22,8 @@
 #define SOCKET_FLAG_DEAD      0x01
 #define SOCKET_FLAG_CONNECTED 0x02
 #define SOCKET_FLAG_READY     0x04
-#define SOCKET_FLAG_PREFERRED  0x08 /* prefered bot to send datas to the IRC World (NOTICE's WHO's etc pp) */
+#define SOCKET_FLAG_PREFERRED 0x08 /* prefered bot to send datas to the IRC World (NOTICE's WHO's etc pp) */
+#define SOCKET_FLAG_USE_QUEUE 0x10
 
 #define BUF_SIZ 512
 
@@ -41,6 +42,8 @@ struct ClientSocket {
     unsigned long traffic_in;
     unsigned long traffic_out;
     time_t connection_time;
+    
+    struct BotQueue *queue;
        
        int botid : 16;
     int clientid : 16;
@@ -51,6 +54,7 @@ struct ClientSocket {
 struct ClientSocket* create_socket(char *host, int port, char *pass, struct UserNode *user);
 int connect_socket(struct ClientSocket *client);
 int close_socket(struct ClientSocket *client);
+int write_socket_force(struct ClientSocket *client, char* msg, int len);
 int write_socket(struct ClientSocket *client, char* msg, int len);
 void socket_loop(int timeout_seconds);
 void putsock(struct ClientSocket *client, const char *text, ...) PRINTF_LIKE(2, 3);