Central Moderation
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4800 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Executable
+53
@@ -0,0 +1,53 @@
|
||||
/* http://www.linuxhowtos.org/C_C++/socket.htm */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <unistd.h> // sleep
|
||||
#include <ctype.h>
|
||||
|
||||
#define MAXCOL 300
|
||||
#define IPLEN 21
|
||||
#define NAMELEN 21
|
||||
#define MAXBUF 1024
|
||||
#define MAXBLTIME 30 // days
|
||||
#define MAXMSGSIZE 25+NAMELEN
|
||||
|
||||
#define AC_CMOD_URI "ac.if.usp.br" // this is a test
|
||||
#define AC_CMOD_PORT 28763 // this is a test
|
||||
|
||||
enum
|
||||
{UT_NULL, UT_CLIENT, UT_SERVER, UT_BOTH, UT_OP, UT_LAST};
|
||||
|
||||
enum
|
||||
{MT_REGISTER, MT_GETLIST, MT_INSERTBL, MT_REMOVEBL, MT_INSERTWL, MT_REMOVEWL, MT_REPORT, MT_CANTRUST, MT_SHOWUS, MT_SHOWBL, MT_SHOWWL, MT_LAST};
|
||||
|
||||
enum
|
||||
{RT_SPEED, RT_AIMBOT, RT_WEAPON, RT_WALL, RT_MAP, RT_OPK, RT_TELEPORT, RT_SERVER, RT_BUGEXP, RT_OTHER, RT_LAST};
|
||||
|
||||
enum
|
||||
{RM_DONE, RM_FAIL, RM_IGN, RM_EXPIRED, RM_TRAGEDY, RM_FORSURE, RM_YES, RM_NO, RM_BLED, RM_WLED, RM_LAST};
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint16_t *mt; // the message type
|
||||
uint8_t *le; // endianess
|
||||
uint8_t *be; // endianess
|
||||
uint32_t *n; // user id (client side)
|
||||
uint16_t *port;
|
||||
uint8_t *v; // endian verifier
|
||||
uint8_t *t; // ut for get_bl
|
||||
uint16_t *k; // index for remove_bl/wl
|
||||
uint8_t *ct; // can trust ip
|
||||
char *name;
|
||||
uint16_t *version;
|
||||
uint8_t *f; // ip fields
|
||||
uint8_t *reason;
|
||||
uint8_t *exp; // expiration in days
|
||||
} s_vmsg;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user