int OnInit(){ // Funciton called on server initiation //G_SayCensor_Init(); data.maxPlayers = Plugin_GetSlotCount(); data.maxMPM = Cvar_RegisterFloat("antispam_maxMessagesPerMinute",8,0,30,0,"Count of maximum messages a player can send in a minute. 0 disables the chat completely."); data.minAP = Cvar_RegisterInt("antispam_minAdminPower",50,0,100,0,"Minimum power points which disable the player. 0 means enabled for everyone."); data.minMD = Cvar_RegisterInt("antispam_minMessageDelay",4,0,60,0,"Ammount of time after sending a message after which the player can chat again. 0 disables the limit."); data.renMD = Cvar_RegisterBool("antispam_renewedMessageDelay",qfalse,0,"Do messages sent before minMessageDelay passes make the delay prolonged?"); Antispam_Initialize(); return 0; }
__cdecl void G_RegisterCvarsCallback( ){ cvar_t** tmp; g_speed = Cvar_RegisterInt("g_speed", 190, 1, 6000, 0, "Player's global movement speed is set here"); g_disabledefcmdprefix = Cvar_RegisterBool("g_disabledefcmdprefix", qtrue, 0, "Disable the interpretation of the !-sign as command"); g_allowConsoleSay = Cvar_RegisterBool("g_allowConsoleSay", qtrue, CVAR_ARCHIVE, "Flag whether to allow chat from ingame console"); //g_maxclients tmp = (cvar_t**)(0x84bcfe8); *tmp = Cvar_RegisterInt("sv_maxclients", 32, 1, 64, CVAR_ARCHIVE,"The maximum number of clients that can connect to a server"); }
/* =============== Netchan_Init =============== */ void Netchan_Init( int port ) { port &= 0xffff; showpackets = Cvar_RegisterBool( "showpackets", qfalse, CVAR_TEMP, "Show all sent and received packets"); showdrop = Cvar_RegisterBool( "showdrop", qfalse, CVAR_TEMP, "Show dropped packets"); qport = Cvar_RegisterInt( "net_qport", port, 1, 65535, CVAR_INIT, "The net_chan qport" ); }
__cdecl void G_RegisterCvarsCallback( ){ g_speed = Cvar_RegisterInt("g_speed", 190, 1, 6000, 0, "Player's global movement speed is set here"); g_disabledefcmdprefix = Cvar_RegisterBool("g_disabledefcmdprefix", qtrue, 0, "Disable the interpretation of the !-sign as command"); g_allowConsoleSay = Cvar_RegisterBool("g_allowConsoleSay", qtrue, CVAR_ARCHIVE, "Flag whether to allow chat from ingame console"); //g_maxclients *(cvar_t**)0x84bcfe8 = sv_maxclients; }
void SV_InitBanlist(){ Com_Memset(ipBans,0,sizeof(ipBans)); banlistfile = Cvar_RegisterString("banlist_filename", "banlist.dat", CVAR_INIT, "Name of the file which holds the banlist"); ipbantime = Cvar_RegisterInt("banlist_maxipbantime", MAX_DEFAULT_IPBAN_MINUTES, 0, 20160, 0, "Limit of minutes to keep a ban against an ip-address up"); current_banlist_size = BANLIST_DEFAULT_SIZE; current_banindex = 0; banlist = realloc(NULL, current_banlist_size);//Test for NULL ? if(banlist){ SV_LoadBanlist(); }else{ Com_PrintError("Failed to allocate memory for the banlist. Banlist is disabled\n"); } }
void Init_CallVote(void){ g_votedMapName = Cvar_RegisterString("g_votedMapName", "", 0, "Contains the voted mapname"); g_votedGametype = Cvar_RegisterString("g_votedGametype", "", 0, "Contains the voted gametype"); g_voteTime = Cvar_RegisterInt("g_voteTime", 30, 10, 90, 0, "Duration a called vote is active"); g_voteBanTime = Cvar_RegisterInt("g_voteBanTime", 15, 1, 240, 0, "Duration a player is banned after successful votekick"); g_voteMaxVotes = Cvar_RegisterInt("g_voteMaxVotes", 2, 1, 10, 0, "How many votes a player can call"); g_voteVoteGametypes = Cvar_RegisterString("g_voteVoteGametypes", "", 0, "Contains a list of gametypes that are allowed to vote. Empty list = all"); g_voteKickMinPlayers = Cvar_RegisterInt("g_voteKickMinPlayers", 5, 0, 14, 0, "How many active players are needed on server to allow calling a kickvote"); g_voteAllowMaprotate = Cvar_RegisterBool("g_voteAllowMaprotate", qtrue, 0, "Allow calling map_rotate votes"); g_voteAllowKick = Cvar_RegisterBool("g_voteAllowKick", qtrue, 0, "Allow calling kick votes"); g_voteAllowGametype = Cvar_RegisterBool("g_voteAllowGametype", qtrue, 0, "Allow calling gametype votes"); g_voteAllowMap = Cvar_RegisterInt("g_voteAllowMap", 1, 0, 2, 0, "Allow calling next map setting votes - 0=disabled, 1=only from rotation, 2=Any map"); g_voteAllowRestart = Cvar_RegisterBool("g_voteAllowRestart", qtrue, 0, "Allow calling map restart votes"); g_voteFlags = 0; g_voteFlags |= g_voteAllowRestart->boolean ? VOTEFLAGS_RESTART : 0; g_voteFlags |= g_voteAllowGametype->boolean ? VOTEFLAGS_GAMETYPE : 0; g_voteFlags |= g_voteAllowMaprotate->boolean ? VOTEFLAGS_NEXTMAP : 0; g_voteFlags |= g_voteAllowMap->boolean && g_voteAllowGametype->boolean ? VOTEFLAGS_TYPE : 0; g_voteFlags |= g_voteAllowKick->boolean ? VOTEFLAGS_KICK : 0; g_voteFlags |= g_voteAllowMap->integer ? VOTEFLAGS_MAP : 0; g_voteFlags |= g_voteAllowMap->integer == 2 ? VOTEFLAGS_ANYMAP : 0; }