finally removed the logging and removed the duplicate case from begin auth session hook. probably fine
This commit is contained in:
parent
0aab8e0bd6
commit
4c7ec14d52
@ -153,11 +153,6 @@ CDetour* detourCBaseServer__ConnectClient = nullptr;
|
|||||||
CDetour *g_Detour_CSteam3Server__OnValidateAuthTicketResponse = NULL;
|
CDetour *g_Detour_CSteam3Server__OnValidateAuthTicketResponse = NULL;
|
||||||
CDetour *g_Detour_CBaseClient__SetSteamID = NULL;
|
CDetour *g_Detour_CBaseClient__SetSteamID = NULL;
|
||||||
|
|
||||||
bool g_bSuppressBeginAuthSession = false;
|
|
||||||
|
|
||||||
CSteamID g_lastClientSteamID;
|
|
||||||
const void* g_lastAuthTicket;
|
|
||||||
int g_lastcbAuthTicket;
|
|
||||||
|
|
||||||
char passwordBuffer[255];
|
char passwordBuffer[255];
|
||||||
|
|
||||||
@ -174,29 +169,6 @@ CSteam3Server *Steam3Server()
|
|||||||
return g_pSteam3ServerFunc();
|
return g_pSteam3ServerFunc();
|
||||||
}
|
}
|
||||||
|
|
||||||
SH_DECL_MANUALHOOK3(MHook_BeginAuthSession, 0, 0, 0, EBeginAuthSessionResult, const void *, int, CSteamID);
|
|
||||||
EBeginAuthSessionResult Hook_BeginAuthSession(const void *pAuthTicket, int cbAuthTicket, CSteamID steamID)
|
|
||||||
{
|
|
||||||
if (!g_bSuppressBeginAuthSession)
|
|
||||||
{
|
|
||||||
g_pSM->LogMessage(myself, "inside Hook_ BeginAuthSession 1. %s", steamID.Render());
|
|
||||||
RETURN_META_VALUE(MRES_IGNORED, k_EBeginAuthSessionResultOK);
|
|
||||||
}
|
|
||||||
g_bSuppressBeginAuthSession = false;
|
|
||||||
|
|
||||||
if (strcmp(steamID.Render(), g_lastClientSteamID.Render()) == 0
|
|
||||||
&& g_lastAuthTicket == pAuthTicket
|
|
||||||
&& g_lastcbAuthTicket == cbAuthTicket)
|
|
||||||
{
|
|
||||||
// Let the server know everything is fine
|
|
||||||
g_pSM->LogMessage(myself, "inside Hook_ BeginAuthSession 2. %s", steamID.Render());
|
|
||||||
RETURN_META_VALUE(MRES_SUPERCEDE, k_EBeginAuthSessionResultOK);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_pSM->LogMessage(myself, "inside Hook_ BeginAuthSession 3. %s", steamID.Render());
|
|
||||||
RETURN_META_VALUE(MRES_IGNORED, k_EBeginAuthSessionResultDuplicateRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct ValidateAuthTicketResponse_t
|
struct ValidateAuthTicketResponse_t
|
||||||
{
|
{
|
||||||
enum { k_iCallback = k_iSteamUserCallbacks + 43 };
|
enum { k_iCallback = k_iSteamUserCallbacks + 43 };
|
||||||
@ -230,6 +202,7 @@ public:
|
|||||||
bool SteamAuthFailed;
|
bool SteamAuthFailed;
|
||||||
bool ManualRetry;
|
bool ManualRetry;
|
||||||
bool Webclient;
|
bool Webclient;
|
||||||
|
bool SuppressBeginAuthSession;
|
||||||
|
|
||||||
void *pvTicket;
|
void *pvTicket;
|
||||||
int cbTicket;
|
int cbTicket;
|
||||||
@ -254,6 +227,7 @@ public:
|
|||||||
this->SteamAuthFailed = false;
|
this->SteamAuthFailed = false;
|
||||||
this->ManualRetry = false;
|
this->ManualRetry = false;
|
||||||
this->Webclient = false;
|
this->Webclient = false;
|
||||||
|
this->SuppressBeginAuthSession = false;
|
||||||
|
|
||||||
// Calculate and store the ticket pointer
|
// Calculate and store the ticket pointer
|
||||||
this->pvTicket = (void *)((intptr_t)this->pCookie + sizeof(uint64));
|
this->pvTicket = (void *)((intptr_t)this->pCookie + sizeof(uint64));
|
||||||
@ -262,6 +236,23 @@ public:
|
|||||||
};
|
};
|
||||||
StringHashMap<ConnectClientStorage> g_ConnectClientStorage;
|
StringHashMap<ConnectClientStorage> g_ConnectClientStorage;
|
||||||
|
|
||||||
|
SH_DECL_MANUALHOOK3(MHook_BeginAuthSession, 0, 0, 0, EBeginAuthSessionResult, const void *, int, CSteamID);
|
||||||
|
EBeginAuthSessionResult Hook_BeginAuthSession(const void *pAuthTicket, int cbAuthTicket, CSteamID steamID)
|
||||||
|
{
|
||||||
|
ConnectClientStorage Storage;
|
||||||
|
g_ConnectClientStorage.retrieve(steamID.Render(), &Storage);
|
||||||
|
if (!Storage.SuppressBeginAuthSession)
|
||||||
|
{
|
||||||
|
//g_pSM->LogMessage(myself, "inside Hook_ BeginAuthSession 1. %s", steamID.Render());
|
||||||
|
RETURN_META_VALUE(MRES_IGNORED, k_EBeginAuthSessionResultOK);
|
||||||
|
}
|
||||||
|
Storage.SuppressBeginAuthSession = false;
|
||||||
|
g_ConnectClientStorage.replace(steamID.Render(), Storage);
|
||||||
|
|
||||||
|
//g_pSM->LogMessage(myself, "inside Hook_ BeginAuthSession 2. %s", steamID.Render());
|
||||||
|
RETURN_META_VALUE(MRES_SUPERCEDE, k_EBeginAuthSessionResultOK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//ai generated function
|
//ai generated function
|
||||||
uint64 GenerateSteamIDFromName(const char *pchName)
|
uint64 GenerateSteamIDFromName(const char *pchName)
|
||||||
@ -296,8 +287,9 @@ DETOUR_DECL_MEMBER1(CBaseClient__SetSteamID, void, const CSteamID &, steamID)
|
|||||||
char ipString[30];
|
char ipString[30];
|
||||||
V_snprintf(ipString, sizeof(ipString), "%u.%u.%u.%u", storage.address.ip[0], storage.address.ip[1], storage.address.ip[2], storage.address.ip[3]);
|
V_snprintf(ipString, sizeof(ipString), "%u.%u.%u.%u", storage.address.ip[0], storage.address.ip[1], storage.address.ip[2], storage.address.ip[3]);
|
||||||
|
|
||||||
//smutils->LogMessage(myself, "inside SetSteamID steamAuthFailed. IpsAllowed: %s. ipString: %s", IpsAllowed, ipString);
|
if (g_SvLogging.GetInt())
|
||||||
//connects from the IP's designated for the webclients.
|
smutils->LogMessage(myself, "inside SetSteamID steamAuthFailed. IpsAllowed: %s. ipString: %s", IpsAllowed, ipString);
|
||||||
|
//connects from the IP's designated for the webclients.
|
||||||
if (strcmp(IpsAllowed, ipString) == 0)
|
if (strcmp(IpsAllowed, ipString) == 0)
|
||||||
{
|
{
|
||||||
uint64 steamID64 = GenerateSteamIDFromName(storage.pchName);
|
uint64 steamID64 = GenerateSteamIDFromName(storage.pchName);
|
||||||
@ -364,7 +356,7 @@ DETOUR_DECL_MEMBER1(CSteam3Server__OnValidateAuthTicketResponse, int, ValidateAu
|
|||||||
{
|
{
|
||||||
if (slotID.steamid == clientID.steamid)
|
if (slotID.steamid == clientID.steamid)
|
||||||
{
|
{
|
||||||
g_pSM->LogMessage(myself, "Disconnecting idle left over session for steamID: %s", aSteamID);
|
//g_pSM->LogMessage(myself, "Disconnecting idle left over session for steamID: %s", aSteamID);
|
||||||
pSlot->Disconnect("Disconnecting dead left over session.");
|
pSlot->Disconnect("Disconnecting dead left over session.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -387,13 +379,13 @@ DETOUR_DECL_MEMBER9(CBaseServer__ConnectClient, IClient*, netadr_t&, address, in
|
|||||||
return DETOUR_MEMBER_CALL(CBaseServer__ConnectClient)(address, nProtocol, iChallenge, iClientChallenge, nAuthProtocol, pchName, pchPassword, pCookie, cbCookie);
|
return DETOUR_MEMBER_CALL(CBaseServer__ConnectClient)(address, nProtocol, iChallenge, iClientChallenge, nAuthProtocol, pchName, pchPassword, pCookie, cbCookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_pSM->LogMessage(myself, "entered MEMBER9");
|
//g_pSM->LogMessage(myself, "entered MEMBER9");
|
||||||
|
|
||||||
if (g_pSteam3Server->m_pSteamGameServer != g_pLastHookedSteamGameServer)
|
if (g_pSteam3Server->m_pSteamGameServer != g_pLastHookedSteamGameServer)
|
||||||
{
|
{
|
||||||
//the hook tends to die, hence its reapplied whenever needed. thats probably very dumb.
|
//the hook tends to die, hence its reapplied whenever needed. thats probably very dumb.
|
||||||
//does however seem to stop "S3: Client connected with invalid ticket:" for nosteamers.
|
//does however seem to stop "S3: Client connected with invalid ticket:" for nosteamers.
|
||||||
g_pSM->LogMessage(myself, "Steam GameServer pointer changed! Old: %p, New: %p", g_pLastHookedSteamGameServer, g_pSteam3Server->m_pSteamGameServer);
|
//g_pSM->LogMessage(myself, "Steam GameServer pointer changed! Old: %p, New: %p", g_pLastHookedSteamGameServer, g_pSteam3Server->m_pSteamGameServer);
|
||||||
if (g_pLastHookedSteamGameServer != NULL)
|
if (g_pLastHookedSteamGameServer != NULL)
|
||||||
{
|
{
|
||||||
// Remove old hook if it exists
|
// Remove old hook if it exists
|
||||||
@ -429,38 +421,29 @@ DETOUR_DECL_MEMBER9(CBaseServer__ConnectClient, IClient*, netadr_t&, address, in
|
|||||||
V_strncpy(passwordBuffer, pchPassword, 255);
|
V_strncpy(passwordBuffer, pchPassword, 255);
|
||||||
uint64 ullSteamID = *(uint64 *)pCookie;
|
uint64 ullSteamID = *(uint64 *)pCookie;
|
||||||
|
|
||||||
g_lastClientSteamID = CSteamID(ullSteamID);
|
CSteamID ClientSteamID = CSteamID(ullSteamID);
|
||||||
void *pvTicket = (void *)((intptr_t)pCookie + sizeof(uint64));
|
|
||||||
int cbTicket = cbCookie - sizeof(uint64);
|
|
||||||
|
|
||||||
char aSteamID[32];
|
char aSteamID[32];
|
||||||
V_strncpy(aSteamID, g_lastClientSteamID.Render(), 32);
|
V_strncpy(aSteamID, ClientSteamID.Render(), 32);
|
||||||
|
|
||||||
// If client is in async state remove the old object and fake an async retVal
|
// If client is in async state remove the old object and fake an async retVal
|
||||||
// This can happen if the async ClientPreConnectEx takes too long to be called
|
// This can happen if the async ClientPreConnectEx takes too long to be called
|
||||||
// and the client auto-retries.
|
// and the client auto-retries.
|
||||||
bool AsyncWaiting = false;
|
bool AsyncWaiting = false;
|
||||||
bool ExistingSteamid = false;
|
bool ExistingSteamid = false;
|
||||||
bool SkipEndAuthSession = false;
|
|
||||||
EBeginAuthSessionResult result;
|
EBeginAuthSessionResult result;
|
||||||
ConnectClientStorage Storage(address, nProtocol, iChallenge, iClientChallenge, nAuthProtocol, pchName, pchPassword, pCookie, cbCookie);
|
ConnectClientStorage Storage(address, nProtocol, iChallenge, iClientChallenge, nAuthProtocol, pchName, pchPassword, pCookie, cbCookie);
|
||||||
|
|
||||||
if (g_ConnectClientStorage.retrieve(aSteamID, &Storage))
|
if (g_ConnectClientStorage.retrieve(aSteamID, &Storage))
|
||||||
{
|
{
|
||||||
g_pSM->LogMessage(myself, "entered has clientstorage. %s", aSteamID);
|
//g_pSM->LogMessage(myself, "entered has clientstorage. %s", aSteamID);
|
||||||
ExistingSteamid = true;
|
ExistingSteamid = true;
|
||||||
g_ConnectClientStorage.remove(aSteamID);
|
g_ConnectClientStorage.remove(aSteamID);
|
||||||
if (!Storage.SteamAuthFailed)
|
|
||||||
{
|
|
||||||
g_pSM->LogMessage(myself, "inside clientstorage about to do endauthsession for steamID: %s", aSteamID);
|
|
||||||
g_pEndAuthSession(steamGameServer, g_lastClientSteamID);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only wait for async on auto-retry, manual retries should go through the full chain
|
// Only wait for async on auto-retry, manual retries should go through the full chain
|
||||||
// Don't want to leave the client waiting forever if something breaks in the async forward
|
// Don't want to leave the client waiting forever if something breaks in the async forward
|
||||||
if (Storage.iClientChallenge == iClientChallenge)
|
if (Storage.iClientChallenge == iClientChallenge)
|
||||||
{
|
{
|
||||||
g_pSM->LogMessage(myself, "entered async retry. %s", aSteamID);
|
//g_pSM->LogMessage(myself, "entered async retry. %s", aSteamID);
|
||||||
AsyncWaiting = true;
|
AsyncWaiting = true;
|
||||||
|
|
||||||
//reject async nosteamers or async steam player who is not authenticated
|
//reject async nosteamers or async steam player who is not authenticated
|
||||||
@ -471,63 +454,29 @@ DETOUR_DECL_MEMBER9(CBaseServer__ConnectClient, IClient*, netadr_t&, address, in
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
//async steam player with a clientstorage, use the ticket from the previous clientstorage.
|
//async steam player with a clientstorage, use the ticket from the previous clientstorage.
|
||||||
g_lastcbAuthTicket = Storage.cbTicket;
|
result = g_pBeginAuthSession(steamGameServer, Storage.pvTicket, Storage.cbTicket, ClientSteamID);
|
||||||
g_lastAuthTicket = Storage.pvTicket;
|
|
||||||
result = g_pBeginAuthSession(steamGameServer, Storage.pvTicket, Storage.cbTicket, g_lastClientSteamID);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//client did a manual retry,
|
//client did a manual retry,
|
||||||
g_pSM->LogMessage(myself, "entered manual retry. %s", aSteamID);
|
//create new auth storage with fresh ticket and challenge
|
||||||
if (Storage.SteamAuthFailed)
|
Storage = ConnectClientStorage(address, nProtocol, iChallenge, iClientChallenge, nAuthProtocol, pchName, pchPassword, pCookie, cbCookie);
|
||||||
{
|
//g_pSM->LogMessage(myself, "entered manual retry. %s", aSteamID);
|
||||||
//its a nosteamer. or a steam player who failed auth once so far. so dont use the clientstorage ticket
|
result = g_pBeginAuthSession(steamGameServer, Storage.pvTicket, Storage.cbTicket, ClientSteamID);
|
||||||
g_lastcbAuthTicket = cbTicket;
|
|
||||||
g_lastAuthTicket = pvTicket;
|
|
||||||
SkipEndAuthSession = true;
|
|
||||||
g_pSM->LogMessage(myself, "manual retry with SteamAuthFailed before Begin Auth Session. %s", aSteamID);
|
|
||||||
//result = k_EBeginAuthSessionResultInvalidTicket;
|
|
||||||
result = g_pBeginAuthSession(steamGameServer, pvTicket, cbTicket, g_lastClientSteamID);
|
|
||||||
g_pSM->LogMessage(myself, "manual retry with SteamAuthFailed after Begin Auth Session. %s", aSteamID);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_pSM->LogMessage(myself, "in client storage about to do new storage. %s", aSteamID);
|
|
||||||
//create a new client storage for the steamplayer.
|
|
||||||
Storage = ConnectClientStorage(address, nProtocol, iChallenge, iClientChallenge, nAuthProtocol, pchName, pchPassword, pCookie, cbCookie);
|
|
||||||
|
|
||||||
//use the ticket from the new clientstorage.
|
|
||||||
g_lastcbAuthTicket = Storage.cbTicket;
|
|
||||||
g_lastAuthTicket = Storage.pvTicket;
|
|
||||||
g_pSM->LogMessage(myself, "in client storage about to do beginauthsession. %s", aSteamID);
|
|
||||||
result = g_pBeginAuthSession(steamGameServer, Storage.pvTicket, Storage.cbTicket, g_lastClientSteamID);
|
|
||||||
g_pSM->LogMessage(myself, "in client storage after beginauthsession. %s", aSteamID);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//nosteamer or steam player without clientstorage,
|
result = g_pBeginAuthSession(steamGameServer, Storage.pvTicket, Storage.cbTicket, ClientSteamID);
|
||||||
g_lastcbAuthTicket = cbTicket;
|
//g_pSM->LogMessage(myself, "without client storage after beginauth session. %s", aSteamID);
|
||||||
g_lastAuthTicket = pvTicket;
|
}
|
||||||
|
|
||||||
//NOTE: if the first connecting client on a map is in k_OnClientPreConnectEx_Reject then this beginAuthSession call can crash the server
|
//g_pSM->LogMessage(myself, "about to do endAuthSession. %s", aSteamID);
|
||||||
//however if the first connecting client instead is in k_OnClientPreConnectEx_Accept then the after following
|
g_pEndAuthSession(steamGameServer, ClientSteamID); //xen said engine might start its own authsession, so end ours here.
|
||||||
//k_OnClientPreConnectEx_Reject will work fine. Ex_Accept is always used until the server is full, hence should Ex_Reject
|
|
||||||
//never be the first to connect on a new map.
|
|
||||||
g_pSM->LogMessage(myself, "without client storage about to do beginauth session. %s", aSteamID);
|
|
||||||
result = g_pBeginAuthSession(steamGameServer, pvTicket, cbTicket, g_lastClientSteamID);
|
|
||||||
g_pSM->LogMessage(myself, "without client storage after beginauth session. %s", aSteamID);
|
|
||||||
}
|
|
||||||
if (!SkipEndAuthSession)
|
|
||||||
{
|
|
||||||
g_pSM->LogMessage(myself, "about to do endAuthSession. %s", aSteamID);
|
|
||||||
g_pEndAuthSession(steamGameServer, g_lastClientSteamID); //xen said engine might start its own authsession, so end ours here.
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NoSteam = g_SvNoSteam.GetInt();
|
bool NoSteam = g_SvNoSteam.GetInt();
|
||||||
bool SteamAuthFailed = false;
|
bool SteamAuthFailed = false;
|
||||||
g_pSM->LogMessage(myself, "g_pBeginAuthSession result: %d. %s", result, aSteamID);
|
//g_pSM->LogMessage(myself, "g_pBeginAuthSession result: %d. %s", result, aSteamID);
|
||||||
|
|
||||||
if (result != k_EBeginAuthSessionResultOK)
|
if (result != k_EBeginAuthSessionResultOK)
|
||||||
{
|
{
|
||||||
@ -551,7 +500,7 @@ DETOUR_DECL_MEMBER9(CBaseServer__ConnectClient, IClient*, netadr_t&, address, in
|
|||||||
//if the nosteam player is trying to spoof a steam player reject the nosteamer.
|
//if the nosteam player is trying to spoof a steam player reject the nosteamer.
|
||||||
if (!Storage.SteamAuthFailed)
|
if (!Storage.SteamAuthFailed)
|
||||||
{
|
{
|
||||||
g_pSM->LogMessage(myself, "about to do rejectconnection 1. %s", aSteamID);
|
//g_pSM->LogMessage(myself, "about to do rejectconnection 1. %s", aSteamID);
|
||||||
g_pRejectConnectionFunc((CBaseServer*)this, address, iClientChallenge, "Steam ID already in use.");
|
g_pRejectConnectionFunc((CBaseServer*)this, address, iClientChallenge, "Steam ID already in use.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -560,7 +509,7 @@ DETOUR_DECL_MEMBER9(CBaseServer__ConnectClient, IClient*, netadr_t&, address, in
|
|||||||
//a nosteamer spoofing another nosteamer that is not ingame is fine too.
|
//a nosteamer spoofing another nosteamer that is not ingame is fine too.
|
||||||
if (Storage.pClient && Storage.pClient->IsConnected() && Storage.pClient->IsActive())
|
if (Storage.pClient && Storage.pClient->IsConnected() && Storage.pClient->IsActive())
|
||||||
{
|
{
|
||||||
g_pSM->LogMessage(myself, "about to do rejectconnection 2. %s", aSteamID);
|
//g_pSM->LogMessage(myself, "about to do rejectconnection 2. %s", aSteamID);
|
||||||
g_pRejectConnectionFunc((CBaseServer*)this, address, iClientChallenge, "Steam ID already in use.");
|
g_pRejectConnectionFunc((CBaseServer*)this, address, iClientChallenge, "Steam ID already in use.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -569,12 +518,12 @@ DETOUR_DECL_MEMBER9(CBaseServer__ConnectClient, IClient*, netadr_t&, address, in
|
|||||||
// Kick existing player
|
// Kick existing player
|
||||||
if(Storage.pClient)
|
if(Storage.pClient)
|
||||||
{
|
{
|
||||||
g_pSM->LogMessage(myself, "about to do disconnect. %s", aSteamID);
|
//g_pSM->LogMessage(myself, "about to do disconnect. %s", aSteamID);
|
||||||
Storage.pClient->Disconnect("Same Steam ID connected.");
|
Storage.pClient->Disconnect("Same Steam ID connected.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_pSM->LogMessage(myself, "about to do rejectconnection 3. %s", aSteamID);
|
//g_pSM->LogMessage(myself, "about to do rejectconnection 3. %s", aSteamID);
|
||||||
g_pRejectConnectionFunc((CBaseServer*)this, address, iClientChallenge, "Please try again later.");
|
g_pRejectConnectionFunc((CBaseServer*)this, address, iClientChallenge, "Please try again later.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -593,7 +542,7 @@ DETOUR_DECL_MEMBER9(CBaseServer__ConnectClient, IClient*, netadr_t&, address, in
|
|||||||
g_pConnectForward->PushString(pchName);
|
g_pConnectForward->PushString(pchName);
|
||||||
g_pConnectForward->PushStringEx(passwordBuffer, 255, SM_PARAM_STRING_UTF8 | SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK);
|
g_pConnectForward->PushStringEx(passwordBuffer, 255, SM_PARAM_STRING_UTF8 | SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK);
|
||||||
g_pConnectForward->PushString(ipString);
|
g_pConnectForward->PushString(ipString);
|
||||||
g_pConnectForward->PushString(g_lastClientSteamID.Render());
|
g_pConnectForward->PushString(ClientSteamID.Render());
|
||||||
g_pConnectForward->PushStringEx(rejectReason, 255, SM_PARAM_STRING_UTF8 | SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK);
|
g_pConnectForward->PushStringEx(rejectReason, 255, SM_PARAM_STRING_UTF8 | SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK);
|
||||||
g_pConnectForward->Execute(&retVal);
|
g_pConnectForward->Execute(&retVal);
|
||||||
}
|
}
|
||||||
@ -607,10 +556,10 @@ DETOUR_DECL_MEMBER9(CBaseServer__ConnectClient, IClient*, netadr_t&, address, in
|
|||||||
{
|
{
|
||||||
//calling this on nosteamers does sometimes cause a server explosion.
|
//calling this on nosteamers does sometimes cause a server explosion.
|
||||||
//but not when creating a nosteamer with their first ticket
|
//but not when creating a nosteamer with their first ticket
|
||||||
g_pSM->LogMessage(myself, "k_OnClientPreConnectEx_Reject reached about to do endAuthSession. steamID: %s", aSteamID);
|
//g_pSM->LogMessage(myself, "k_OnClientPreConnectEx_Reject reached about to do endAuthSession. steamID: %s", aSteamID);
|
||||||
g_pEndAuthSession(steamGameServer, g_lastClientSteamID);
|
g_pEndAuthSession(steamGameServer, ClientSteamID);
|
||||||
}
|
}
|
||||||
g_pSM->LogMessage(myself, "k_OnClientPreConnectEx_Reject reached about to do g_pRejectConnectionFunc. steamID: %s", aSteamID);
|
//g_pSM->LogMessage(myself, "k_OnClientPreConnectEx_Reject reached about to do g_pRejectConnectionFunc. steamID: %s", aSteamID);
|
||||||
g_pRejectConnectionFunc((CBaseServer*)this, address, iClientChallenge, rejectReason);
|
g_pRejectConnectionFunc((CBaseServer*)this, address, iClientChallenge, rejectReason);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -633,12 +582,16 @@ DETOUR_DECL_MEMBER9(CBaseServer__ConnectClient, IClient*, netadr_t&, address, in
|
|||||||
}
|
}
|
||||||
|
|
||||||
// k_OnClientPreConnectEx_Accept
|
// k_OnClientPreConnectEx_Accept
|
||||||
g_pSM->LogMessage(myself, "about to do DETOUR_MEMBER_CALL. %s", aSteamID);
|
//g_pSM->LogMessage(myself, "about to do DETOUR_MEMBER_CALL. %s", aSteamID);
|
||||||
g_bSuppressBeginAuthSession = true;
|
|
||||||
|
Storage.SuppressBeginAuthSession = true;
|
||||||
|
g_ConnectClientStorage.replace(aSteamID, Storage);
|
||||||
auto client = DETOUR_MEMBER_CALL(CBaseServer__ConnectClient)(address, nProtocol, iChallenge, iClientChallenge, nAuthProtocol, pchName, pchPassword, pCookie, cbCookie);
|
auto client = DETOUR_MEMBER_CALL(CBaseServer__ConnectClient)(address, nProtocol, iChallenge, iClientChallenge, nAuthProtocol, pchName, pchPassword, pCookie, cbCookie);
|
||||||
//auto client = DETOUR_MEMBER_MCALL_ORIGINAL(CBaseServer__ConnectClient, this)(address, nProtocol, iChallenge, iClientChallenge, nAuthProtocol, pchName, pchPassword, pCookie, cbCookie);
|
|
||||||
g_bSuppressBeginAuthSession = false;
|
Storage.SuppressBeginAuthSession = false;
|
||||||
g_pSM->LogMessage(myself, "finished DETOUR_MEMBER_CALL. %s", aSteamID);
|
g_ConnectClientStorage.replace(aSteamID, Storage);
|
||||||
|
|
||||||
|
//g_pSM->LogMessage(myself, "finished DETOUR_MEMBER_CALL. %s", aSteamID);
|
||||||
|
|
||||||
//doing another retrieve in case of SetSteamID for webclient.
|
//doing another retrieve in case of SetSteamID for webclient.
|
||||||
ConnectClientStorage storage_setSteamID;
|
ConnectClientStorage storage_setSteamID;
|
||||||
@ -656,7 +609,7 @@ DETOUR_DECL_MEMBER9(CBaseServer__ConnectClient, IClient*, netadr_t&, address, in
|
|||||||
Response.m_SteamID = newSteamID;
|
Response.m_SteamID = newSteamID;
|
||||||
Response.m_eAuthSessionResponse = k_EAuthSessionResponseAuthTicketInvalid; //nosteamer monkeys
|
Response.m_eAuthSessionResponse = k_EAuthSessionResponseAuthTicketInvalid; //nosteamer monkeys
|
||||||
Response.m_OwnerSteamID = Response.m_SteamID;
|
Response.m_OwnerSteamID = Response.m_SteamID;
|
||||||
g_pSM->LogMessage(myself, "about to do OnValidateAuthTicketResponse webclient. %s", newSteamID.Render());
|
//g_pSM->LogMessage(myself, "about to do OnValidateAuthTicketResponse webclient. %s", newSteamID.Render());
|
||||||
DETOUR_MEMBER_MCALL_CALLBACK(CSteam3Server__OnValidateAuthTicketResponse, g_pSteam3Server)(&Response);
|
DETOUR_MEMBER_MCALL_CALLBACK(CSteam3Server__OnValidateAuthTicketResponse, g_pSteam3Server)(&Response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -668,14 +621,14 @@ DETOUR_DECL_MEMBER9(CBaseServer__ConnectClient, IClient*, netadr_t&, address, in
|
|||||||
if (client && SteamAuthFailed)
|
if (client && SteamAuthFailed)
|
||||||
{
|
{
|
||||||
ValidateAuthTicketResponse_t Response;
|
ValidateAuthTicketResponse_t Response;
|
||||||
Response.m_SteamID = g_lastClientSteamID;
|
Response.m_SteamID = ClientSteamID;
|
||||||
Response.m_eAuthSessionResponse = k_EAuthSessionResponseAuthTicketInvalid; //nosteamer monkeys
|
Response.m_eAuthSessionResponse = k_EAuthSessionResponseAuthTicketInvalid; //nosteamer monkeys
|
||||||
Response.m_OwnerSteamID = Response.m_SteamID;
|
Response.m_OwnerSteamID = Response.m_SteamID;
|
||||||
g_pSM->LogMessage(myself, "about to do OnValidateAuthTicketResponse. %s", aSteamID);
|
//g_pSM->LogMessage(myself, "about to do OnValidateAuthTicketResponse. %s", aSteamID);
|
||||||
DETOUR_MEMBER_MCALL_CALLBACK(CSteam3Server__OnValidateAuthTicketResponse, g_pSteam3Server)(&Response);
|
DETOUR_MEMBER_MCALL_CALLBACK(CSteam3Server__OnValidateAuthTicketResponse, g_pSteam3Server)(&Response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_pSM->LogMessage(myself, "MEMBER 9 end. %s", aSteamID);
|
//g_pSM->LogMessage(myself, "MEMBER 9 end. %s", aSteamID);
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user