adjust last seen format in game interface

This commit is contained in:
RaidMax 2023-06-02 16:35:00 -05:00
parent e4535e09a0
commit e843f839f5
6 changed files with 12 additions and 9 deletions

View File

@ -527,8 +527,8 @@ OnExecuteCommand( event )
OnSetClientDataCompleted( event ) OnSetClientDataCompleted( event )
{ {
// IW4MAdmin let us know it persisted (success or fail) data = ParseDataString( event.data );
LogDebug( "Set Client Data -> subtype = " + CoerceUndefined( event.subType ) + ", status = " + CoerceUndefined( event.data["status"] ) ); LogDebug( "Set Client Data -> subtype = " + CoerceUndefined( event.subType ) + ", status = " + CoerceUndefined( data["status"] ) );
} }
CoerceUndefined( object ) CoerceUndefined( object )

View File

@ -134,7 +134,7 @@ PlayerSpawnEvents()
self IPrintLnBold( "Welcome, your level is ^5" + clientData.permissionLevel ); self IPrintLnBold( "Welcome, your level is ^5" + clientData.permissionLevel );
wait( 2.0 ); wait( 2.0 );
self IPrintLnBold( "You were last seen ^5" + clientData.lastConnection ); self IPrintLnBold( "You were last seen ^5" + clientData.lastConnection + " ago" );
} }

View File

@ -12,11 +12,11 @@ OnPlayerConnect()
for ( ;; ) for ( ;; )
{ {
level waittill( "connecting", player ); level waittill( "connecting", player );
player thread DisplaypopupsWaiter(); player thread DisplayPopupsWaiter();
} }
} }
DisplaypopupsWaiter() DisplayPopupsWaiter()
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self.ranknotifyqueue = []; self.ranknotifyqueue = [];

View File

@ -208,7 +208,7 @@ const plugin = {
data = { data = {
level: client.level, level: client.level,
clientId: client.clientId, clientId: client.clientId,
lastConnection: client.lastConnection, lastConnection: client.timeSinceLastConnectionString,
tag: tagMeta?.value ?? '', tag: tagMeta?.value ?? '',
performance: clientStats?.performance ?? 200.0 performance: clientStats?.performance ?? 200.0
}; };

View File

@ -117,6 +117,9 @@ namespace SharedLibraryCore.Database.Models
[NotMapped] public TeamType Team { get; set; } [NotMapped] public TeamType Team { get; set; }
[NotMapped] public string TeamName { get; set; } [NotMapped] public string TeamName { get; set; }
[NotMapped]
public string TimeSinceLastConnectionString => (DateTime.UtcNow - LastConnection).HumanizeForCurrentCulture();
[NotMapped] [NotMapped]
// this is kinda dirty, but I need localizable level names // this is kinda dirty, but I need localizable level names
public ClientPermission ClientPermission => new ClientPermission public ClientPermission ClientPermission => new ClientPermission