mirror of
https://github.com/ENSL/NS.git
synced 2024-11-22 20:51:35 +00:00
Mantis: 1041
o Players can now join teams properly before latejointime has expired Added back in steamid based authids so the server player detail lookups work correctly without nexus. git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@137 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
parent
d5b42e9508
commit
b58c4910ef
1 changed files with 30 additions and 2 deletions
|
@ -2480,13 +2480,41 @@ void AvHTeam::UpdateResources()
|
|||
this->mLastResourceUpdateTime = theCurrentTime;
|
||||
}
|
||||
}
|
||||
|
||||
// puzl: 1041
|
||||
// o Added back in steamid based authids
|
||||
#ifdef AVH_PLAYTEST_BUILD
|
||||
// Function that is backwards-compatible with WON ids
|
||||
string AvHSUGetPlayerAuthIDString(edict_t* inPlayer)
|
||||
{
|
||||
const char* kSteamIDInvalidID = "-1";
|
||||
string thePlayerAuthID;
|
||||
|
||||
// Try to get SteamID
|
||||
const char* theSteamID = g_engfuncs.pfnGetPlayerAuthId(inPlayer);
|
||||
if(strcmp(theSteamID, kSteamIDInvalidID))
|
||||
{
|
||||
thePlayerAuthID = theSteamID;
|
||||
}
|
||||
// If that fails, get WonID and put it into a string
|
||||
else
|
||||
{
|
||||
int theWonID = g_engfuncs.pfnGetPlayerWONId(inPlayer);
|
||||
thePlayerAuthID = MakeStringFromInt(theWonID);
|
||||
}
|
||||
|
||||
return thePlayerAuthID;
|
||||
}
|
||||
#endif
|
||||
AvHServerPlayerData* AvHTeam::GetServerPlayerData(edict_t* inEdict)
|
||||
{
|
||||
#ifdef AVH_PLAYTEST_BUILD
|
||||
string theNetworkID = AvHSUGetPlayerAuthIDString(inEdict);
|
||||
#else
|
||||
string theNetworkID = AvHNexus::getNetworkID(inEdict);
|
||||
#endif
|
||||
return &this->mServerPlayerData[theNetworkID];
|
||||
}
|
||||
|
||||
// :puzl
|
||||
void AvHTeam::UpdateServerPlayerData()
|
||||
{
|
||||
const float kServerPlayerDataUpdateInterval = 1.0f;
|
||||
|
|
Loading…
Reference in a new issue