fix some of the impl
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user