aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/serverauthentication.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-21 10:27:34 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-21 10:27:34 +0000
commit34aaaf1ce6819e9a5fdd2c0cd04259d89e085052 (patch)
tree4b943c80780a9a2b2dec0ba8e644d24713971d78 /NorthstarDedicatedTest/serverauthentication.cpp
parente2c028702096367c6d10f3659d4c11f598829e2c (diff)
downloadNorthstarLauncher-34aaaf1ce6819e9a5fdd2c0cd04259d89e085052.tar.gz
NorthstarLauncher-34aaaf1ce6819e9a5fdd2c0cd04259d89e085052.zip
fix some timing issues on dedi
Diffstat (limited to 'NorthstarDedicatedTest/serverauthentication.cpp')
-rw-r--r--NorthstarDedicatedTest/serverauthentication.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/NorthstarDedicatedTest/serverauthentication.cpp b/NorthstarDedicatedTest/serverauthentication.cpp
index 51e0a184..0e82b5e0 100644
--- a/NorthstarDedicatedTest/serverauthentication.cpp
+++ b/NorthstarDedicatedTest/serverauthentication.cpp
@@ -72,7 +72,7 @@ void ServerAuthenticationManager::StartPlayerAuthServer()
addrPtr = typeStart + 3;
hostent* resolvedRemoteAddr = gethostbyname((const char*)addrPtr);
- if (!request.has_param("id") || !request.has_param("authToken") || !resolvedRemoteAddr || ((in_addr**)resolvedRemoteAddr->h_addr_list)[0]->S_un.S_addr != remoteAddr)
+ if (!request.has_param("id") || !request.has_param("authToken") || request.body.size() >= 65335 || !resolvedRemoteAddr || ((in_addr**)resolvedRemoteAddr->h_addr_list)[0]->S_un.S_addr != remoteAddr)
{
response.set_content("{\"success\":false}", "application/json");
return;
@@ -344,7 +344,12 @@ char __fastcall CNetChan___ProcessMessagesHook(void* self, void* buf)
}
g_ServerAuthenticationManager->m_additionalPlayerData[sender].netChanProcessingLimitTime += (Plat_FloatTime() * 1000) - (startTime * 1000);
- if (g_ServerAuthenticationManager->m_additionalPlayerData[sender].netChanProcessingLimitTime >= Cvar_net_chan_limit_msec_per_sec->m_nValue)
+
+ int32_t limit = Cvar_net_chan_limit_msec_per_sec->m_nValue;
+ if (g_pHostState->m_iCurrentState != HostState_t::HS_RUN)
+ limit *= 2; // give clients more headroom in these states, as alot of clients will tend to time out here
+
+ if (g_ServerAuthenticationManager->m_additionalPlayerData[sender].netChanProcessingLimitTime >= limit)
{
spdlog::warn("Client {} hit netchan processing limit with {}ms of processing time this second (max is {})", (char*)sender + 0x16, g_ServerAuthenticationManager->m_additionalPlayerData[sender].netChanProcessingLimitTime, Cvar_net_chan_limit_msec_per_sec->m_nValue);