When SourceTV got fixed I found this bug and mentioned it here and only now I looked into it.
For some reason, the Server fails to send the SVC_ServerInfonet message and because of this, it appears that it's stuck on Authenticating with Steam...
The cause of this has something todo with CBaseServer::SendPendingServerInfo() failing to call CBaseClient::SendServerInfo();. Maybe m_bSendServerInfo isn't properly set, but as far as I can tell it should be set because CBaseClient::SetSignonState is called properly with SIGNONSTATE_CONNECTED
I hope this somewhat helps to fix it, but currently I cannot connect to any HLTV server except when I host it with one Gmod Instance and then join it with another Gmod instance that was launched with -multirun.
I got it working by overriding CBaseClient::SetSignonState and CBaseServer::SendPendingServerInfo (It's bad, but it fixes the issue):
std::unordered_map<void*, bool> client;
bool hook_CBaseClient_SetSignonState(void* funky_class, int state, int spawncount)
{
if (state == 2)
client[funky_class] = true;
return detour_CBaseClient_SetSignonState.GetTrampoline<CBaseClient_SetSignonState>()(funky_class, state, spawncount);;
}
CBaseClient_SendServerInfo func_CBaseClient_SendServerInfo;
void hook_CBaseServer_SendPendingServerInfo(void* funky_class)
{
IServer* srv = (IServer*)funky_class;
if (!srv->IsHLTV())
return;
for (auto&[key, value] : client)
{
if (value)
{
func_CBaseClient_SendServerInfo(key);
value = false;
}
}
}
[...]
NOTE: I tested it on a local Windows DS and on a Linux DS.
Details
When SourceTV got fixed I found this bug and mentioned it here and only now I looked into it. For some reason, the Server fails to send the
SVC_ServerInfo
net message and because of this, it appears that it's stuck onAuthenticating with Steam...
The cause of this has something todo with
CBaseServer::SendPendingServerInfo()
failing to callCBaseClient::SendServerInfo();
. Maybem_bSendServerInfo
isn't properly set, but as far as I can tell it should be set becauseCBaseClient::SetSignonState
is called properly withSIGNONSTATE_CONNECTED
I hope this somewhat helps to fix it, but currently I cannot connect to any HLTV server except when I host it with one Gmod Instance and then join it with another Gmod instance that was launched with
-multirun
.I got it working by overriding CBaseClient::SetSignonState and CBaseServer::SendPendingServerInfo (It's bad, but it fixes the issue):
Steps to reproduce