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

@@ -53,7 +53,7 @@ public class OnlinePlayerManager : DisposableMediatorSubscriberBase
var newVisiblePlayers = _newVisiblePlayers.ToList();
_newVisiblePlayers.Clear();
Logger.LogTrace("Has new visible players, pushing character data");
PushCharacterData(newVisiblePlayers.Select(c => c.OnlineUser.User).ToList());
PushCharacterData(newVisiblePlayers.Select(c => c.OnlineUser.UserData).ToList());
}
private void PlayerManagerOnPlayerHasChanged()

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
{

View File

@@ -244,7 +244,8 @@ public sealed class PairManager : DisposableMediatorSubscriberBase
pair.UserPair.OtherPermissions.IsDisableSounds(),
pair.UserPair.OtherPermissions.IsDisableVFX());
pair.ApplyLastReceivedData();
if (!pair.IsPaused)
pair.ApplyLastReceivedData();
RecreateLazy();
}
@@ -269,7 +270,8 @@ public sealed class PairManager : DisposableMediatorSubscriberBase
pair.UserPair.OwnPermissions.IsDisableSounds(),
pair.UserPair.OwnPermissions.IsDisableVFX());
pair.ApplyLastReceivedData();
if (!pair.IsPaused)
pair.ApplyLastReceivedData();
RecreateLazy();
}