Merge pull request #87 from s1lentq/master

Cut of nicknames '+' if next there is something digit or alphanumeric character.
This commit is contained in:
theAsmodai 2015-10-27 18:24:40 +03:00
commit 14890276de
22 changed files with 82 additions and 73 deletions

View File

@ -34,8 +34,8 @@ char gpszVersionString[32];
char gpszProductString[32];
char* strcpy_safe(char* dst, char* src) {
int len = strlen(src);
memmove(dst, src, len + 1);
int len = Q_strlen(src);
Q_memmove(dst, src, len + 1);
return dst;
}

View File

@ -135,7 +135,6 @@ extern int loadsize;
#define Q_strnicmp _strnicmp
#define Q_strstr A_strstr
#define Q_strchr strchr
#define Q_strrchr strrchr
#define Q_strlwr A_strtolower
#define Q_sprintf sprintf
#define Q_snprintf _snprintf

View File

@ -3,12 +3,12 @@
class CStringPoolMap : public CStaticMap<const char*, char*, 8, 2048> {
protected:
virtual uint32 hash(const char* const &val) {
unsigned int len = strlen(val);
unsigned int len = Q_strlen(val);
return crc32c((const uint8*)val, len);
}
virtual bool equals(const char* const &val1, const char* const &val2) {
return !strcmp(val1, val2);
return !Q_strcmp(val1, val2);
}
public:
@ -37,7 +37,7 @@ void Ed_StrPool_Reset() {
char* Ed_StrPool_Alloc(const char* origStr) {
char str[2048];
unsigned int len = strlen(origStr) + 1;
unsigned int len = Q_strlen(origStr) + 1;
if (len >= ARRAYSIZE(str)) {
Sys_Error(__FUNCTION__ ": Too long string allocated: %s", origStr);
@ -60,7 +60,7 @@ char* Ed_StrPool_Alloc(const char* origStr) {
}
*new_p = 0;
len = strlen(str) + 1;
len = Q_strlen(str) + 1;
auto node = g_EdStringPool.get(str);
if (node) {

View File

@ -196,14 +196,14 @@ void CheckLiblistForFallbackDir(const char *pGameDir, bool bLanguage, const char
szLine[511] = 0;
if (!Q_strnicmp(szLine, "fallback_dir", Q_strlen("fallback_dir")))
{
start = strchr(szLine, '"');
start = Q_strchr(szLine, '"');
if (!start)
{
FS_Close(hFile);
return;
}
end = strchr(start + 1, '"');
end = Q_strchr(start + 1, '"');
if (!end)
{
FS_Close(hFile);
@ -336,7 +336,7 @@ int FileSystem_SetGameDirectory(const char *pDefaultDir, const char *pGameDir)
CRehldsPlatformHolder::get()->SteamAPI_SetBreakpadAppID(GetGameAppID());
bool bEnableHDPack = BEnabledHDAddon();
bool bLanguage = (strlen(language) != 0 && Q_stricmp(language, "english")) ? true : false;
bool bLanguage = (Q_strlen(language) != 0 && Q_stricmp(language, "english")) ? true : false;
if (!pGameDir)
pGameDir = pDefaultDir;
@ -478,7 +478,7 @@ int FileSystem_AddFallbackGameDir(const char *pGameDir)
language[ARRAYSIZE(language) - 1] = 0;
#endif
if (strlen(language) != 0 && Q_stricmp(language, "english"))
if (Q_strlen(language) != 0 && Q_stricmp(language, "english"))
{
char temp[MAX_PATH];
Q_sprintf(temp, "%s/%s_%s", GetBaseDirectory(), pGameDir, language);

View File

@ -342,13 +342,13 @@ void FS_Rename(const char *originalName, const char *newName)
if (FS_GetLocalPath(originalName, localPath, ARRAYSIZE(localPath)))
{
Q_strcpy(newPath, localPath);
cut = strstr(newPath, originalName);
cut = Q_strstr(newPath, originalName);
if (cut)
{
*cut = 0;
#ifdef REHLDS_CHECKS
Q_strncat(newPath, newName, ARRAYSIZE(newPath) - strlen(newPath));
Q_strncat(newPath, newName, ARRAYSIZE(newPath) - Q_strlen(newPath));
newPath[ARRAYSIZE(newPath) - 1] = 0;
#else
Q_strcat(newPath, newName);

View File

@ -692,7 +692,7 @@ qboolean Host_FilterTime(float time)
command_line_ticrate = COM_CheckParm("-sys_ticrate");
if (command_line_ticrate > 0)
fps = atof(com_argv[command_line_ticrate + 1]);
fps = Q_atof(com_argv[command_line_ticrate + 1]);
else
fps = sys_ticrate.value;

View File

@ -256,13 +256,13 @@ void Host_Motd_f(void)
buf[length] = 0;
char* now = buf;
Con_Printf("motd:");
next = strchr(now, '\n');
next = Q_strchr(now, '\n');
while (next != NULL)
{
*next = 0;
Con_Printf("%s\n", now);
now = next + 1;
next = strchr(now, '\n');
next = Q_strchr(now, '\n');
}
Con_Printf("%s\n", now);
@ -283,7 +283,7 @@ void Host_Motd_Write_f(void)
if (!g_psv.active || cmd_source != src_command || g_pcls.state)
return;
if (!IsSafeFileToDownload(motdfile.string) || !strstr(motdfile.string, ".txt"))
if (!IsSafeFileToDownload(motdfile.string) || !Q_strstr(motdfile.string, ".txt"))
{
Con_Printf("Invalid motdfile name (%s)\n", motdfile.string);
return;
@ -840,7 +840,7 @@ void Host_Map(qboolean bIsDemo, char *mapstring, char *mapName, qboolean loadGam
{
Q_strcpy(g_pcls.spawnparms, "");
for (i = 0; i < Cmd_Argc(); i++)
Q_strncat(g_pcls.spawnparms, Cmd_Argv(i), sizeof(g_pcls.spawnparms) - strlen(g_pcls.spawnparms) - 1);
Q_strncat(g_pcls.spawnparms, Cmd_Argv(i), sizeof(g_pcls.spawnparms) - Q_strlen(g_pcls.spawnparms) - 1);
}
}
if (sv_gpNewUserMsgs)
@ -2317,7 +2317,7 @@ void Host_ClearSaveDirectory(void)
const char *pfn;
Q_snprintf(szName, sizeof(szName), "%s", Host_SaveGameDirectory());
Q_strncat(szName, "*.HL?", sizeof(szName) - strlen(szName) - 1);
Q_strncat(szName, "*.HL?", sizeof(szName) - Q_strlen(szName) - 1);
COM_FixSlashes(szName);
if (Sys_FindFirstPathID(szName, "GAMECONFIG") != NULL)
@ -2326,7 +2326,7 @@ void Host_ClearSaveDirectory(void)
Q_snprintf(szName, sizeof(szName), "%s", Host_SaveGameDirectory());
COM_FixSlashes(szName);
FS_CreateDirHierarchy(szName, "GAMECONFIG");
Q_strncat(szName, "*.HL?", sizeof(szName) - strlen(szName) - 1);
Q_strncat(szName, "*.HL?", sizeof(szName) - Q_strlen(szName) - 1);
for (pfn = Sys_FindFirstPathID(szName, "GAMECONFIG"); pfn; pfn = Sys_FindNext(NULL))
{

View File

@ -493,7 +493,7 @@ void Mod_LoadTextures(lump_t *l)
loadmodel->textures[i] = tx;
Q_memcpy(tx->name, mt->name, sizeof(tx->name));
if (strchr(tx->name, '~'))
if (Q_strchr(tx->name, '~'))
tx->name[2] = ' ';
tx->width = mt->width;

View File

@ -615,7 +615,7 @@ void Netchan_CheckForCompletion(netchan_t *chan, int stream, int intotalbuffers)
if (chan->sock == NS_MULTICAST)
{
char szCommand[32];
_snprintf(szCommand, sizeof(szCommand), "listen %s\n", NET_AdrToString(chan->remote_address));
Q_snprintf(szCommand, sizeof(szCommand), "listen %s\n", NET_AdrToString(chan->remote_address));
Cbuf_AddText(szCommand);
return;
}
@ -1616,7 +1616,7 @@ qboolean Netchan_CopyFileFragments(netchan_t *chan)
Q_strncpy(filedir, filename, sizeof(filedir));
#endif // REHLDS_CHECKS
COM_FixSlashes(filedir);
pszFileName = strrchr(filedir, '\\');
pszFileName = Q_strrchr(filedir, '\\');
if (pszFileName)
{
*pszFileName = 0;

View File

@ -472,7 +472,7 @@ qboolean NET_StringToSockaddr(const char *s, struct sockaddr *sadr)
if (*colon == ':')
{
*colon = 0;
val = atoi(colon + 1);
val = Q_atoi(colon + 1);
((sockaddr_in *)sadr)->sin_port = htons(val);
}
colon++;
@ -2047,12 +2047,12 @@ void NET_Init(void)
int port = COM_CheckParm("-port");
if (port)
Cvar_SetValue("hostport", atof(com_argv[port + 1]));
Cvar_SetValue("hostport", Q_atof(com_argv[port + 1]));
int clockwindow_ = COM_CheckParm("-clockwindow");
if (clockwindow_)
Cvar_SetValue("clockwindow", atof(com_argv[clockwindow_ + 1]));
Cvar_SetValue("clockwindow", Q_atof(com_argv[clockwindow_ + 1]));
net_message.data = (byte *)&net_message_buffer;
net_message.maxsize = sizeof(net_message_buffer);
net_message.flags = 0;

View File

@ -1538,7 +1538,7 @@ int EXT_FUNC PF_precache_generic_I(char *s)
int EXT_FUNC PF_IsMapValid_I(char *mapname)
{
char cBuf[260];
if (!mapname || strlen(mapname) == 0)
if (!mapname || Q_strlen(mapname) == 0)
return 0;
@ -2777,7 +2777,7 @@ NOXREF void QueryClientCvarValueCmd2(void)
Con_Printf("%s <player name> <cvar> <requestID>", Cmd_Argv(0));
return;
}
requestID = atoi(Cmd_Argv(3));
requestID = Q_atoi(Cmd_Argv(3));
for (i = 0; i < g_psvs.maxclients; i++)
{
cl = &g_psvs.clients[i];

View File

@ -2082,8 +2082,8 @@ int SV_CheckUserInfo(netadr_t *adr, char *userinfo, qboolean bIsReconnecting, in
}
}
i = strlen(userinfo);
if (i <= 4 || strstr(userinfo, "\\\\") || userinfo[i - 1] == '\\')
i = Q_strlen(userinfo);
if (i <= 4 || Q_strstr(userinfo, "\\\\") || userinfo[i - 1] == '\\')
{
SV_RejectConnection(adr, "Unknown HLTV client type.\n");
@ -2098,7 +2098,12 @@ int SV_CheckUserInfo(netadr_t *adr, char *userinfo, qboolean bIsReconnecting, in
for (pChar = newname; *pChar; pChar++)
{
if (*pChar == '%' || *pChar == '&')
if (*pChar == '%'
|| *pChar == '&'
#ifdef REHLDS_FIXES
|| (*pChar == '+' && (isdigit(pChar[1]) || isalpha(pChar[1])))
#endif // REHLDS_FIXES
)
*pChar = ' ';
}
@ -3326,7 +3331,7 @@ void SV_Rcon(netadr_t *net_from_)
{
if (invalid == 2)
Con_Printf("Bad rcon_password.\n");
else if (strlen(rcon_password.string) == 0)
else if (Q_strlen(rcon_password.string) == 0)
Con_Printf("Bad rcon_password.\nNo password set for this server.\n");
else
Con_Printf("Bad rcon_password.\n");
@ -3508,7 +3513,7 @@ qboolean SV_FilterPacket(void)
else
{
if (i < numipfilters - 1)
memmove(curFilter, &curFilter[1], sizeof(ipfilter_t) * (numipfilters - i - 1));
Q_memmove(curFilter, &curFilter[1], sizeof(ipfilter_t) * (numipfilters - i - 1));
--numipfilters;
}
@ -3520,7 +3525,7 @@ qboolean SV_FilterPacket(void)
void SV_SendBan(void)
{
char szMessage[64];
_snprintf(szMessage, sizeof(szMessage), "You have been banned from this server.\n");
Q_snprintf(szMessage, sizeof(szMessage), "You have been banned from this server.\n");
SZ_Clear(&net_message);
@ -4588,7 +4593,7 @@ void SV_UpdateToReliableMessages(void)
#ifdef REHLDS_FIXES
// skip update in this frame if would overflow
if (client->sendinfo && client->sendinfo_time <= realtime && ( 1 + 1 + 4 + ( int )strlen( client->userinfo ) + 1 + 16 + g_psv.reliable_datagram.cursize <= g_psv.reliable_datagram.maxsize ) )
if (client->sendinfo && client->sendinfo_time <= realtime && ( 1 + 1 + 4 + ( int )Q_strlen( client->userinfo ) + 1 + 16 + g_psv.reliable_datagram.cursize <= g_psv.reliable_datagram.maxsize ) )
#else // REHLDS_FIXES
if (client->sendinfo && client->sendinfo_time <= realtime)
#endif // REHLDS_FIXES
@ -4794,7 +4799,12 @@ void SV_ExtractFromUserinfo(client_t *cl)
for (char *p = rawname; *p; p++)
{
if (*p == '%' || *p == '&')
if (*p == '%'
|| *p == '&'
#ifdef REHLDS_FIXES
|| (*p == '+' && (isdigit(p[1]) || isalpha(p[1])))
#endif // REHLDS_FIXES
)
*p = ' ';
}
@ -6090,14 +6100,14 @@ void Host_Kick_f(void)
unsigned int dataLen = 0;
for (int i = 1; i < argsStartNum; i++)
{
dataLen += strlen(Cmd_Argv(i)) + 1;
dataLen += Q_strlen(Cmd_Argv(i)) + 1;
}
if (isSteam)
dataLen -= 4;
p = Cmd_Args();
if (dataLen <= strlen(p))
if (dataLen <= Q_strlen(p))
{
const char *message = dataLen + p;
if (message)
@ -6163,7 +6173,7 @@ void SV_RemoveId_f(void)
{
if (!Q_strnicmp(idstring, "STEAM_", 6) || !Q_strnicmp(idstring, "VALVE_", 6))
{
_snprintf(idstring, 0x3Fu, "%s:%s:%s", Cmd_Argv(1), Cmd_Argv(3), Cmd_Argv(5));
Q_snprintf(idstring, 0x3Fu, "%s:%s:%s", Cmd_Argv(1), Cmd_Argv(3), Cmd_Argv(5));
idstring[63] = 0;
}
@ -6188,7 +6198,7 @@ void SV_RemoveId_f(void)
void SV_WriteId_f(void)
{
char name[MAX_PATH];
_snprintf(name, MAX_PATH, "%s", bannedcfgfile.string);
Q_snprintf(name, MAX_PATH, "%s", bannedcfgfile.string);
Con_Printf("Writing %s.\n", name);
FILE *f = FS_Open(name, "wt");
@ -6383,7 +6393,7 @@ void SV_KickPlayer(int nPlayerSlot, int nReason)
&rgchT[1],
"\n********************************************\nYou have been automatically disconnected\nfrom this secure server because an illegal\ncheat was detected on your computer.\nRepeat violators may be permanently banned\nfrom all secure servers.\n\nFor help cleaning your system of cheats, visit:\nhttp://www.counter-strike.net/cheat.html\n********************************************\n\n"
);
Netchan_Transmit(&g_psvs.clients[nPlayerSlot].netchan, strlen(rgchT) + 1, (byte *)rgchT);
Netchan_Transmit(&g_psvs.clients[nPlayerSlot].netchan, Q_strlen(rgchT) + 1, (byte *)rgchT);
Q_sprintf(rgchT, "%s was automatically disconnected\nfrom this secure server.\n", client->name);
for (int i = 0; i < g_psvs.maxclients; i++)

View File

@ -279,7 +279,7 @@ void CSteam3Server::Activate()
usSteamPort = 26900;
argSteamPort = COM_CheckParm("-sport");
if (argSteamPort > 0)
usSteamPort = atoi(com_argv[argSteamPort + 1]);
usSteamPort = Q_atoi(com_argv[argSteamPort + 1]);
eSMode = eServerModeAuthenticationAndSecure;
if (net_local_adr.type == NA_IP)
unIP = ntohl(*(u_long *)&net_local_adr.ip[0]);

View File

@ -817,27 +817,27 @@ void DLL_SetModKey(modinfo_t *pinfo, char *pkey, char *pvalue)
else if (!Q_stricmp(pkey, "version"))
{
pinfo->bIsMod = 1;
pinfo->version = atoi(pvalue);
pinfo->version = Q_atoi(pvalue);
}
else if (!Q_stricmp(pkey, "size"))
{
pinfo->bIsMod = 1;
pinfo->size = atoi(pvalue);
pinfo->size = Q_atoi(pvalue);
}
else if (!Q_stricmp(pkey, "svonly"))
{
pinfo->bIsMod = 1;
pinfo->svonly = atoi(pvalue) != 0;
pinfo->svonly = Q_atoi(pvalue) != 0;
}
else if (!Q_stricmp(pkey, "cldll"))
{
pinfo->bIsMod = 1;
pinfo->cldll = atoi(pvalue) != 0;
pinfo->cldll = Q_atoi(pvalue) != 0;
}
else if (!Q_stricmp(pkey, "secure"))
{
pinfo->bIsMod = 1;
pinfo->secure = atoi(pvalue) != 0;
pinfo->secure = Q_atoi(pvalue) != 0;
}
else if (!Q_stricmp(pkey, "hlversion"))
{
@ -846,14 +846,14 @@ void DLL_SetModKey(modinfo_t *pinfo, char *pkey, char *pvalue)
}
else if (!Q_stricmp(pkey, "edicts"))
{
pinfo->num_edicts = atoi(pvalue);
pinfo->num_edicts = Q_atoi(pvalue);
if (pinfo->num_edicts < 900)
pinfo->num_edicts = 900;
}
else if (!Q_stricmp(pkey, "crcclientdll"))
{
pinfo->bIsMod = 1;
pinfo->clientDllCRC = atoi(pvalue) != 0;
pinfo->clientDllCRC = Q_atoi(pvalue) != 0;
}
else if (!Q_stricmp(pkey, "type"))
{

View File

@ -350,7 +350,7 @@ void Sys_InitMemory(void)
i = COM_CheckParm("-heapsize");
if (i && i < Cmd_Argc() - 1)
host_parms.memsize = atoi(Cmd_Argv(i + 1)) * 1024;
host_parms.memsize = Q_atoi(Cmd_Argv(i + 1)) * 1024;
#ifdef _WIN32
MEMORYSTATUS lpBuffer;
@ -706,7 +706,7 @@ bool CDedicatedServerAPI::Init_noVirt(char *basedir, char *cmdline, CreateInterf
#else
Q_strcpy(this->m_OrigCmd, cmdline);
#endif
if (!strstr(cmdline, "-nobreakpad"))
if (!Q_strstr(cmdline, "-nobreakpad"))
{
CRehldsPlatformHolder::get()->SteamAPI_UseBreakpadCrashHandler(va("%d", build_number()), "Aug 8 2013", "11:17:26", 0, 0, 0);
}

View File

@ -80,7 +80,7 @@ int lump_sorter(const void *lump1, const void *lump2)
{
const texlumpinfo_t *plump1 = (const texlumpinfo_t *)lump1;
const texlumpinfo_t *plump2 = (const texlumpinfo_t *)lump2;
return strcmp(plump1->lump.name, plump2->lump.name);
return Q_strcmp(plump1->lump.name, plump2->lump.name);
}
/* <c6153> ../engine/textures.c:72 */
@ -106,7 +106,7 @@ qboolean TEX_InitFromWad(char *path)
Q_strncpy(szTmpPath, path, 1022);
szTmpPath[1022] = 0;
if (!strchr(szTmpPath, ';'))
if (!Q_strchr(szTmpPath, ';'))
Q_strcat(szTmpPath, ";");
for (pszWadFile = strtok(szTmpPath, ";"); pszWadFile; pszWadFile = strtok(NULL, ";"))
{

View File

@ -190,7 +190,7 @@ NOXREF int ParseFloats(const char *pText, float *pFloat, int count)
if (pTemp)
{
pFloat[index] = (float)atof(pTemp);
pFloat[index] = (float)Q_atof(pTemp);
count--;
index++;
}

View File

@ -1136,7 +1136,7 @@ NOXREF void Cache_Print_Models_And_Totals(void)
//pack names into the array.
for (cd = cache_head.next; cd != &cache_head; cd = cd->next)
{
if (strstr(cd->name,".mdl"))
if (Q_strstr(cd->name,".mdl"))
sortarray[i++] = cd;
}
@ -1177,7 +1177,7 @@ NOXREF void Cache_Print_Sounds_And_Totals(void)
//pack names into the array.
for (cd = cache_head.next; cd != &cache_head; cd = cd->next)
{
if (strstr(cd->name,".wav"))
if (Q_strstr(cd->name,".wav"))
sortarray[i++] = cd;
}

View File

@ -842,7 +842,7 @@
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>psapi.lib;ws2_32.lib;$(ProjectDir)../lib/steam_api.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>psapi.lib;ws2_32.lib;$(ProjectDir)../lib/steam_api.lib;$(ProjectDir)../lib/libacof32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<MinimumRequiredVersion>
</MinimumRequiredVersion>
<ModuleDefinitionFile>
@ -1070,7 +1070,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>psapi.lib;ws2_32.lib;$(ProjectDir)../lib/steam_api.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>psapi.lib;ws2_32.lib;$(ProjectDir)../lib/steam_api.lib;$(ProjectDir)../lib/libacof32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<MinimumRequiredVersion>
</MinimumRequiredVersion>
<ModuleDefinitionFile>

View File

@ -28,7 +28,7 @@ CRehldsFlightRecorder::CRehldsFlightRecorder() {
//initialize meta region header
char* metaPos = (char*)m_MetaRegion;
const char* metaSignature = "REHLDS_FLIGHTREC_META";
metaPos += sprintf(metaPos, "%s%s%s:", metaSignature, metaSignature, metaSignature);
metaPos += Q_sprintf(metaPos, "%s%s%s:", metaSignature, metaSignature, metaSignature);
m_pMetaHeader = (meta_header*)metaPos;
metaPos += sizeof(meta_header);
@ -42,7 +42,7 @@ CRehldsFlightRecorder::CRehldsFlightRecorder() {
//initialize data region header
char* dataPos = (char*)m_DataRegion;
const char* dataSignature = "REHLDS_FLIGHTREC_DATA";
dataPos += sprintf(dataPos, "%s%s%s:", dataSignature, dataSignature, dataSignature);
dataPos += Q_sprintf(dataPos, "%s%s%s:", dataSignature, dataSignature, dataSignature);
m_pDataHeader = (data_header*)dataPos;
dataPos += sizeof(data_header);
@ -84,7 +84,7 @@ void CRehldsFlightRecorder::MoveToStart() {
m_pDataHeader->prevItrLastPos = m_pRecorderState->wpos;
m_pRecorderState->wpos = 0;
} else {
memcpy(m_DataRegionPtr, m_DataRegionPtr + m_pRecorderState->lastMsgBeginPos, m_pRecorderState->wpos - m_pRecorderState->lastMsgBeginPos);
Q_memcpy(m_DataRegionPtr, m_DataRegionPtr + m_pRecorderState->lastMsgBeginPos, m_pRecorderState->wpos - m_pRecorderState->lastMsgBeginPos);
m_pRecorderState->wpos -= m_pRecorderState->lastMsgBeginPos;
m_pDataHeader->prevItrLastPos = m_pRecorderState->lastMsgBeginPos;
m_pRecorderState->lastMsgBeginPos = 0;
@ -157,12 +157,12 @@ void CRehldsFlightRecorder::WriteBuffer(const void* data, unsigned int len) {
MoveToStart();
}
memcpy(m_DataRegionPtr + m_pRecorderState->wpos, data, len);
Q_memcpy(m_DataRegionPtr + m_pRecorderState->wpos, data, len);
m_pRecorderState->wpos += len;
}
void CRehldsFlightRecorder::WriteString(const char* s) {
WriteBuffer(s, strlen(s) + 1);
WriteBuffer(s, Q_strlen(s) + 1);
}
void CRehldsFlightRecorder::WriteInt8(int8 v) {

View File

@ -21,7 +21,7 @@
AbstractHookChainRegistry::AbstractHookChainRegistry()
{
memset(m_Hooks, 0, sizeof(m_Hooks));
Q_memset(m_Hooks, 0, sizeof(m_Hooks));
m_NumHooks = 0;
}
@ -39,7 +39,7 @@ void AbstractHookChainRegistry::removeHook(void* hookFunc) {
for (int i = 0; i < m_NumHooks; i++) {
if (hookFunc == m_Hooks[i]) {
if(--m_NumHooks != i)
memmove(&m_Hooks[i], &m_Hooks[i + 1], (m_NumHooks - i) * sizeof(m_Hooks[0]));
Q_memmove(&m_Hooks[i], &m_Hooks[i + 1], (m_NumHooks - i) * sizeof(m_Hooks[0]));
return;
}

View File

@ -1,16 +1,16 @@
#include "precompiled.h"
cvar_t sv_rehlds_movecmdrate_max_avg = { "sv_rehlds_movecmdrate_max_avg", "750", 0, 750.0f, NULL };
cvar_t sv_rehlds_movecmdrate_max_burst = { "sv_rehlds_movecmdrate_max_burst", "1125", 0, 1125.0f, NULL };
cvar_t sv_rehlds_stringcmdrate_max_avg = {"sv_rehlds_stringcmdrate_max_avg", "64", 0, 32.0f, NULL};
cvar_t sv_rehlds_stringcmdrate_max_burst = {"sv_rehlds_stringcmdrate_max_burst", "96", 0, 80.0f, NULL};
cvar_t sv_rehlds_movecmdrate_max_burst = { "sv_rehlds_movecmdrate_max_burst", "1500", 0, 1500.0f, NULL };
cvar_t sv_rehlds_stringcmdrate_max_avg = {"sv_rehlds_stringcmdrate_max_avg", "64", 0, 64.0f, NULL};
cvar_t sv_rehlds_stringcmdrate_max_burst = {"sv_rehlds_stringcmdrate_max_burst", "128", 0, 128.0f, NULL};
CMoveCommandRateLimiter g_MoveCommandRateLimiter;
CStringCommandsRateLimiter g_StringCommandsRateLimiter;
CMoveCommandRateLimiter::CMoveCommandRateLimiter() {
memset(m_AverageMoveCmdRate, 0, sizeof(m_AverageMoveCmdRate));
memset(m_CurrentMoveCmds, 0, sizeof(m_CurrentMoveCmds));
Q_memset(m_AverageMoveCmdRate, 0, sizeof(m_AverageMoveCmdRate));
Q_memset(m_CurrentMoveCmds, 0, sizeof(m_CurrentMoveCmds));
m_LastCheckTime = 0.0;
}
@ -74,8 +74,8 @@ void CMoveCommandRateLimiter::CheckAverageRate(unsigned int clientId) {
}
CStringCommandsRateLimiter::CStringCommandsRateLimiter() {
memset(m_AverageStringCmdRate, 0, sizeof(m_AverageStringCmdRate));
memset(m_CurrentStringCmds, 0, sizeof(m_CurrentStringCmds));
Q_memset(m_AverageStringCmdRate, 0, sizeof(m_AverageStringCmdRate));
Q_memset(m_CurrentStringCmds, 0, sizeof(m_CurrentStringCmds));
m_LastCheckTime = 0.0;
}