fix some of the impl

This commit is contained in:
Stanley Dimant 2024-09-04 17:10:54 +02:00
parent e1111e2097
commit 6567c4deba
9 changed files with 55 additions and 51 deletions

View file

@ -47,6 +47,7 @@ public class Pair
public long LastAppliedDataBytes => CachedPlayer?.LastAppliedDataBytes ?? -1;
public long LastAppliedDataTris => CachedPlayer?.LastAppliedDataTris ?? -1;
public long LastAppliedApproximateVRAMBytes => CachedPlayer?.LastAppliedApproximateVRAMBytes ?? -1;
public string Ident => _onlineUserIdentDto?.Ident ?? string.Empty;
public UserData UserData => UserPair.User;
@ -161,7 +162,7 @@ public class Pair
}
CachedPlayer?.Dispose();
CachedPlayer = _cachedPlayerFactory.Create(new OnlineUserIdentDto(UserData, _onlineUserIdentDto!.Ident));
CachedPlayer = _cachedPlayerFactory.Create(this);
}
finally
{
@ -189,11 +190,11 @@ public class Pair
try
{
_creationSemaphore.Wait();
_onlineUserIdentDto = null;
LastReceivedCharacterData = null;
var player = CachedPlayer;
CachedPlayer = null;
player?.Dispose();
_onlineUserIdentDto = null;
}
finally
{