1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

update to game interface/integration for persistent stat data

This commit is contained in:
RaidMax
2022-07-13 16:10:16 -05:00
parent 28d56dae09
commit eaac12fa75
8 changed files with 102 additions and 13 deletions

View File

@ -53,8 +53,6 @@ init()
level thread OnPlayerConnect();
}
//////////////////////////////////
// Client Methods
//////////////////////////////////
@ -167,6 +165,28 @@ DisplayWelcomeData()
self IPrintLnBold( "You were last seen ^5" + clientData.lastConnection );
}
SetPersistentData()
{
storedClientId = self GetPlayerData( "bests", "none" );
if ( storedClientId != 0 )
{
if ( level.iw4adminIntegrationDebug == 1 )
{
IPrintLn( "Uploading persistent client id " + storedClientId );
}
SetClientMeta( "PersistentStatClientId", storedClientId );
}
if ( level.iw4adminIntegrationDebug == 1 )
{
IPrintLn( "Persisting client id " + self.persistentClientId );
}
self SetPlayerData( "bests", "none", int( self.persistentClientId ) );
}
PlayerConnectEvents()
{
self endon( "disconnect" );
@ -643,6 +663,7 @@ OnClientDataReceived( event )
self.persistentClientId = event.data["clientId"];
self thread DisplayWelcomeData();
self setPersistentData();
}
OnExecuteCommand( event )