mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 09:35:26 +00:00
fixes
This commit is contained in:
parent
6f67567f89
commit
80473b232b
@ -112,7 +112,7 @@ namespace QSB
|
||||
Destroy(GetComponent<PreventShipDestruction>());
|
||||
EventList.Reset();
|
||||
PlayerRegistry.PlayerList.ForEach(player => player.HudMarker?.Remove());
|
||||
NetworkServer.connections.ToList()Where(x => x.playerControllers[0].gameObject.GetComponent<PlayerTransformSync>().netId.Value != PlayerRegistry.LocalPlayerId).ForEach(CleanupConnection);
|
||||
NetworkServer.connections.ToList().ForEach(CleanupConnection);
|
||||
_lobby.CanEditName = true;
|
||||
}
|
||||
|
||||
@ -139,12 +139,16 @@ namespace QSB
|
||||
DebugLog.ToConsole($"{playerName} disconnected.", OWML.Common.MessageType.Info);
|
||||
PlayerRegistry.RemovePlayer(playerId);
|
||||
|
||||
var netIds = connection.clientOwnedObjects.Select(x => x.Value).ToList();
|
||||
netIds.ForEach(CleanupNetworkBehaviour);
|
||||
if (playerId != PlayerRegistry.LocalPlayerId)
|
||||
{
|
||||
var netIds = connection.clientOwnedObjects.Select(x => x.Value).ToList();
|
||||
netIds.ForEach(CleanupNetworkBehaviour);
|
||||
}
|
||||
}
|
||||
|
||||
public void CleanupNetworkBehaviour(uint netId)
|
||||
{
|
||||
DebugLog.ToConsole($"Cleaning up object {netId}");
|
||||
var networkBehaviours = FindObjectsOfType<NetworkBehaviour>()
|
||||
.Where(x => x != null && x.netId.Value == netId);
|
||||
foreach (var networkBehaviour in networkBehaviours)
|
||||
@ -153,11 +157,9 @@ namespace QSB
|
||||
|
||||
if (transformSync != null)
|
||||
{
|
||||
DebugLog.ToConsole(" * TS is not null - removing from list");
|
||||
PlayerRegistry.TransformSyncs.Remove(transformSync);
|
||||
if (transformSync.SyncedTransform != null)
|
||||
{
|
||||
DebugLog.ToConsole(" * TS's ST is not null - destroying");
|
||||
Destroy(transformSync.SyncedTransform.gameObject);
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,6 @@ namespace QSB.TransformSync
|
||||
|
||||
private void SendSector(uint id, QSBSector sector)
|
||||
{
|
||||
DebugLog.ToConsole($"Sending sector event for {id}");
|
||||
GlobalMessenger<uint, QSBSector>.FireEvent(EventNames.QSBSectorChange, id, sector);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user