Skip to content

Commit

Permalink
代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
lakwsh authored Dec 2, 2023
1 parent dd41b28 commit 6b67e7e
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions l4dtoolz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,16 @@ void l4dtoolz::ClientSettingsChanged(edict_t *pEdict) // rate
PLUGIN_RESULT l4dtoolz::ClientConnect(bool *bAllowConnect, edict_t *pEntity, const char *, const char *, char *, int)
{
if(sv_steam_bypass.GetInt()!=1) return PLUGIN_CONTINUE;
const CSteamID *steamID = g_engine->GetClientSteamID(pEntity);
if(!steamID){
Msg("[L4DToolZ] invalid steamID.\n");
reject:
*bAllowConnect = false;
return PLUGIN_STOP;
}
ValidateAuthTicketResponse_t rsp = {*(uint64 *)steamID};
ValidateAuthTicketResponse_t rsp = {(uint64)g_engine->GetClientXUID(pEntity)};
#ifdef WIN32
((void (__thiscall *)(uintptr_t *, void *))authrsp_org)(steam3_ptr, &rsp);
#else
((void (*)(uintptr_t *, void *))authrsp_org)(steam3_ptr, &rsp);
#endif
if(g_engine->GetPlayerUserId(pEntity)==-1) goto reject;
if(g_engine->GetPlayerUserId(pEntity)==-1){
*bAllowConnect = false;
return PLUGIN_STOP;
}
Msg("[L4DToolZ] %llu validated.\n", rsp.id);
return PLUGIN_CONTINUE;
}
Expand Down

0 comments on commit 6b67e7e

Please sign in to comment.