From fedc99bb853466ffc73c36b14579400ca16bc4b8 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Fri, 13 Jan 2017 21:37:05 +0700 Subject: [PATCH] Add a detailed print in SV_HandleClientMessage --- README.md | 2 +- rehlds/engine/pr_cmds.cpp | 4 ++-- rehlds/engine/pr_edict.cpp | 3 ++- rehlds/engine/sv_user.cpp | 8 ++++++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 635cdcf..90b6aaf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Rehlds [![Build Status](http://teamcity.rehlds.org/app/rest/builds/buildType:(id:Rehlds_Publish)/statusIcon)](http://teamcity.rehlds.org/viewType.html?buildTypeId=Rehlds_Publish&guest=1) [![Download](http://rehlds.ru/version/rehlds/)](http://teamcity.rehlds.org/guestAuth/downloadArtifacts.html?buildTypeId=Rehlds_Publish&buildId=lastSuccessful) +# Rehlds [![Build Status](http://teamcity.rehlds.org/app/rest/builds/buildType:(id:Rehlds_Publish)/statusIcon)](http://teamcity.rehlds.org/viewType.html?buildTypeId=Rehlds_Publish&guest=1) [![Download](https://camo.githubusercontent.com/65c70643ec7b40eea50971003624c2fb04d8d375/687474703a2f2f7265686c64732e6f72672f76657273696f6e2f7265686c64732e737667)](http://teamcity.rehlds.org/guestAuth/downloadArtifacts.html?buildTypeId=Rehlds_Publish&buildId=lastSuccessful) Reverse-engineered (and bugfixed) HLDS diff --git a/rehlds/engine/pr_cmds.cpp b/rehlds/engine/pr_cmds.cpp index 95f2089..1ccbc39 100644 --- a/rehlds/engine/pr_cmds.cpp +++ b/rehlds/engine/pr_cmds.cpp @@ -171,7 +171,7 @@ int EXT_FUNC PF_modelindex(const char *pstr) int EXT_FUNC ModelFrames(int modelIndex) { - if (modelIndex <= 0 || modelIndex >= 512) + if (modelIndex <= 0 || modelIndex >= MAX_MODELS) { Con_DPrintf("Bad sprite index!\n"); return 1; @@ -1990,7 +1990,7 @@ edict_t* EXT_FUNC PF_CreateFakeClient_I(const char *netname) Info_SetValueForKey(fakeclient->userinfo, "model", "gordon", MAX_INFO_STRING); Info_SetValueForKey(fakeclient->userinfo, "topcolor", "1", MAX_INFO_STRING); Info_SetValueForKey(fakeclient->userinfo, "bottomcolor", "1", MAX_INFO_STRING); - fakeclient->sendinfo = 1; + fakeclient->sendinfo = TRUE; SV_ExtractFromUserinfo(fakeclient); fakeclient->network_userid.m_SteamID = ISteamGameServer_CreateUnauthenticatedUserConnection(); diff --git a/rehlds/engine/pr_edict.cpp b/rehlds/engine/pr_edict.cpp index bf4540a..ecdb25c 100644 --- a/rehlds/engine/pr_edict.cpp +++ b/rehlds/engine/pr_edict.cpp @@ -636,5 +636,6 @@ void* EXT_FUNC GetModelPtr(edict_t *pEdict) { return NULL; } - return Mod_Extradata(g_psv.models[pEdict->v.modelindex]); + + return Mod_Extradata(Mod_Handle(pEdict->v.modelindex)); } diff --git a/rehlds/engine/sv_user.cpp b/rehlds/engine/sv_user.cpp index 4aef345..cd6ca39 100644 --- a/rehlds/engine/sv_user.cpp +++ b/rehlds/engine/sv_user.cpp @@ -1716,6 +1716,14 @@ void EXT_FUNC SV_HandleClientMessage_api(IGameClient* client, int8 opcode) { void(*func)(client_t *) = sv_clcfuncs[opcode].pfnParse; if (func) func(cl); + +#ifdef REHLDS_FIXES + if (msg_badread) + { + Con_Printf("SV_ReadClientMessage: badread on %s, opcode %s\n", host_client->name, sv_clcfuncs[opcode].pszname); + } +#endif + } void SV_ExecuteClientMessage(client_t *cl)