rearranged NeonServ code to be modular
[NeonServV5.git] / src / bot_NeonSpam.h
diff --git a/src/bot_NeonSpam.h b/src/bot_NeonSpam.h
deleted file mode 100644 (file)
index a95f3bc..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/* bot_NeonSpam.h - NeonServ v5.3
- * Copyright (C) 2011-2012  Philipp Kreil (pk910)
- * 
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License 
- * along with this program. If not, see <http://www.gnu.org/licenses/>. 
- */
-
-#ifndef _bot_NeonSpam_h
-#define _bot_NeonSpam_h
-
-#include "main.h"
-
-struct ChanNode;
-
-//SPAMSCAN
-#define SPAMSETTINGS_SPAMSCAN           0x000001
-#define SPAMSETTINGS_SPAMSCAN_OPS       0x000002
-#define SPAMSETTINGS_SPAMSCAN_VOICE     0x000004
-#define SPAMSETTINGS_SPAMCHARS          "abc"
-#define SPAMSETTINGS_SPAMEXCINDEX       0
-
-//FLOODSCAN
-#define SPAMSETTINGS_FLOODSCAN          0x000008
-#define SPAMSETTINGS_FLOODSCAN_OPS      0x000010
-#define SPAMSETTINGS_FLOODSCAN_VOICE    0x000020
-#define SPAMSETTINGS_FLOODCHARS         "def"
-#define SPAMSETTINGS_FLOODEXCINDEX      1
-#define SPAMSETTINGS_FLOODSENINDEX      0
-
-//JOINSCAN
-#define SPAMSETTINGS_JOINSCAN           0x000040
-#define SPAMSETTINGS_JOINSCAN_OPS       0x000080
-#define SPAMSETTINGS_JOINSCAN_VOICE     0x000100
-#define SPAMSETTINGS_JOINCHARS          "ghi"
-#define SPAMSETTINGS_JOINEXCINDEX       2
-#define SPAMSETTINGS_JOINSENINDEX       1
-
-//BOTNET SCAN
-#define SPAMSETTINGS_BOTNETSCAN         0x000200
-#define SPAMSETTINGS_BOTNETSCAN_OPS     0x000400
-#define SPAMSETTINGS_BOTNETSCAN_VOICE   0x000800
-#define SPAMSETTINGS_BOTNETSCAN_STRIPCC 0x001000
-#define SPAMSETTINGS_BOTNETCHARS        "jklm"
-#define SPAMSETTINGS_BOTNETEXCINDEX     3
-
-//CAPSSCAN
-#define SPAMSETTINGS_CAPSSCAN           0x002000
-#define SPAMSETTINGS_CAPSSCAN_OPS       0x004000
-#define SPAMSETTINGS_CAPSSCAN_VOICE     0x008000
-#define SPAMSETTINGS_CAPSCHARS          "nop"
-#define SPAMSETTINGS_CAPSEXCINDEX       4
-#define SPAMSETTINGS_CAPSPERCENTINDEX   0
-
-//DIGITSCAN
-#define SPAMSETTINGS_DIGITSCAN          0x010000
-#define SPAMSETTINGS_DIGITSCAN_OPS      0x020000
-#define SPAMSETTINGS_DIGITSCAN_VOICE    0x040000
-#define SPAMSETTINGS_DIGITCHARS         "qrs"
-#define SPAMSETTINGS_DIGITEXCINDEX      5
-#define SPAMSETTINGS_DIGITPERCENTINDEX  1
-
-
-#define SPAMSETTINGS_CHARS     SPAMSETTINGS_SPAMCHARS SPAMSETTINGS_FLOODCHARS SPAMSETTINGS_JOINCHARS SPAMSETTINGS_BOTNETCHARS SPAMSETTINGS_CAPSCHARS SPAMSETTINGS_DIGITCHARS
-#define SPAMSETTINGS_FLAGS              0x07ffff /* all flags that can be stored in the database */
-#define SPAMSETTINGS_EXCEPTINDEXES      6
-#define SPAMSETTINGS_SENSIBILITYINDEXES 2
-#define SPAMSETTINGS_PERCENTINDEXES     2
-
-//SCRIPT FLAGS
-#define SPAMSETTINGS_KICKEDBOTQUEUE     0x080000
-#define SPAMSETTINGS_ISTIMEBAN          0x100000
-#define SPAMSETTINGS_SETTIMEBAN         0x200000
-
-#define MAX_FLOOD_AMOUNT 300
-#define MIN_FLOOD_AMOUNT 2
-#define MAX_FLOOD_TIME   200
-
-#define MAX_JOIN_AMOUNT 300
-#define MIN_JOIN_AMOUNT 2
-#define MAX_JOIN_TIME   200
-
-#define BOTNETSCAN_USERS 4
-#define BOTNETSCAN_TIME 2
-
-struct NeonSpamSettings {
-    unsigned int flags;
-    unsigned char spam_amount;
-    unsigned char sensibility_amount[SPAMSETTINGS_SENSIBILITYINDEXES];
-    unsigned char sensibility_time[SPAMSETTINGS_SENSIBILITYINDEXES];
-    unsigned int exceptlevel[SPAMSETTINGS_EXCEPTINDEXES];
-    unsigned char percent[SPAMSETTINGS_PERCENTINDEXES];
-    
-    //joinflood
-    struct NeonSpamJoinNode *join_nodes;
-    
-    //botnet
-    unsigned long lastmsg; //crc32 hash
-    time_t lastmsg_time;
-    char *botnicks[BOTNETSCAN_USERS];
-    
-    
-};
-/* PENALTY SYSTEM
-* user gets MAX_FLOOD_TIME points per message
-* points get removed each loop
-* pounts to be removed each second:
-*  MAX_FLOOD_TIME/flood_time
-* 
-* the floodlimit is reached, if the penalty points 
-* are bigger than MAX_FLOOD_TIME * flood_amount
-*/
-
-#define NEONSPAMNODE_FLAG_CAPSSCAN_WARNED  0x01
-#define NEONSPAMNODE_FLAG_DIGITSCAN_WARNED 0x02
-
-struct NeonSpamNode {
-    unsigned long lastmsg; //crc32 hash
-    unsigned char spamcount;
-    int floodpenalty;
-    time_t last_penalty_update;
-    unsigned char flags;
-};
-
-struct NeonSpamJoinNode {
-    char *ident;
-    char *host;
-    int joinpenalty;
-    time_t last_penalty_update;
-    struct NeonSpamJoinNode *next;
-};
-
-void init_NeonSpam();
-void loop_NeonSpam();
-void free_NeonSpam();
-
-void freeNeonSpamSettings(struct NeonSpamSettings *settings);
-char* convertNeonSpamSettingsToString(unsigned int flags, char *buffer);
-int loadNeonSpamSettings(struct ChanNode *chan);
-
-#endif
\ No newline at end of file