mirror of
https://github.com/rehlds/rehlds.git
synced 2025-04-23 23:03:32 +03:00
Refactoring around __FUNCTION__, small message changes.
This commit is contained in:
parent
d13eed2256
commit
8f4b9b603c
@ -721,7 +721,7 @@ void Cmd_AddCommand(char *cmd_name, xcommand_t function)
|
|||||||
|
|
||||||
if (host_initialized)
|
if (host_initialized)
|
||||||
{
|
{
|
||||||
Sys_Error(__FUNCTION__ " after host_initialized");
|
Sys_Error(__FUNCTION__ ": called after host_initialized");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check in variables list
|
// Check in variables list
|
||||||
|
@ -1363,13 +1363,13 @@ qboolean DELTA_ParseDescription(char *name, delta_t **ppdesc, char *pstream)
|
|||||||
|
|
||||||
if (!ppdesc)
|
if (!ppdesc)
|
||||||
{
|
{
|
||||||
Sys_Error(__FUNCTION__ " with no delta_description_t\n");
|
Sys_Error(__FUNCTION__ ": called with no delta_description_t\n");
|
||||||
}
|
}
|
||||||
*ppdesc = 0;
|
*ppdesc = 0;
|
||||||
|
|
||||||
if (!pstream)
|
if (!pstream)
|
||||||
{
|
{
|
||||||
Sys_Error(__FUNCTION__ " with no data stream\n");
|
Sys_Error(__FUNCTION__ ": called with no data stream\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
|
@ -1494,17 +1494,17 @@ void NET_SendPacket(netsrc_t sock, int length, void *data, const netadr_t& to)
|
|||||||
// let dedicated servers continue after errors
|
// let dedicated servers continue after errors
|
||||||
if (g_pcls.state == ca_dedicated)
|
if (g_pcls.state == ca_dedicated)
|
||||||
{
|
{
|
||||||
Con_Printf(__FUNCTION__ " ERROR: %s\n", NET_ErrorString(err));
|
Con_Printf(__FUNCTION__ ": ERROR: %s\n", NET_ErrorString(err));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (err == WSAEADDRNOTAVAIL || err == WSAENOBUFS)
|
if (err == WSAEADDRNOTAVAIL || err == WSAENOBUFS)
|
||||||
{
|
{
|
||||||
Con_DPrintf(__FUNCTION__ " Warning: %s : %s\n", NET_ErrorString(err), NET_AdrToString(to));
|
Con_DPrintf(__FUNCTION__ ": Warning: %s : %s\n", NET_ErrorString(err), NET_AdrToString(to));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Sys_Error(__FUNCTION__ " ERROR: %s\n", NET_ErrorString(err));
|
Sys_Error(__FUNCTION__ ": ERROR: %s\n", NET_ErrorString(err));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1049,7 +1049,7 @@ int EXT_FUNC PF_precache_sound_I(const char *s)
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
Host_Error(__FUNCTION__ ": Sound '%s' failed to precache because the item count is over the %d limit.\n"
|
Host_Error(__FUNCTION__ ": Sound '%s' failed to precache because the item count is over the %d limit.\n"
|
||||||
"Reduce the number of brush models and/or regular models in the map to correct this.",
|
"Reduce the number of brush models and/or regular models in the map to correct this.",
|
||||||
s, MAX_SOUNDS);
|
s, MAX_SOUNDS);
|
||||||
}
|
}
|
||||||
@ -2238,56 +2238,56 @@ void EXT_FUNC PF_MessageEnd_I(void)
|
|||||||
void EXT_FUNC PF_WriteByte_I(int iValue)
|
void EXT_FUNC PF_WriteByte_I(int iValue)
|
||||||
{
|
{
|
||||||
if (!gMsgStarted)
|
if (!gMsgStarted)
|
||||||
Sys_Error(__FUNCTION__ " called with no active message\n");
|
Sys_Error(__FUNCTION__ ": called with no active message\n");
|
||||||
MSG_WriteByte(&gMsgBuffer, iValue);
|
MSG_WriteByte(&gMsgBuffer, iValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXT_FUNC PF_WriteChar_I(int iValue)
|
void EXT_FUNC PF_WriteChar_I(int iValue)
|
||||||
{
|
{
|
||||||
if (!gMsgStarted)
|
if (!gMsgStarted)
|
||||||
Sys_Error(__FUNCTION__ " called with no active message\n");
|
Sys_Error(__FUNCTION__ ": called with no active message\n");
|
||||||
MSG_WriteChar(&gMsgBuffer, iValue);
|
MSG_WriteChar(&gMsgBuffer, iValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXT_FUNC PF_WriteShort_I(int iValue)
|
void EXT_FUNC PF_WriteShort_I(int iValue)
|
||||||
{
|
{
|
||||||
if (!gMsgStarted)
|
if (!gMsgStarted)
|
||||||
Sys_Error(__FUNCTION__ " called with no active message\n");
|
Sys_Error(__FUNCTION__ ": called with no active message\n");
|
||||||
MSG_WriteShort(&gMsgBuffer, iValue);
|
MSG_WriteShort(&gMsgBuffer, iValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXT_FUNC PF_WriteLong_I(int iValue)
|
void EXT_FUNC PF_WriteLong_I(int iValue)
|
||||||
{
|
{
|
||||||
if (!gMsgStarted)
|
if (!gMsgStarted)
|
||||||
Sys_Error(__FUNCTION__ " called with no active message\n");
|
Sys_Error(__FUNCTION__ ": called with no active message\n");
|
||||||
MSG_WriteLong(&gMsgBuffer, iValue);
|
MSG_WriteLong(&gMsgBuffer, iValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXT_FUNC PF_WriteAngle_I(float flValue)
|
void EXT_FUNC PF_WriteAngle_I(float flValue)
|
||||||
{
|
{
|
||||||
if (!gMsgStarted)
|
if (!gMsgStarted)
|
||||||
Sys_Error(__FUNCTION__ " called with no active message\n");
|
Sys_Error(__FUNCTION__ ": called with no active message\n");
|
||||||
MSG_WriteAngle(&gMsgBuffer, flValue);
|
MSG_WriteAngle(&gMsgBuffer, flValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXT_FUNC PF_WriteCoord_I(float flValue)
|
void EXT_FUNC PF_WriteCoord_I(float flValue)
|
||||||
{
|
{
|
||||||
if (!gMsgStarted)
|
if (!gMsgStarted)
|
||||||
Sys_Error(__FUNCTION__ " called with no active message\n");
|
Sys_Error(__FUNCTION__ ": called with no active message\n");
|
||||||
MSG_WriteShort(&gMsgBuffer, (int)(flValue * 8.0));
|
MSG_WriteShort(&gMsgBuffer, (int)(flValue * 8.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXT_FUNC PF_WriteString_I(const char *sz)
|
void EXT_FUNC PF_WriteString_I(const char *sz)
|
||||||
{
|
{
|
||||||
if (!gMsgStarted)
|
if (!gMsgStarted)
|
||||||
Sys_Error(__FUNCTION__ " called with no active message\n");
|
Sys_Error(__FUNCTION__ ": called with no active message\n");
|
||||||
MSG_WriteString(&gMsgBuffer, sz);
|
MSG_WriteString(&gMsgBuffer, sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXT_FUNC PF_WriteEntity_I(int iValue)
|
void EXT_FUNC PF_WriteEntity_I(int iValue)
|
||||||
{
|
{
|
||||||
if (!gMsgStarted)
|
if (!gMsgStarted)
|
||||||
Sys_Error(__FUNCTION__ " called with no active message\n");
|
Sys_Error(__FUNCTION__ ": called with no active message\n");
|
||||||
MSG_WriteShort(&gMsgBuffer, iValue);
|
MSG_WriteShort(&gMsgBuffer, iValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -423,7 +423,7 @@ void SV_ReallocateDynamicData(void)
|
|||||||
{
|
{
|
||||||
if (!g_psv.max_edicts)
|
if (!g_psv.max_edicts)
|
||||||
{
|
{
|
||||||
Con_DPrintf(__FUNCTION__ " with sv.max_edicts == 0\n");
|
Con_DPrintf(__FUNCTION__ ": sv.max_edicts == 0\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ const char *Sys_FindFirst(const char *path, char *basename)
|
|||||||
{
|
{
|
||||||
if (g_hfind != -1)
|
if (g_hfind != -1)
|
||||||
{
|
{
|
||||||
Sys_Error(__FUNCTION__ " without close");
|
Sys_Error(__FUNCTION__ ": called without close");
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *psz = FS_FindFirst(path, &g_hfind, 0);
|
const char *psz = FS_FindFirst(path, &g_hfind, 0);
|
||||||
@ -333,7 +333,10 @@ const char *Sys_FindFirstPathID(const char *path, char *pathid)
|
|||||||
{
|
{
|
||||||
//const char *psz;//unused?
|
//const char *psz;//unused?
|
||||||
if (g_hfind != -1)
|
if (g_hfind != -1)
|
||||||
Sys_Error("Sys_FindFirst without close");
|
{
|
||||||
|
Sys_Error(__FUNCTION__ ": called without close");
|
||||||
|
}
|
||||||
|
|
||||||
return FS_FindFirst(path, &g_hfind, pathid);
|
return FS_FindFirst(path, &g_hfind, pathid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,9 +42,9 @@
|
|||||||
#define __LINE__AS_STRING __HACK_LINE_AS_STRING__(__LINE__) //Gives you the line number in constant string form
|
#define __LINE__AS_STRING __HACK_LINE_AS_STRING__(__LINE__) //Gives you the line number in constant string form
|
||||||
|
|
||||||
#if defined _MSC_VER || defined __INTEL_COMPILER
|
#if defined _MSC_VER || defined __INTEL_COMPILER
|
||||||
#define NOXREFCHECK __asm { push [ebp + 4] } Sys_Error("[NOXREFCHECK]:" __FUNCTION__ " (" __FILE__ ":" __LINE__AS_STRING") NOXREF, but called from 0x%.08x")
|
#define NOXREFCHECK __asm { push [ebp + 4] } Sys_Error("[NOXREFCHECK]: " __FUNCTION__ " (" __FILE__ ":" __LINE__AS_STRING") NOXREF, but called from 0x%.08x")
|
||||||
#else
|
#else
|
||||||
#define NOXREFCHECK const char* noxref_msg = "[NOXREFCHECK]:" __FUNCTION__ " (" __FILE__ ":" __LINE__AS_STRING") NOXREF, but called from 0x%.08x"; \
|
#define NOXREFCHECK const char* noxref_msg = "[NOXREFCHECK]: " __FUNCTION__ " (" __FILE__ ":" __LINE__AS_STRING") NOXREF, but called from 0x%.08x"; \
|
||||||
asm volatile ( \
|
asm volatile ( \
|
||||||
"pushl 4(%%ebp)\n\t" \
|
"pushl 4(%%ebp)\n\t" \
|
||||||
"pushl %0\n\t" \
|
"pushl %0\n\t" \
|
||||||
|
@ -40,11 +40,11 @@ bool AbstractHookChainRegistry::findHook(void* hookFunc) const
|
|||||||
void AbstractHookChainRegistry::addHook(void* hookFunc, int priority)
|
void AbstractHookChainRegistry::addHook(void* hookFunc, int priority)
|
||||||
{
|
{
|
||||||
if (!hookFunc) {
|
if (!hookFunc) {
|
||||||
Sys_Error(__FUNCTION__ " Parameter hookFunc can't be a nullptr");
|
Sys_Error(__FUNCTION__ ": Parameter hookFunc can't be a nullptr");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (findHook(hookFunc)) {
|
if (findHook(hookFunc)) {
|
||||||
Sys_Error(__FUNCTION__ " The same handler can't be used twice on the hookchain.");
|
Sys_Error(__FUNCTION__ ": The same handler can't be used twice on the hookchain.");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto i = 0; i < MAX_HOOKS_IN_CHAIN; i++)
|
for (auto i = 0; i < MAX_HOOKS_IN_CHAIN; i++)
|
||||||
@ -63,7 +63,7 @@ void AbstractHookChainRegistry::addHook(void* hookFunc, int priority)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_NumHooks >= MAX_HOOKS_IN_CHAIN) {
|
if (m_NumHooks >= MAX_HOOKS_IN_CHAIN) {
|
||||||
Sys_Error(__FUNCTION__ " MAX_HOOKS_IN_CHAIN limit hit");
|
Sys_Error(__FUNCTION__ ": MAX_HOOKS_IN_CHAIN limit hit");
|
||||||
}
|
}
|
||||||
|
|
||||||
m_NumHooks++;
|
m_NumHooks++;
|
||||||
|
@ -160,7 +160,7 @@ bool EXT_FUNC CRehldsServerStatic::IsLogActive()
|
|||||||
IGameClient* EXT_FUNC CRehldsServerStatic::GetClient(int id)
|
IGameClient* EXT_FUNC CRehldsServerStatic::GetClient(int id)
|
||||||
{
|
{
|
||||||
if (id < 0 || id >= g_psvs.maxclients)
|
if (id < 0 || id >= g_psvs.maxclients)
|
||||||
Sys_Error(__FUNCTION__": invalid id provided: %d", id);
|
Sys_Error(__FUNCTION__ ": invalid id provided: %d", id);
|
||||||
|
|
||||||
return g_GameClients[id];
|
return g_GameClients[id];
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ IGameClient* EXT_FUNC CRehldsServerStatic::GetClient(int id)
|
|||||||
client_t* EXT_FUNC CRehldsServerStatic::GetClient_t(int id)
|
client_t* EXT_FUNC CRehldsServerStatic::GetClient_t(int id)
|
||||||
{
|
{
|
||||||
if (id < 0 || id >= g_psvs.maxclients)
|
if (id < 0 || id >= g_psvs.maxclients)
|
||||||
Sys_Error(__FUNCTION__": invalid id provided: %d", id);
|
Sys_Error(__FUNCTION__ ": invalid id provided: %d", id);
|
||||||
|
|
||||||
return &g_psvs.clients[id];
|
return &g_psvs.clients[id];
|
||||||
}
|
}
|
||||||
@ -285,7 +285,7 @@ IGameClient* GetRehldsApiClient(client_t* cl)
|
|||||||
int idx = cl - g_psvs.clients;
|
int idx = cl - g_psvs.clients;
|
||||||
if (idx < 0 || idx >= g_psvs.maxclients)
|
if (idx < 0 || idx >= g_psvs.maxclients)
|
||||||
{
|
{
|
||||||
Sys_Error(__FUNCTION__": Invalid client index %d", idx);
|
Sys_Error(__FUNCTION__ ": Invalid client index %d", idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
return g_GameClients[idx];
|
return g_GameClients[idx];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user