From 78f1c6e8111e0ae2077ed6daaa8a57c87cb2d849 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Thu, 3 Dec 2020 08:28:05 +0000 Subject: [PATCH] CodeMaid cleanup --- QSB/Animation/AnimationSync.cs | 9 ++++ QSB/Animation/AnimatorMirror.cs | 1 + QSB/Animation/Events/PlayerSuitEvent.cs | 1 + QSB/Animation/Events/QSBAnimationMessage.cs | 2 +- .../Events/QSBAnimationParametersMessage.cs | 2 +- .../Events/QSBAnimationTriggerMessage.cs | 2 +- QSB/Animation/PlayerHeadRotationSync.cs | 2 +- QSB/Animation/QSBNetworkAnimator.cs | 6 ++- QSB/ConversationSync/ConversationManager.cs | 2 +- QSB/ConversationSync/ConversationPatches.cs | 2 +- QSB/ConversationSync/ConversationType.cs | 2 +- .../Events/ConversationEvent.cs | 5 ++- .../Events/ConversationMessage.cs | 2 +- .../Events/ConversationStartEndEvent.cs | 2 +- .../Events/ConversationStartEndMessage.cs | 2 +- QSB/DeathSync/Events/PlayerDeathEvent.cs | 2 +- QSB/DeathSync/Necronomicon.cs | 4 +- QSB/DeathSync/PreventShipDestruction.cs | 2 +- QSB/DeathSync/RespawnOnDeath.cs | 2 +- QSB/ElevatorSync/ElevatorManager.cs | 2 +- QSB/ElevatorSync/ElevatorPatches.cs | 2 +- QSB/ElevatorSync/Events/ElevatorEvent.cs | 2 +- QSB/ElevatorSync/QSBElevator.cs | 2 +- QSB/EventsCore/EventNames.cs | 2 +- QSB/EventsCore/EventType.cs | 2 +- QSB/EventsCore/IQSBEvent.cs | 3 +- QSB/EventsCore/QSBEvent.cs | 2 +- QSB/EventsCore/QSBEventManager.cs | 2 +- QSB/GeyserSync/Events/GeyserEvent.cs | 2 +- QSB/GeyserSync/QSBGeyser.cs | 2 +- QSB/Instruments/InstrumentsManager.cs | 3 +- QSB/Instruments/QSBCamera/CameraController.cs | 7 +-- QSB/Instruments/QSBCamera/CameraManager.cs | 2 +- QSB/Instruments/QSBCamera/CameraMode.cs | 2 +- QSB/MessagesCore/EnumMessage.cs | 2 +- QSB/MessagesCore/MessageHandler.cs | 4 +- QSB/MessagesCore/PlayerMessage.cs | 2 +- QSB/OrbSync/Events/OrbSlotEvent.cs | 2 +- QSB/OrbSync/Events/OrbUserEvent.cs | 2 +- QSB/OrbSync/OrbPatches.cs | 2 +- QSB/OrbSync/QSBOrbSlot.cs | 2 +- QSB/Patches/QSBPatch.cs | 2 +- QSB/Patches/QSBPatchManager.cs | 2 +- QSB/Patches/QSBPatchTypes.cs | 2 +- QSB/Player/Events/PlayerJoinEvent.cs | 2 +- QSB/Player/Events/PlayerLeaveEvent.cs | 2 +- QSB/Player/Events/PlayerReadyEvent.cs | 2 +- QSB/Player/Events/PlayerSectorEvent.cs | 3 +- QSB/Player/Events/PlayerStateMessage.cs | 2 +- QSB/Player/Events/PlayerStatesRequestEvent.cs | 2 +- .../Events/ServerSendPlayerStatesEvent.cs | 2 +- QSB/Player/PlayerHUDMarker.cs | 3 +- QSB/Player/PlayerInfo.cs | 4 ++ QSB/Player/PlayerSyncObject.cs | 2 +- QSB/Player/QSBPlayerManager.cs | 4 +- QSB/Properties/AssemblyInfo.cs | 2 +- QSB/QSB.cs | 10 +++-- QSB/QSBInputManager.cs | 7 ++- QSB/QSBNetworkLobby.cs | 2 +- QSB/QSBNetworkManager.cs | 1 + QSB/QSBSceneManager.cs | 3 +- QSB/QuantumUNET/QSBCRCMessage.cs | 4 +- QSB/QuantumUNET/QSBCRCMessageEntry.cs | 4 +- QSB/QuantumUNET/QSBChannelBuffer.cs | 4 +- QSB/QuantumUNET/QSBChannelPacket.cs | 4 +- QSB/QuantumUNET/QSBClientAuthorityMessage.cs | 4 +- QSB/QuantumUNET/QSBLocalClient.cs | 2 +- QSB/QuantumUNET/QSBNetBuffer.cs | 4 +- QSB/QuantumUNET/QSBNetworkBehaviour.cs | 45 +++++++++++++++---- QSB/QuantumUNET/QSBNetworkCRC.cs | 2 +- QSB/QuantumUNET/QSBNetworkClient.cs | 8 +++- QSB/QuantumUNET/QSBNetworkConnection.cs | 2 +- QSB/QuantumUNET/QSBNetworkIdentity.cs | 3 +- QSB/QuantumUNET/QSBNetworkManagerHUD.cs | 2 +- QSB/QuantumUNET/QSBNetworkManagerUNET.cs | 2 +- QSB/QuantumUNET/QSBNetworkMessage.cs | 2 +- QSB/QuantumUNET/QSBNetworkMessageDelegate.cs | 2 +- QSB/QuantumUNET/QSBNetworkMessageHandlers.cs | 4 +- QSB/QuantumUNET/QSBNetworkMigrationManager.cs | 2 +- QSB/QuantumUNET/QSBNetworkScene.cs | 2 +- QSB/QuantumUNET/QSBNetworkServer.cs | 2 +- QSB/QuantumUNET/QSBNetworkServerSimple.cs | 6 ++- QSB/QuantumUNET/QSBObjectDestroyMessage.cs | 4 +- .../QSBObjectSpawnFinishedMessage.cs | 4 +- QSB/QuantumUNET/QSBObjectSpawnMessage.cs | 4 +- QSB/QuantumUNET/QSBObjectSpawnSceneMessage.cs | 4 +- QSB/QuantumUNET/QSBOwnerMessage.cs | 4 +- QSB/QuantumUNET/QSBPlayerController.cs | 2 +- QSB/QuantumUNET/QSBRemovePlayerMessage.cs | 2 +- .../QSBULocalConnectionToClient.cs | 4 +- .../QSBULocalConnectionToServer.cs | 4 +- QSB/QuantumUNET/QSBUtility.cs | 2 +- QSB/SectorSync/QSBSector.cs | 2 +- QSB/SectorSync/QSBSectorManager.cs | 3 +- QSB/SectorSync/SectorSync.cs | 2 +- QSB/TimeSync/Events/ServerTimeEvent.cs | 2 +- QSB/TimeSync/PreserveTimeScale.cs | 2 +- QSB/TimeSync/TimeSyncType.cs | 2 +- QSB/TimeSync/TimeSyncUI.cs | 4 +- QSB/TimeSync/WakeUpPatches.cs | 2 +- QSB/TimeSync/WakeUpSync.cs | 1 + QSB/Tools/Events/PlayerFlashlightEvent.cs | 3 +- QSB/Tools/Events/PlayerProbeEvent.cs | 3 +- QSB/Tools/Events/PlayerProbeLauncherEvent.cs | 3 +- QSB/Tools/Events/PlayerSignalscopeEvent.cs | 3 +- QSB/Tools/Events/PlayerTranslatorEvent.cs | 3 +- QSB/Tools/ProbePatches.cs | 2 +- QSB/Tools/QSBFlashlight.cs | 2 +- QSB/Tools/QSBProbe.cs | 2 +- QSB/TransformSync/PlayerCameraSync.cs | 2 +- QSB/TransformSync/PlayerProbeSync.cs | 2 +- QSB/TransformSync/PlayerTransformSync.cs | 2 +- QSB/TransformSync/ShipTransformSync.cs | 2 +- QSB/TransformSync/TransformSync.cs | 7 +-- QSB/Utility/DebugLog.cs | 2 +- QSB/Utility/FlagsHelper.cs | 2 +- QSB/Utility/GOExtensions.cs | 2 +- QSB/Utility/ListExtensions.cs | 2 +- QSB/Utility/QuaternionHelper.cs | 2 +- QSB/Utility/UnetExtensions.cs | 2 +- .../Events/BoolWorldObjectMessage.cs | 2 +- QSB/WorldSync/WorldObject.cs | 2 +- QSB/WorldSync/WorldRegistry.cs | 2 +- QSB/default-config.json | 2 +- QSB/manifest.json | 2 +- 125 files changed, 231 insertions(+), 155 deletions(-) diff --git a/QSB/Animation/AnimationSync.cs b/QSB/Animation/AnimationSync.cs index f92e7996..7ec1df7c 100644 --- a/QSB/Animation/AnimationSync.cs +++ b/QSB/Animation/AnimationSync.cs @@ -29,6 +29,7 @@ namespace QSB.Animation public AnimatorMirror Mirror { get; private set; } public AnimationType CurrentType = AnimationType.PlayerUnsuited; + public Animator Animator { get { return _bodyAnim; } @@ -141,7 +142,9 @@ namespace QSB.Animation } private void OnJump() => _netAnim.SetTrigger("Jump"); + private void OnBecomeGrounded() => _netAnim.SetTrigger("Grounded"); + private void OnBecomeUngrounded() => _netAnim.SetTrigger("Ungrounded"); public void SendCrouch(float value = 0) @@ -199,23 +202,29 @@ namespace QSB.Animation _unsuitedGraphics?.SetActive(false); _suitedGraphics?.SetActive(true); break; + case AnimationType.PlayerUnsuited: controller = _unsuitedAnimController; _unsuitedGraphics?.SetActive(true); _suitedGraphics?.SetActive(false); break; + case AnimationType.Chert: controller = _chertController; break; + case AnimationType.Esker: controller = _eskerController; break; + case AnimationType.Feldspar: controller = _feldsparController; break; + case AnimationType.Gabbro: controller = _gabbroController; break; + case AnimationType.Riebeck: controller = _riebeckController; break; diff --git a/QSB/Animation/AnimatorMirror.cs b/QSB/Animation/AnimatorMirror.cs index d57ac95a..1c20bd10 100644 --- a/QSB/Animation/AnimatorMirror.cs +++ b/QSB/Animation/AnimatorMirror.cs @@ -70,6 +70,7 @@ namespace QSB.Animation } _floatParams[fromParam.name].Target = _from.GetFloat(fromParam.name); break; + case AnimatorControllerParameterType.Bool: _to.SetBool(fromParam.name, _from.GetBool(fromParam.name)); break; diff --git a/QSB/Animation/Events/PlayerSuitEvent.cs b/QSB/Animation/Events/PlayerSuitEvent.cs index 57e5de49..c7b2517f 100644 --- a/QSB/Animation/Events/PlayerSuitEvent.cs +++ b/QSB/Animation/Events/PlayerSuitEvent.cs @@ -21,6 +21,7 @@ namespace QSB.Animation } private void HandleSuitUp() => SendEvent(CreateMessage(true)); + private void HandleSuitDown() => SendEvent(CreateMessage(false)); private ToggleMessage CreateMessage(bool value) => new ToggleMessage diff --git a/QSB/Animation/Events/QSBAnimationMessage.cs b/QSB/Animation/Events/QSBAnimationMessage.cs index 85557fd9..c4de8231 100644 --- a/QSB/Animation/Events/QSBAnimationMessage.cs +++ b/QSB/Animation/Events/QSBAnimationMessage.cs @@ -2,7 +2,7 @@ namespace QSB.Animation.Events { - class QSBAnimationMessage : MessageBase + internal class QSBAnimationMessage : MessageBase { public NetworkInstanceId netId; public int stateHash; diff --git a/QSB/Animation/Events/QSBAnimationParametersMessage.cs b/QSB/Animation/Events/QSBAnimationParametersMessage.cs index a0108288..93a5694a 100644 --- a/QSB/Animation/Events/QSBAnimationParametersMessage.cs +++ b/QSB/Animation/Events/QSBAnimationParametersMessage.cs @@ -2,7 +2,7 @@ namespace QSB.Animation.Events { - class QSBAnimationParametersMessage : MessageBase + internal class QSBAnimationParametersMessage : MessageBase { public NetworkInstanceId netId; public byte[] parameters; diff --git a/QSB/Animation/Events/QSBAnimationTriggerMessage.cs b/QSB/Animation/Events/QSBAnimationTriggerMessage.cs index 414e2f02..ea2ad058 100644 --- a/QSB/Animation/Events/QSBAnimationTriggerMessage.cs +++ b/QSB/Animation/Events/QSBAnimationTriggerMessage.cs @@ -2,7 +2,7 @@ namespace QSB.Animation.Events { - class QSBAnimationTriggerMessage : MessageBase + internal class QSBAnimationTriggerMessage : MessageBase { public NetworkInstanceId netId; public int hash; diff --git a/QSB/Animation/PlayerHeadRotationSync.cs b/QSB/Animation/PlayerHeadRotationSync.cs index 9d29335e..55a7061d 100644 --- a/QSB/Animation/PlayerHeadRotationSync.cs +++ b/QSB/Animation/PlayerHeadRotationSync.cs @@ -13,7 +13,7 @@ namespace QSB.Animation _lookBase = lookBase; } - void LateUpdate() + private void LateUpdate() { var bone = _attachedAnimator.GetBoneTransform(HumanBodyBones.Head); // Get the camera's local rotation with respect to the player body diff --git a/QSB/Animation/QSBNetworkAnimator.cs b/QSB/Animation/QSBNetworkAnimator.cs index e97ed55e..b09cb0c3 100644 --- a/QSB/Animation/QSBNetworkAnimator.cs +++ b/QSB/Animation/QSBNetworkAnimator.cs @@ -7,7 +7,7 @@ namespace QSB.Animation { // Cleaned up unity code. UNET is so broken I gave up and fixed it myself. - class QSBNetworkAnimator : QSBNetworkBehaviour + internal class QSBNetworkAnimator : QSBNetworkBehaviour { private static QSBAnimationMessage AnimationMessage = new QSBAnimationMessage(); private static QSBAnimationParametersMessage ParametersMessage = new QSBAnimationParametersMessage(); @@ -182,9 +182,11 @@ namespace QSB.Animation case AnimatorControllerParameterType.Int: writer.WritePackedUInt32((uint)m_Animator.GetInteger(parameter.nameHash)); break; + case AnimatorControllerParameterType.Float: writer.Write(m_Animator.GetFloat(parameter.nameHash)); break; + case AnimatorControllerParameterType.Bool: writer.Write(m_Animator.GetBool(parameter.nameHash)); break; @@ -210,10 +212,12 @@ namespace QSB.Animation var num = (int)reader.ReadPackedUInt32(); m_Animator.SetInteger(parameter.nameHash, num); break; + case AnimatorControllerParameterType.Float: var single = reader.ReadSingle(); m_Animator.SetFloat(parameter.nameHash, single); break; + case AnimatorControllerParameterType.Bool: var flag = reader.ReadBoolean(); m_Animator.SetBool(parameter.nameHash, flag); diff --git a/QSB/ConversationSync/ConversationManager.cs b/QSB/ConversationSync/ConversationManager.cs index 05e2dafc..ff67955c 100644 --- a/QSB/ConversationSync/ConversationManager.cs +++ b/QSB/ConversationSync/ConversationManager.cs @@ -142,4 +142,4 @@ namespace QSB.ConversationSync return newBox; } } -} +} \ No newline at end of file diff --git a/QSB/ConversationSync/ConversationPatches.cs b/QSB/ConversationSync/ConversationPatches.cs index a22917f1..0309541e 100644 --- a/QSB/ConversationSync/ConversationPatches.cs +++ b/QSB/ConversationSync/ConversationPatches.cs @@ -111,4 +111,4 @@ namespace QSB.ConversationSync QSB.Helper.HarmonyHelper.AddPrefix("OnZoneExit", typeof(ConversationPatches), nameof(OnZoneExit)); } } -} +} \ No newline at end of file diff --git a/QSB/ConversationSync/ConversationType.cs b/QSB/ConversationSync/ConversationType.cs index 660c77e5..3e8658f3 100644 --- a/QSB/ConversationSync/ConversationType.cs +++ b/QSB/ConversationSync/ConversationType.cs @@ -7,4 +7,4 @@ CloseCharacter, ClosePlayer } -} +} \ No newline at end of file diff --git a/QSB/ConversationSync/Events/ConversationEvent.cs b/QSB/ConversationSync/Events/ConversationEvent.cs index 50294555..451855c0 100644 --- a/QSB/ConversationSync/Events/ConversationEvent.cs +++ b/QSB/ConversationSync/Events/ConversationEvent.cs @@ -30,9 +30,11 @@ namespace QSB.ConversationSync.Events var translated = TextTranslation.Translate(message.Message).Trim(); ConversationManager.Instance.DisplayCharacterConversationBox(message.ObjectId, translated); break; + case ConversationType.Player: ConversationManager.Instance.DisplayPlayerConversationBox((uint)message.ObjectId, message.Message); break; + case ConversationType.CloseCharacter: if (message.ObjectId == -1) { @@ -41,10 +43,11 @@ namespace QSB.ConversationSync.Events var tree = WorldRegistry.OldDialogueTrees[message.ObjectId]; UnityEngine.Object.Destroy(ConversationManager.Instance.BoxMappings[tree]); break; + case ConversationType.ClosePlayer: UnityEngine.Object.Destroy(QSBPlayerManager.GetPlayer((uint)message.ObjectId).CurrentDialogueBox); break; } } } -} +} \ No newline at end of file diff --git a/QSB/ConversationSync/Events/ConversationMessage.cs b/QSB/ConversationSync/Events/ConversationMessage.cs index 3064358f..e1dbcd7b 100644 --- a/QSB/ConversationSync/Events/ConversationMessage.cs +++ b/QSB/ConversationSync/Events/ConversationMessage.cs @@ -25,4 +25,4 @@ namespace QSB.ConversationSync.Events writer.Write(Message); } } -} +} \ No newline at end of file diff --git a/QSB/ConversationSync/Events/ConversationStartEndEvent.cs b/QSB/ConversationSync/Events/ConversationStartEndEvent.cs index 0c98039c..0c0f9f24 100644 --- a/QSB/ConversationSync/Events/ConversationStartEndEvent.cs +++ b/QSB/ConversationSync/Events/ConversationStartEndEvent.cs @@ -67,4 +67,4 @@ namespace QSB.ConversationSync.Events } } } -} +} \ No newline at end of file diff --git a/QSB/ConversationSync/Events/ConversationStartEndMessage.cs b/QSB/ConversationSync/Events/ConversationStartEndMessage.cs index 2054ca48..fe80e9a0 100644 --- a/QSB/ConversationSync/Events/ConversationStartEndMessage.cs +++ b/QSB/ConversationSync/Events/ConversationStartEndMessage.cs @@ -25,4 +25,4 @@ namespace QSB.ConversationSync.Events writer.Write(State); } } -} +} \ No newline at end of file diff --git a/QSB/DeathSync/Events/PlayerDeathEvent.cs b/QSB/DeathSync/Events/PlayerDeathEvent.cs index 6aea56ba..cea9fa9d 100644 --- a/QSB/DeathSync/Events/PlayerDeathEvent.cs +++ b/QSB/DeathSync/Events/PlayerDeathEvent.cs @@ -30,4 +30,4 @@ namespace QSB.DeathSync.Events public override void OnReceiveLocal(EnumMessage message) => OnReceiveRemote(message); } -} +} \ No newline at end of file diff --git a/QSB/DeathSync/Necronomicon.cs b/QSB/DeathSync/Necronomicon.cs index 5aa9407e..23a081a2 100644 --- a/QSB/DeathSync/Necronomicon.cs +++ b/QSB/DeathSync/Necronomicon.cs @@ -6,7 +6,6 @@ namespace QSB.DeathSync { public static class Necronomicon { - private static readonly Dictionary DeathDictionary = new Dictionary { { DeathType.Default, new[] @@ -100,6 +99,5 @@ namespace QSB.DeathSync { return DeathDictionary[deathType].OrderBy(x => Guid.NewGuid()).First(); } - } -} +} \ No newline at end of file diff --git a/QSB/DeathSync/PreventShipDestruction.cs b/QSB/DeathSync/PreventShipDestruction.cs index 01d190fc..1f8c8130 100644 --- a/QSB/DeathSync/PreventShipDestruction.cs +++ b/QSB/DeathSync/PreventShipDestruction.cs @@ -40,4 +40,4 @@ namespace QSB.DeathSync } } } -} +} \ No newline at end of file diff --git a/QSB/DeathSync/RespawnOnDeath.cs b/QSB/DeathSync/RespawnOnDeath.cs index a142a797..0228f2ed 100644 --- a/QSB/DeathSync/RespawnOnDeath.cs +++ b/QSB/DeathSync/RespawnOnDeath.cs @@ -136,4 +136,4 @@ namespace QSB.DeathSync .FirstOrDefault(spawnPoint => spawnPoint.GetSpawnLocation() == SpawnLocation.TimberHearth && spawnPoint.IsShipSpawn() == isShip); } } -} +} \ No newline at end of file diff --git a/QSB/ElevatorSync/ElevatorManager.cs b/QSB/ElevatorSync/ElevatorManager.cs index 375a33cf..5aea5338 100644 --- a/QSB/ElevatorSync/ElevatorManager.cs +++ b/QSB/ElevatorSync/ElevatorManager.cs @@ -35,4 +35,4 @@ namespace QSB.ElevatorSync public int GetId(Elevator elevator) => _elevators.IndexOf(elevator); } -} +} \ No newline at end of file diff --git a/QSB/ElevatorSync/ElevatorPatches.cs b/QSB/ElevatorSync/ElevatorPatches.cs index 7b1e8c62..8a02703b 100644 --- a/QSB/ElevatorSync/ElevatorPatches.cs +++ b/QSB/ElevatorSync/ElevatorPatches.cs @@ -19,4 +19,4 @@ namespace QSB.ElevatorSync QSB.Helper.HarmonyHelper.AddPostfix("StartLift", typeof(ElevatorPatches), nameof(StartLift)); } } -} +} \ No newline at end of file diff --git a/QSB/ElevatorSync/Events/ElevatorEvent.cs b/QSB/ElevatorSync/Events/ElevatorEvent.cs index 4489ea41..d49680ba 100644 --- a/QSB/ElevatorSync/Events/ElevatorEvent.cs +++ b/QSB/ElevatorSync/Events/ElevatorEvent.cs @@ -26,4 +26,4 @@ namespace QSB.ElevatorSync.Events elevator?.RemoteCall(message.State); } } -} +} \ No newline at end of file diff --git a/QSB/ElevatorSync/QSBElevator.cs b/QSB/ElevatorSync/QSBElevator.cs index 8958e4b0..8b2ade63 100644 --- a/QSB/ElevatorSync/QSBElevator.cs +++ b/QSB/ElevatorSync/QSBElevator.cs @@ -54,4 +54,4 @@ namespace QSB.ElevatorSync _interactVolume.DisableInteraction(); } } -} +} \ No newline at end of file diff --git a/QSB/EventsCore/EventNames.cs b/QSB/EventsCore/EventNames.cs index a2cd8543..70988853 100644 --- a/QSB/EventsCore/EventNames.cs +++ b/QSB/EventsCore/EventNames.cs @@ -37,4 +37,4 @@ public static string QSBChangeAnimType = "QSBPlayInstrument"; public static string QSBServerSendPlayerStates = "QSBServerSendPlayerStates"; } -} +} \ No newline at end of file diff --git a/QSB/EventsCore/EventType.cs b/QSB/EventsCore/EventType.cs index b082285c..973c54c8 100644 --- a/QSB/EventsCore/EventType.cs +++ b/QSB/EventsCore/EventType.cs @@ -26,4 +26,4 @@ ConversationStartEnd, PlayInstrument } -} +} \ No newline at end of file diff --git a/QSB/EventsCore/IQSBEvent.cs b/QSB/EventsCore/IQSBEvent.cs index 4b8b8dc3..65c305ed 100644 --- a/QSB/EventsCore/IQSBEvent.cs +++ b/QSB/EventsCore/IQSBEvent.cs @@ -3,6 +3,7 @@ public interface IQSBEvent { void SetupListener(); + void CloseListener(); } -} +} \ No newline at end of file diff --git a/QSB/EventsCore/QSBEvent.cs b/QSB/EventsCore/QSBEvent.cs index 61b91d95..f49dfeb8 100644 --- a/QSB/EventsCore/QSBEvent.cs +++ b/QSB/EventsCore/QSBEvent.cs @@ -65,4 +65,4 @@ namespace QSB.EventsCore OnReceiveRemote(message); } } -} +} \ No newline at end of file diff --git a/QSB/EventsCore/QSBEventManager.cs b/QSB/EventsCore/QSBEventManager.cs index 0dafd0d7..fe670c15 100644 --- a/QSB/EventsCore/QSBEventManager.cs +++ b/QSB/EventsCore/QSBEventManager.cs @@ -64,4 +64,4 @@ namespace QSB.EventsCore _eventList = new List(); } } -} +} \ No newline at end of file diff --git a/QSB/GeyserSync/Events/GeyserEvent.cs b/QSB/GeyserSync/Events/GeyserEvent.cs index 0ac1134b..ee61e0db 100644 --- a/QSB/GeyserSync/Events/GeyserEvent.cs +++ b/QSB/GeyserSync/Events/GeyserEvent.cs @@ -33,4 +33,4 @@ namespace QSB.GeyserSync.Events geyser?.SetState(message.State); } } -} +} \ No newline at end of file diff --git a/QSB/GeyserSync/QSBGeyser.cs b/QSB/GeyserSync/QSBGeyser.cs index 3427dbc6..0b5e6fcd 100644 --- a/QSB/GeyserSync/QSBGeyser.cs +++ b/QSB/GeyserSync/QSBGeyser.cs @@ -37,4 +37,4 @@ namespace QSB.GeyserSync } } } -} +} \ No newline at end of file diff --git a/QSB/Instruments/InstrumentsManager.cs b/QSB/Instruments/InstrumentsManager.cs index 46f879bd..04e3feea 100644 --- a/QSB/Instruments/InstrumentsManager.cs +++ b/QSB/Instruments/InstrumentsManager.cs @@ -118,6 +118,7 @@ namespace QSB.Instruments case AnimationType.Chert: ChertDrum.SetActive(true); break; + case AnimationType.PlayerSuited: case AnimationType.PlayerUnsuited: ChertDrum.SetActive(false); @@ -125,4 +126,4 @@ namespace QSB.Instruments } } } -} +} \ No newline at end of file diff --git a/QSB/Instruments/QSBCamera/CameraController.cs b/QSB/Instruments/QSBCamera/CameraController.cs index dccd8e23..a5c3c9c5 100644 --- a/QSB/Instruments/QSBCamera/CameraController.cs +++ b/QSB/Instruments/QSBCamera/CameraController.cs @@ -2,7 +2,7 @@ namespace QSB.Instruments.QSBCamera { - class CameraController : MonoBehaviour + internal class CameraController : MonoBehaviour { private float _degreesX; private float _degreesY; @@ -11,12 +11,13 @@ namespace QSB.Instruments.QSBCamera // How far along the ray to move the camera. Avoids clipping into the walls. private const float PercentToMove = 0.80f; + // Maximum distance for camera clipping private const float RayLength = 5f; public GameObject CameraObject; - void FixedUpdate() + private void FixedUpdate() { if (CameraManager.Instance.Mode != CameraMode.ThirdPerson) { @@ -76,4 +77,4 @@ namespace QSB.Instruments.QSBCamera transform.localRotation = localRotation; } } -} +} \ No newline at end of file diff --git a/QSB/Instruments/QSBCamera/CameraManager.cs b/QSB/Instruments/QSBCamera/CameraManager.cs index fc7478ea..ff72c4eb 100644 --- a/QSB/Instruments/QSBCamera/CameraManager.cs +++ b/QSB/Instruments/QSBCamera/CameraManager.cs @@ -111,4 +111,4 @@ namespace QSB.Instruments.QSBCamera Mode = CameraMode.FirstPerson; } } -} +} \ No newline at end of file diff --git a/QSB/Instruments/QSBCamera/CameraMode.cs b/QSB/Instruments/QSBCamera/CameraMode.cs index 7102ec52..71cb586d 100644 --- a/QSB/Instruments/QSBCamera/CameraMode.cs +++ b/QSB/Instruments/QSBCamera/CameraMode.cs @@ -5,4 +5,4 @@ FirstPerson, ThirdPerson } -} +} \ No newline at end of file diff --git a/QSB/MessagesCore/EnumMessage.cs b/QSB/MessagesCore/EnumMessage.cs index adb8d4bf..d110adb5 100644 --- a/QSB/MessagesCore/EnumMessage.cs +++ b/QSB/MessagesCore/EnumMessage.cs @@ -19,4 +19,4 @@ namespace QSB.MessagesCore writer.Write((int)(object)Value); } } -} +} \ No newline at end of file diff --git a/QSB/MessagesCore/MessageHandler.cs b/QSB/MessagesCore/MessageHandler.cs index 89b101ec..24a2e864 100644 --- a/QSB/MessagesCore/MessageHandler.cs +++ b/QSB/MessagesCore/MessageHandler.cs @@ -12,6 +12,7 @@ namespace QSB.Messaging public class MessageHandler where T : MessageBase, new() { public event Action OnClientReceiveMessage; + public event Action OnServerReceiveMessage; private readonly EventType _eventType; @@ -70,6 +71,5 @@ namespace QSB.Messaging var message = netMsg.ReadMessage(); OnServerReceiveMessage?.Invoke(message); } - } -} +} \ No newline at end of file diff --git a/QSB/MessagesCore/PlayerMessage.cs b/QSB/MessagesCore/PlayerMessage.cs index 2a9f73d8..f39073fb 100644 --- a/QSB/MessagesCore/PlayerMessage.cs +++ b/QSB/MessagesCore/PlayerMessage.cs @@ -19,4 +19,4 @@ namespace QSB.Messaging writer.Write(AboutId); } } -} +} \ No newline at end of file diff --git a/QSB/OrbSync/Events/OrbSlotEvent.cs b/QSB/OrbSync/Events/OrbSlotEvent.cs index eb28c6cd..6baba2fb 100644 --- a/QSB/OrbSync/Events/OrbSlotEvent.cs +++ b/QSB/OrbSync/Events/OrbSlotEvent.cs @@ -29,4 +29,4 @@ namespace QSB.OrbSync.Events orbSlot?.SetState(message.State); } } -} +} \ No newline at end of file diff --git a/QSB/OrbSync/Events/OrbUserEvent.cs b/QSB/OrbSync/Events/OrbUserEvent.cs index 5952730a..675cc3a9 100644 --- a/QSB/OrbSync/Events/OrbUserEvent.cs +++ b/QSB/OrbSync/Events/OrbUserEvent.cs @@ -83,4 +83,4 @@ namespace QSB.OrbSync.Events } } } -} +} \ No newline at end of file diff --git a/QSB/OrbSync/OrbPatches.cs b/QSB/OrbSync/OrbPatches.cs index 8fd21ceb..19df8b99 100644 --- a/QSB/OrbSync/OrbPatches.cs +++ b/QSB/OrbSync/OrbPatches.cs @@ -60,4 +60,4 @@ namespace QSB.OrbSync QSB.Helper.HarmonyHelper.AddPrefix("CheckOrbCollision", typeof(OrbPatches), nameof(CheckOrbCollision)); } } -} +} \ No newline at end of file diff --git a/QSB/OrbSync/QSBOrbSlot.cs b/QSB/OrbSync/QSBOrbSlot.cs index ff3af77a..2a6e756b 100644 --- a/QSB/OrbSync/QSBOrbSlot.cs +++ b/QSB/OrbSync/QSBOrbSlot.cs @@ -35,4 +35,4 @@ namespace QSB.OrbSync WorldRegistry.RaiseEvent(InterfaceSlot, ev); } } -} +} \ No newline at end of file diff --git a/QSB/Patches/QSBPatch.cs b/QSB/Patches/QSBPatch.cs index 6bdeacd5..fc4f8fab 100644 --- a/QSB/Patches/QSBPatch.cs +++ b/QSB/Patches/QSBPatch.cs @@ -6,4 +6,4 @@ public abstract void DoPatches(); } -} +} \ No newline at end of file diff --git a/QSB/Patches/QSBPatchManager.cs b/QSB/Patches/QSBPatchManager.cs index c12473b8..faaa9143 100644 --- a/QSB/Patches/QSBPatchManager.cs +++ b/QSB/Patches/QSBPatchManager.cs @@ -46,4 +46,4 @@ namespace QSB.Patches } } } -} +} \ No newline at end of file diff --git a/QSB/Patches/QSBPatchTypes.cs b/QSB/Patches/QSBPatchTypes.cs index 4b2e689e..161a2fde 100644 --- a/QSB/Patches/QSBPatchTypes.cs +++ b/QSB/Patches/QSBPatchTypes.cs @@ -6,4 +6,4 @@ OnClientConnect, OnNonServerClientConnect } -} +} \ No newline at end of file diff --git a/QSB/Player/Events/PlayerJoinEvent.cs b/QSB/Player/Events/PlayerJoinEvent.cs index ed1fa454..d3d9a2e2 100644 --- a/QSB/Player/Events/PlayerJoinEvent.cs +++ b/QSB/Player/Events/PlayerJoinEvent.cs @@ -36,4 +36,4 @@ namespace QSB.Player.Events DebugLog.ToAll(text, MessageType.Info); } } -} +} \ No newline at end of file diff --git a/QSB/Player/Events/PlayerLeaveEvent.cs b/QSB/Player/Events/PlayerLeaveEvent.cs index 3141e614..4cbe109e 100644 --- a/QSB/Player/Events/PlayerLeaveEvent.cs +++ b/QSB/Player/Events/PlayerLeaveEvent.cs @@ -30,4 +30,4 @@ namespace QSB.Player.Events message.NetIds.ToList().ForEach(netId => QSBNetworkManager.Instance.CleanupNetworkBehaviour(netId)); } } -} +} \ No newline at end of file diff --git a/QSB/Player/Events/PlayerReadyEvent.cs b/QSB/Player/Events/PlayerReadyEvent.cs index 3bc188cf..6f51ce05 100644 --- a/QSB/Player/Events/PlayerReadyEvent.cs +++ b/QSB/Player/Events/PlayerReadyEvent.cs @@ -49,4 +49,4 @@ namespace QSB.Player.Events } } } -} +} \ No newline at end of file diff --git a/QSB/Player/Events/PlayerSectorEvent.cs b/QSB/Player/Events/PlayerSectorEvent.cs index 4afa1910..f5590b5a 100644 --- a/QSB/Player/Events/PlayerSectorEvent.cs +++ b/QSB/Player/Events/PlayerSectorEvent.cs @@ -48,6 +48,5 @@ namespace QSB.Player.Events QSB.Helper.Events.Unity.RunWhen(() => transformSync?.SyncedTransform != null, () => transformSync?.SetReferenceSector(sector)); } - } -} +} \ No newline at end of file diff --git a/QSB/Player/Events/PlayerStateMessage.cs b/QSB/Player/Events/PlayerStateMessage.cs index a1dcef64..d966f3f6 100644 --- a/QSB/Player/Events/PlayerStateMessage.cs +++ b/QSB/Player/Events/PlayerStateMessage.cs @@ -31,4 +31,4 @@ namespace QSB.Player.Events writer.Write(SectorName); } } -} +} \ No newline at end of file diff --git a/QSB/Player/Events/PlayerStatesRequestEvent.cs b/QSB/Player/Events/PlayerStatesRequestEvent.cs index 30cddccc..e0883ca7 100644 --- a/QSB/Player/Events/PlayerStatesRequestEvent.cs +++ b/QSB/Player/Events/PlayerStatesRequestEvent.cs @@ -32,4 +32,4 @@ namespace QSB.Player.Events } } } -} +} \ No newline at end of file diff --git a/QSB/Player/Events/ServerSendPlayerStatesEvent.cs b/QSB/Player/Events/ServerSendPlayerStatesEvent.cs index 53d0f082..a17a0d80 100644 --- a/QSB/Player/Events/ServerSendPlayerStatesEvent.cs +++ b/QSB/Player/Events/ServerSendPlayerStatesEvent.cs @@ -37,4 +37,4 @@ namespace QSB.Player.Events () => QSBPlayerManager.HandleFullStateMessage(message)); } } -} +} \ No newline at end of file diff --git a/QSB/Player/PlayerHUDMarker.cs b/QSB/Player/PlayerHUDMarker.cs index 61ea6f4f..cf5105fa 100644 --- a/QSB/Player/PlayerHUDMarker.cs +++ b/QSB/Player/PlayerHUDMarker.cs @@ -54,6 +54,5 @@ namespace QSB.Player Destroy(_markerTarget.gameObject); Destroy(this); } - } -} +} \ No newline at end of file diff --git a/QSB/Player/PlayerInfo.cs b/QSB/Player/PlayerInfo.cs index d0cd0108..22947e91 100644 --- a/QSB/Player/PlayerInfo.cs +++ b/QSB/Player/PlayerInfo.cs @@ -16,10 +16,12 @@ namespace QSB.Player // Body Objects public GameObject Camera { get; set; } + public GameObject Body { get; set; } // Tools public GameObject ProbeBody { get; set; } + public QSBProbe Probe { get; set; } public QSBFlashlight FlashLight => Camera?.GetComponentInChildren(); public QSBTool Signalscope => GetToolByType(ToolType.Signalscope); @@ -28,10 +30,12 @@ namespace QSB.Player // Conversation public int CurrentDialogueID { get; set; } + public GameObject CurrentDialogueBox { get; set; } // Animation public AnimationSync AnimationSync => QSBPlayerManager.GetSyncObject(PlayerId); + public bool PlayingInstrument => AnimationSync.CurrentType != AnimationType.PlayerSuited && AnimationSync.CurrentType != AnimationType.PlayerUnsuited; diff --git a/QSB/Player/PlayerSyncObject.cs b/QSB/Player/PlayerSyncObject.cs index 381705cb..73fed646 100644 --- a/QSB/Player/PlayerSyncObject.cs +++ b/QSB/Player/PlayerSyncObject.cs @@ -9,4 +9,4 @@ namespace QSB.Player public uint PreviousPlayerId { get; set; } public PlayerInfo Player => QSBPlayerManager.GetPlayer(PlayerId); } -} +} \ No newline at end of file diff --git a/QSB/Player/QSBPlayerManager.cs b/QSB/Player/QSBPlayerManager.cs index e5891331..c4fc4dc4 100644 --- a/QSB/Player/QSBPlayerManager.cs +++ b/QSB/Player/QSBPlayerManager.cs @@ -96,7 +96,7 @@ namespace QSB.Player syncObject.PreviousPlayerId = uint.MaxValue; return uint.MaxValue; } - // If the player list count is not the same as the count of the same type syncobject (eg. 3 players and 4 PlayerTransformSyncs) + // If the player list count is not the same as the count of the same type syncobject (eg. 3 players and 4 PlayerTransformSyncs) // and the highest ID below the syncobject's id is the same as the highest player id. if (PlayerList.Count != PlayerSyncObjects.Count(x => x.GetType() == syncObject.GetType()) && lowerBound == playerIds.Max()) { @@ -146,4 +146,4 @@ namespace QSB.Player return Enumerable.Range((int)player.PlayerId, count).Select(x => (uint)x).ToList(); } } -} +} \ No newline at end of file diff --git a/QSB/Properties/AssemblyInfo.cs b/QSB/Properties/AssemblyInfo.cs index fea6eaaa..2aead9f8 100644 --- a/QSB/Properties/AssemblyInfo.cs +++ b/QSB/Properties/AssemblyInfo.cs @@ -32,4 +32,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/QSB/QSB.cs b/QSB/QSB.cs index 56d6d0eb..cc812b16 100644 --- a/QSB/QSB.cs +++ b/QSB/QSB.cs @@ -48,9 +48,11 @@ namespace QSB case LogType.Assert: DebugLog.DebugWrite($"Assert - {condition}", MessageType.Message); break; + case LogType.Log: DebugLog.DebugWrite($"Log - {condition}", MessageType.Message); break; + case LogType.Warning: DebugLog.DebugWrite($"Warning - {condition}", MessageType.Warning); break; @@ -69,8 +71,8 @@ namespace QSB QSBPatchManager.DoPatchType(QSBPatchTypes.OnModStart); - // Turns out these are very finicky about what order they go. QSBNetworkManager seems to - // want to go first-ish, otherwise the NetworkManager complains about the PlayerPrefab being + // Turns out these are very finicky about what order they go. QSBNetworkManager seems to + // want to go first-ish, otherwise the NetworkManager complains about the PlayerPrefab being // null (even though it isn't...) gameObject.AddComponent(); gameObject.AddComponent(); @@ -87,7 +89,7 @@ namespace QSB Helper.HarmonyHelper.EmptyMethod(typeof(OWTime).GetMethod("Pause")); } - void Update() + private void Update() { QSBNetworkIdentity.UNetStaticUpdate(); } @@ -103,4 +105,4 @@ namespace QSB DebugMode = config.GetSettingsValue("debugMode"); } } -} +} \ No newline at end of file diff --git a/QSB/QSBInputManager.cs b/QSB/QSBInputManager.cs index c3e8fae6..47b00a49 100644 --- a/QSB/QSBInputManager.cs +++ b/QSB/QSBInputManager.cs @@ -9,10 +9,15 @@ namespace QSB public static QSBInputManager Instance; public static event InputEvent ChertTaunt; + public static event InputEvent EskerTaunt; + public static event InputEvent RiebeckTaunt; + public static event InputEvent GabbroTaunt; + public static event InputEvent FeldsparTaunt; + public static event InputEvent ExitTaunt; public void Awake() => Instance = this; @@ -51,4 +56,4 @@ namespace QSB } } } -} +} \ No newline at end of file diff --git a/QSB/QSBNetworkLobby.cs b/QSB/QSBNetworkLobby.cs index d7f10c0e..5f07a90a 100644 --- a/QSB/QSBNetworkLobby.cs +++ b/QSB/QSBNetworkLobby.cs @@ -67,4 +67,4 @@ namespace QSB } } } -} +} \ No newline at end of file diff --git a/QSB/QSBNetworkManager.cs b/QSB/QSBNetworkManager.cs index f6727d20..7488db66 100644 --- a/QSB/QSBNetworkManager.cs +++ b/QSB/QSBNetworkManager.cs @@ -30,6 +30,7 @@ namespace QSB public static QSBNetworkManager Instance { get; private set; } public event Action OnNetworkManagerReady; + public bool IsReady { get; private set; } private QSBNetworkLobby _lobby; diff --git a/QSB/QSBSceneManager.cs b/QSB/QSBSceneManager.cs index dff06700..75daa438 100644 --- a/QSB/QSBSceneManager.cs +++ b/QSB/QSBSceneManager.cs @@ -11,6 +11,7 @@ namespace QSB public static bool IsInUniverse => InUniverse(CurrentScene); public static event Action OnSceneLoaded; + public static event Action OnUniverseSceneLoaded; static QSBSceneManager() @@ -33,4 +34,4 @@ namespace QSB private static bool InUniverse(OWScene scene) => scene == OWScene.SolarSystem || scene == OWScene.EyeOfTheUniverse; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBCRCMessage.cs b/QSB/QuantumUNET/QSBCRCMessage.cs index 229de0ba..166f6e6b 100644 --- a/QSB/QuantumUNET/QSBCRCMessage.cs +++ b/QSB/QuantumUNET/QSBCRCMessage.cs @@ -2,7 +2,7 @@ namespace QSB.QuantumUNET { - class QSBCRCMessage : MessageBase + internal class QSBCRCMessage : MessageBase { public override void Deserialize(NetworkReader reader) { @@ -29,4 +29,4 @@ namespace QSB.QuantumUNET public QSBCRCMessageEntry[] scripts; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBCRCMessageEntry.cs b/QSB/QuantumUNET/QSBCRCMessageEntry.cs index 54cdc56a..03294a91 100644 --- a/QSB/QuantumUNET/QSBCRCMessageEntry.cs +++ b/QSB/QuantumUNET/QSBCRCMessageEntry.cs @@ -1,9 +1,9 @@ namespace QSB.QuantumUNET { - struct QSBCRCMessageEntry + internal struct QSBCRCMessageEntry { public string name; public byte channel; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBChannelBuffer.cs b/QSB/QuantumUNET/QSBChannelBuffer.cs index 0c6d3d13..f1e9dca8 100644 --- a/QSB/QuantumUNET/QSBChannelBuffer.cs +++ b/QSB/QuantumUNET/QSBChannelBuffer.cs @@ -5,7 +5,7 @@ using UnityEngine.Networking; namespace QSB.QuantumUNET { - class QSBChannelBuffer : IDisposable + internal class QSBChannelBuffer : IDisposable { public QSBChannelBuffer(QSBNetworkConnection conn, int bufferSize, byte cid, bool isReliable, bool isSequenced) { @@ -426,4 +426,4 @@ namespace QSB.QuantumUNET private bool readingFragment = false; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBChannelPacket.cs b/QSB/QuantumUNET/QSBChannelPacket.cs index abc9c279..a5ee07ee 100644 --- a/QSB/QuantumUNET/QSBChannelPacket.cs +++ b/QSB/QuantumUNET/QSBChannelPacket.cs @@ -4,7 +4,7 @@ using UnityEngine.Networking; namespace QSB.QuantumUNET { - struct QSBChannelPacket + internal struct QSBChannelPacket { public QSBChannelPacket(int packetSize, bool isReliable) { @@ -79,4 +79,4 @@ namespace QSB.QuantumUNET private bool m_IsReliable; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBClientAuthorityMessage.cs b/QSB/QuantumUNET/QSBClientAuthorityMessage.cs index 50f8dc9c..96a787ee 100644 --- a/QSB/QuantumUNET/QSBClientAuthorityMessage.cs +++ b/QSB/QuantumUNET/QSBClientAuthorityMessage.cs @@ -2,7 +2,7 @@ namespace QSB.QuantumUNET { - class QSBClientAuthorityMessage : MessageBase + internal class QSBClientAuthorityMessage : MessageBase { public override void Deserialize(NetworkReader reader) { @@ -20,4 +20,4 @@ namespace QSB.QuantumUNET public bool authority; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBLocalClient.cs b/QSB/QuantumUNET/QSBLocalClient.cs index cd2fb412..3e38a581 100644 --- a/QSB/QuantumUNET/QSBLocalClient.cs +++ b/QSB/QuantumUNET/QSBLocalClient.cs @@ -4,7 +4,7 @@ using UnityEngine.Networking; namespace QSB.QuantumUNET { - class QSBLocalClient : QSBNetworkClient + internal class QSBLocalClient : QSBNetworkClient { public override void Disconnect() { diff --git a/QSB/QuantumUNET/QSBNetBuffer.cs b/QSB/QuantumUNET/QSBNetBuffer.cs index 9b58625b..9153d875 100644 --- a/QSB/QuantumUNET/QSBNetBuffer.cs +++ b/QSB/QuantumUNET/QSBNetBuffer.cs @@ -3,7 +3,7 @@ using UnityEngine; namespace QSB.QuantumUNET { - class QSBNetBuffer + internal class QSBNetBuffer { public QSBNetBuffer() { @@ -195,4 +195,4 @@ namespace QSB.QuantumUNET private const int k_BufferSizeWarning = 134217728; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBNetworkBehaviour.cs b/QSB/QuantumUNET/QSBNetworkBehaviour.cs index 87b6603e..2cd05641 100644 --- a/QSB/QuantumUNET/QSBNetworkBehaviour.cs +++ b/QSB/QuantumUNET/QSBNetworkBehaviour.cs @@ -550,17 +550,44 @@ namespace QSB.QuantumUNET } } - public virtual void PreStartClient() { } - public virtual void OnNetworkDestroy() { } - public virtual void OnStartServer() { } - public virtual void OnStartClient() { } - public virtual void OnStartLocalPlayer() { } - public virtual void OnStartAuthority() { } - public virtual void OnStopAuthority() { } + public virtual void PreStartClient() + { + } + + public virtual void OnNetworkDestroy() + { + } + + public virtual void OnStartServer() + { + } + + public virtual void OnStartClient() + { + } + + public virtual void OnStartLocalPlayer() + { + } + + public virtual void OnStartAuthority() + { + } + + public virtual void OnStopAuthority() + { + } + public virtual bool OnRebuildObservers(HashSet observers, bool initialize) => false; - public virtual void OnSetLocalVisibility(bool vis) { } + + public virtual void OnSetLocalVisibility(bool vis) + { + } + public virtual bool OnCheckObserver(QSBNetworkConnection conn) => true; + public virtual int GetNetworkChannel() => 0; + public virtual float GetNetworkSendInterval() => 0.1f; private float m_LastSendTime; @@ -608,4 +635,4 @@ namespace QSB.QuantumUNET internal static string GetErrorCode(this SocketException e) => e.ErrorCode.ToString(); } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBNetworkCRC.cs b/QSB/QuantumUNET/QSBNetworkCRC.cs index d45f248b..1c22ce23 100644 --- a/QSB/QuantumUNET/QSBNetworkCRC.cs +++ b/QSB/QuantumUNET/QSBNetworkCRC.cs @@ -164,4 +164,4 @@ namespace QSB.QuantumUNET private bool m_ScriptCRCCheck; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBNetworkClient.cs b/QSB/QuantumUNET/QSBNetworkClient.cs index b9644ec0..68101c39 100644 --- a/QSB/QuantumUNET/QSBNetworkClient.cs +++ b/QSB/QuantumUNET/QSBNetworkClient.cs @@ -802,10 +802,12 @@ namespace QSB.QuantumUNET case ConnectState.Resolving: case ConnectState.Disconnected: return; + case ConnectState.Resolved: m_AsyncConnect = ConnectState.Connecting; ContinueConnect(); return; + case ConnectState.Failed: GenerateConnectError(11); m_AsyncConnect = ConnectState.Disconnected; @@ -853,6 +855,7 @@ namespace QSB.QuantumUNET m_MsgReader.SeekZero(); m_Connection.TransportReceive(m_MsgBuffer, numBytes, channelId); break; + case NetworkEventType.ConnectEvent: if (LogFilter.logDebug) { @@ -865,6 +868,7 @@ namespace QSB.QuantumUNET m_AsyncConnect = ConnectState.Connected; m_Connection.InvokeHandlerNoData(32); break; + case NetworkEventType.DisconnectEvent: if (LogFilter.logDebug) { @@ -884,8 +888,10 @@ namespace QSB.QuantumUNET m_Connection.InvokeHandlerNoData(33); } break; + case NetworkEventType.Nothing: break; + default: if (LogFilter.logError) { @@ -1190,4 +1196,4 @@ namespace QSB.QuantumUNET Failed } } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBNetworkConnection.cs b/QSB/QuantumUNET/QSBNetworkConnection.cs index b3c5969a..f89c715c 100644 --- a/QSB/QuantumUNET/QSBNetworkConnection.cs +++ b/QSB/QuantumUNET/QSBNetworkConnection.cs @@ -557,4 +557,4 @@ namespace QSB.QuantumUNET public int bytes; } } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBNetworkIdentity.cs b/QSB/QuantumUNET/QSBNetworkIdentity.cs index a9a1136b..15e70a1c 100644 --- a/QSB/QuantumUNET/QSBNetworkIdentity.cs +++ b/QSB/QuantumUNET/QSBNetworkIdentity.cs @@ -86,8 +86,6 @@ namespace QSB.QuantumUNET } } - - public ReadOnlyCollection Observers { get @@ -975,6 +973,7 @@ namespace QSB.QuantumUNET [SerializeField] private bool m_LocalPlayerAuthority; + private bool m_IsServer; private QSBNetworkBehaviour[] m_NetworkBehaviours; diff --git a/QSB/QuantumUNET/QSBNetworkManagerHUD.cs b/QSB/QuantumUNET/QSBNetworkManagerHUD.cs index a8fc64f8..03efec60 100644 --- a/QSB/QuantumUNET/QSBNetworkManagerHUD.cs +++ b/QSB/QuantumUNET/QSBNetworkManagerHUD.cs @@ -256,4 +256,4 @@ namespace QSB.QuantumUNET private bool m_ShowServer; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBNetworkManagerUNET.cs b/QSB/QuantumUNET/QSBNetworkManagerUNET.cs index 14fe264a..6174a9bf 100644 --- a/QSB/QuantumUNET/QSBNetworkManagerUNET.cs +++ b/QSB/QuantumUNET/QSBNetworkManagerUNET.cs @@ -1710,4 +1710,4 @@ namespace QSB.QuantumUNET private static string s_Address; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBNetworkMessage.cs b/QSB/QuantumUNET/QSBNetworkMessage.cs index 214fa5e7..15fc3b03 100644 --- a/QSB/QuantumUNET/QSBNetworkMessage.cs +++ b/QSB/QuantumUNET/QSBNetworkMessage.cs @@ -37,4 +37,4 @@ namespace QSB.QuantumUNET public int channelId; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBNetworkMessageDelegate.cs b/QSB/QuantumUNET/QSBNetworkMessageDelegate.cs index c52bcf40..14ddcf5a 100644 --- a/QSB/QuantumUNET/QSBNetworkMessageDelegate.cs +++ b/QSB/QuantumUNET/QSBNetworkMessageDelegate.cs @@ -1,4 +1,4 @@ namespace QSB.QuantumUNET { public delegate void QSBNetworkMessageDelegate(QSBNetworkMessage netMsg); -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBNetworkMessageHandlers.cs b/QSB/QuantumUNET/QSBNetworkMessageHandlers.cs index 96aa1c4e..bb1a41a2 100644 --- a/QSB/QuantumUNET/QSBNetworkMessageHandlers.cs +++ b/QSB/QuantumUNET/QSBNetworkMessageHandlers.cs @@ -3,7 +3,7 @@ using UnityEngine; namespace QSB.QuantumUNET { - class QSBNetworkMessageHandlers + internal class QSBNetworkMessageHandlers { internal void RegisterHandlerSafe(short msgType, QSBNetworkMessageDelegate handler) { @@ -86,4 +86,4 @@ namespace QSB.QuantumUNET private Dictionary m_MsgHandlers = new Dictionary(); } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBNetworkMigrationManager.cs b/QSB/QuantumUNET/QSBNetworkMigrationManager.cs index 36e1b941..cf5cb522 100644 --- a/QSB/QuantumUNET/QSBNetworkMigrationManager.cs +++ b/QSB/QuantumUNET/QSBNetworkMigrationManager.cs @@ -1064,4 +1064,4 @@ namespace QSB.QuantumUNET public List players; } } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBNetworkScene.cs b/QSB/QuantumUNET/QSBNetworkScene.cs index 6dd02f64..ae1d2913 100644 --- a/QSB/QuantumUNET/QSBNetworkScene.cs +++ b/QSB/QuantumUNET/QSBNetworkScene.cs @@ -5,7 +5,7 @@ using UnityEngine.Networking; namespace QSB.QuantumUNET { - class QSBNetworkScene + internal class QSBNetworkScene { private Dictionary m_LocalObjects = new Dictionary(); diff --git a/QSB/QuantumUNET/QSBNetworkServer.cs b/QSB/QuantumUNET/QSBNetworkServer.cs index d595ee93..5e2a3384 100644 --- a/QSB/QuantumUNET/QSBNetworkServer.cs +++ b/QSB/QuantumUNET/QSBNetworkServer.cs @@ -2037,4 +2037,4 @@ namespace QSB.QuantumUNET private QSBNetworkServer m_Server; } } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBNetworkServerSimple.cs b/QSB/QuantumUNET/QSBNetworkServerSimple.cs index cccd2228..dc798162 100644 --- a/QSB/QuantumUNET/QSBNetworkServerSimple.cs +++ b/QSB/QuantumUNET/QSBNetworkServerSimple.cs @@ -320,14 +320,18 @@ namespace QSB.QuantumUNET case NetworkEventType.DataEvent: this.HandleData(connectionId, channelId, receivedSize, b); break; + case NetworkEventType.ConnectEvent: this.HandleConnect(connectionId, b); break; + case NetworkEventType.DisconnectEvent: this.HandleDisconnect(connectionId, b); break; + case NetworkEventType.Nothing: break; + default: if (LogFilter.logError) { @@ -580,4 +584,4 @@ namespace QSB.QuantumUNET private QSBNetworkMessageHandlers m_MessageHandlers = new QSBNetworkMessageHandlers(); } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBObjectDestroyMessage.cs b/QSB/QuantumUNET/QSBObjectDestroyMessage.cs index d2cacca6..ff2c2995 100644 --- a/QSB/QuantumUNET/QSBObjectDestroyMessage.cs +++ b/QSB/QuantumUNET/QSBObjectDestroyMessage.cs @@ -2,7 +2,7 @@ namespace QSB.QuantumUNET { - class QSBObjectDestroyMessage : MessageBase + internal class QSBObjectDestroyMessage : MessageBase { public override void Deserialize(NetworkReader reader) { @@ -16,4 +16,4 @@ namespace QSB.QuantumUNET public NetworkInstanceId netId; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBObjectSpawnFinishedMessage.cs b/QSB/QuantumUNET/QSBObjectSpawnFinishedMessage.cs index 8ee726cb..c6b7d5c1 100644 --- a/QSB/QuantumUNET/QSBObjectSpawnFinishedMessage.cs +++ b/QSB/QuantumUNET/QSBObjectSpawnFinishedMessage.cs @@ -2,7 +2,7 @@ namespace QSB.QuantumUNET { - class QSBObjectSpawnFinishedMessage : MessageBase + internal class QSBObjectSpawnFinishedMessage : MessageBase { public override void Deserialize(NetworkReader reader) { @@ -16,4 +16,4 @@ namespace QSB.QuantumUNET public uint state; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBObjectSpawnMessage.cs b/QSB/QuantumUNET/QSBObjectSpawnMessage.cs index 598fac9e..4f00510b 100644 --- a/QSB/QuantumUNET/QSBObjectSpawnMessage.cs +++ b/QSB/QuantumUNET/QSBObjectSpawnMessage.cs @@ -3,7 +3,7 @@ using UnityEngine.Networking; namespace QSB.QuantumUNET { - class QSBObjectSpawnMessage : MessageBase + internal class QSBObjectSpawnMessage : MessageBase { public override void Deserialize(NetworkReader reader) { @@ -37,4 +37,4 @@ namespace QSB.QuantumUNET public Quaternion rotation; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBObjectSpawnSceneMessage.cs b/QSB/QuantumUNET/QSBObjectSpawnSceneMessage.cs index 794a7996..0232fc06 100644 --- a/QSB/QuantumUNET/QSBObjectSpawnSceneMessage.cs +++ b/QSB/QuantumUNET/QSBObjectSpawnSceneMessage.cs @@ -3,7 +3,7 @@ using UnityEngine.Networking; namespace QSB.QuantumUNET { - class QSBObjectSpawnSceneMessage : MessageBase + internal class QSBObjectSpawnSceneMessage : MessageBase { public override void Deserialize(NetworkReader reader) { @@ -29,4 +29,4 @@ namespace QSB.QuantumUNET public byte[] payload; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBOwnerMessage.cs b/QSB/QuantumUNET/QSBOwnerMessage.cs index 043ace3f..d397cc22 100644 --- a/QSB/QuantumUNET/QSBOwnerMessage.cs +++ b/QSB/QuantumUNET/QSBOwnerMessage.cs @@ -2,7 +2,7 @@ namespace QSB.QuantumUNET { - class QSBOwnerMessage : MessageBase + internal class QSBOwnerMessage : MessageBase { public override void Deserialize(NetworkReader reader) { @@ -20,4 +20,4 @@ namespace QSB.QuantumUNET public short playerControllerId; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBPlayerController.cs b/QSB/QuantumUNET/QSBPlayerController.cs index 92f8f66e..322a07ee 100644 --- a/QSB/QuantumUNET/QSBPlayerController.cs +++ b/QSB/QuantumUNET/QSBPlayerController.cs @@ -37,4 +37,4 @@ namespace QSB.QuantumUNET public const int MaxPlayersPerClient = 32; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBRemovePlayerMessage.cs b/QSB/QuantumUNET/QSBRemovePlayerMessage.cs index 4f352b21..5f6c695d 100644 --- a/QSB/QuantumUNET/QSBRemovePlayerMessage.cs +++ b/QSB/QuantumUNET/QSBRemovePlayerMessage.cs @@ -16,4 +16,4 @@ namespace QSB.QuantumUNET public short playerControllerId; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBULocalConnectionToClient.cs b/QSB/QuantumUNET/QSBULocalConnectionToClient.cs index 1f018ba1..0595f420 100644 --- a/QSB/QuantumUNET/QSBULocalConnectionToClient.cs +++ b/QSB/QuantumUNET/QSBULocalConnectionToClient.cs @@ -2,7 +2,7 @@ namespace QSB.QuantumUNET { - class QSBULocalConnectionToClient : QSBNetworkConnection + internal class QSBULocalConnectionToClient : QSBNetworkConnection { public QSBULocalConnectionToClient(QSBLocalClient localClient) { @@ -64,4 +64,4 @@ namespace QSB.QuantumUNET private QSBLocalClient m_LocalClient; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBULocalConnectionToServer.cs b/QSB/QuantumUNET/QSBULocalConnectionToServer.cs index 88d06118..a1c56956 100644 --- a/QSB/QuantumUNET/QSBULocalConnectionToServer.cs +++ b/QSB/QuantumUNET/QSBULocalConnectionToServer.cs @@ -3,7 +3,7 @@ using UnityEngine.Networking; namespace QSB.QuantumUNET { - class QSBULocalConnectionToServer : QSBNetworkConnection + internal class QSBULocalConnectionToServer : QSBNetworkConnection { public QSBULocalConnectionToServer(QSBNetworkServer localServer) { @@ -65,4 +65,4 @@ namespace QSB.QuantumUNET private QSBNetworkServer m_LocalServer; } -} +} \ No newline at end of file diff --git a/QSB/QuantumUNET/QSBUtility.cs b/QSB/QuantumUNET/QSBUtility.cs index 2165abe7..90f596ae 100644 --- a/QSB/QuantumUNET/QSBUtility.cs +++ b/QSB/QuantumUNET/QSBUtility.cs @@ -60,4 +60,4 @@ namespace QSB.QuantumUNET private static Dictionary s_dictTokens = new Dictionary(); } -} +} \ No newline at end of file diff --git a/QSB/SectorSync/QSBSector.cs b/QSB/SectorSync/QSBSector.cs index 1b39882e..232cec20 100644 --- a/QSB/SectorSync/QSBSector.cs +++ b/QSB/SectorSync/QSBSector.cs @@ -17,4 +17,4 @@ namespace QSB.SectorSync ObjectId = id; } } -} +} \ No newline at end of file diff --git a/QSB/SectorSync/QSBSectorManager.cs b/QSB/SectorSync/QSBSectorManager.cs index 771643b0..cdbc5402 100644 --- a/QSB/SectorSync/QSBSectorManager.cs +++ b/QSB/SectorSync/QSBSectorManager.cs @@ -23,6 +23,7 @@ namespace QSB.SectorSync QSBSceneManager.OnUniverseSceneLoaded += (OWScene scene) => RebuildSectors(); DebugLog.DebugWrite("Sector Manager ready.", MessageType.Success); } + private void OnDestroy() { QSBSceneManager.OnUniverseSceneLoaded -= (OWScene scene) => RebuildSectors(); @@ -50,4 +51,4 @@ namespace QSB.SectorSync .First(); } } -} +} \ No newline at end of file diff --git a/QSB/SectorSync/SectorSync.cs b/QSB/SectorSync/SectorSync.cs index 18f46889..0173b515 100644 --- a/QSB/SectorSync/SectorSync.cs +++ b/QSB/SectorSync/SectorSync.cs @@ -46,4 +46,4 @@ namespace QSB.SectorSync GlobalMessenger.FireEvent(EventNames.QSBSectorChange, id, sector); } } -} +} \ No newline at end of file diff --git a/QSB/TimeSync/Events/ServerTimeEvent.cs b/QSB/TimeSync/Events/ServerTimeEvent.cs index 77d9364a..bc8e5cd0 100644 --- a/QSB/TimeSync/Events/ServerTimeEvent.cs +++ b/QSB/TimeSync/Events/ServerTimeEvent.cs @@ -24,4 +24,4 @@ namespace QSB.TimeSync.Events WakeUpSync.LocalInstance.OnClientReceiveMessage(message); } } -} +} \ No newline at end of file diff --git a/QSB/TimeSync/PreserveTimeScale.cs b/QSB/TimeSync/PreserveTimeScale.cs index bd3ef0e3..c24cf74c 100644 --- a/QSB/TimeSync/PreserveTimeScale.cs +++ b/QSB/TimeSync/PreserveTimeScale.cs @@ -22,4 +22,4 @@ namespace QSB.TimeSync } } } -} +} \ No newline at end of file diff --git a/QSB/TimeSync/TimeSyncType.cs b/QSB/TimeSync/TimeSyncType.cs index 6556cbec..e1545bc4 100644 --- a/QSB/TimeSync/TimeSyncType.cs +++ b/QSB/TimeSync/TimeSyncType.cs @@ -6,4 +6,4 @@ Pausing, Fastforwarding } -} +} \ No newline at end of file diff --git a/QSB/TimeSync/TimeSyncUI.cs b/QSB/TimeSync/TimeSyncUI.cs index 2991784a..895b671d 100644 --- a/QSB/TimeSync/TimeSyncUI.cs +++ b/QSB/TimeSync/TimeSyncUI.cs @@ -5,7 +5,7 @@ using UnityEngine.UI; namespace QSB.TimeSync { - class TimeSyncUI : MonoBehaviour + internal class TimeSyncUI : MonoBehaviour { public static TimeSyncUI Instance; @@ -42,6 +42,7 @@ namespace QSB.TimeSync } public static void Start(TimeSyncType type) => QSB.Helper.Events.Unity.RunWhen(() => Instance._isSetUp, () => Instance.StartTimeSync(type)); + public static void Stop() => QSB.Helper.Events.Unity.RunWhen(() => Instance._isSetUp, () => Instance.EndTimeSync()); private void StartTimeSync(TimeSyncType type) @@ -78,6 +79,7 @@ namespace QSB.TimeSync + Environment.NewLine + "Fast-forwarding to match server time..."; break; + case TimeSyncType.Pausing: text = "Pausing to match server time..."; break; diff --git a/QSB/TimeSync/WakeUpPatches.cs b/QSB/TimeSync/WakeUpPatches.cs index 65364a8e..0a41a4fa 100644 --- a/QSB/TimeSync/WakeUpPatches.cs +++ b/QSB/TimeSync/WakeUpPatches.cs @@ -20,4 +20,4 @@ namespace QSB.TimeSync QSB.Helper.HarmonyHelper.AddPrefix("OnStartOfTimeLoop", typeof(WakeUpPatches), nameof(OnStartOfTimeLoopPrefix)); } } -} +} \ No newline at end of file diff --git a/QSB/TimeSync/WakeUpSync.cs b/QSB/TimeSync/WakeUpSync.cs index 29f8bf25..5a033b58 100644 --- a/QSB/TimeSync/WakeUpSync.cs +++ b/QSB/TimeSync/WakeUpSync.cs @@ -17,6 +17,7 @@ namespace QSB.TimeSync private const float MinFastForwardSpeed = 2f; private enum State { NotLoaded, Loaded, FastForwarding, Pausing } + private State _state = State.NotLoaded; private float _sendTimer; diff --git a/QSB/Tools/Events/PlayerFlashlightEvent.cs b/QSB/Tools/Events/PlayerFlashlightEvent.cs index 3cc770c8..441533b4 100644 --- a/QSB/Tools/Events/PlayerFlashlightEvent.cs +++ b/QSB/Tools/Events/PlayerFlashlightEvent.cs @@ -21,6 +21,7 @@ namespace QSB.Tools.Events } private void HandleTurnOn() => SendEvent(CreateMessage(true)); + private void HandleTurnOff() => SendEvent(CreateMessage(false)); private ToggleMessage CreateMessage(bool value) => new ToggleMessage @@ -41,4 +42,4 @@ namespace QSB.Tools.Events QSBPlayerManager.LocalPlayer.UpdateState(State.Flashlight, message.ToggleValue); } } -} +} \ No newline at end of file diff --git a/QSB/Tools/Events/PlayerProbeEvent.cs b/QSB/Tools/Events/PlayerProbeEvent.cs index 63822356..8f698cb4 100644 --- a/QSB/Tools/Events/PlayerProbeEvent.cs +++ b/QSB/Tools/Events/PlayerProbeEvent.cs @@ -21,6 +21,7 @@ namespace QSB.Tools.Events } private void HandleLaunch(SurveyorProbe probe) => SendEvent(CreateMessage(true)); + private void HandleRetrieve(SurveyorProbe probe) => SendEvent(CreateMessage(false)); private ToggleMessage CreateMessage(bool value) => new ToggleMessage @@ -41,4 +42,4 @@ namespace QSB.Tools.Events QSBPlayerManager.LocalPlayer.UpdateState(State.ProbeActive, message.ToggleValue); } } -} +} \ No newline at end of file diff --git a/QSB/Tools/Events/PlayerProbeLauncherEvent.cs b/QSB/Tools/Events/PlayerProbeLauncherEvent.cs index 4973595d..1fe356af 100644 --- a/QSB/Tools/Events/PlayerProbeLauncherEvent.cs +++ b/QSB/Tools/Events/PlayerProbeLauncherEvent.cs @@ -21,6 +21,7 @@ namespace QSB.Tools.Events } private void HandleEquip(ProbeLauncher var) => SendEvent(CreateMessage(true)); + private void HandleUnequip(ProbeLauncher var) => SendEvent(CreateMessage(false)); private ToggleMessage CreateMessage(bool value) => new ToggleMessage @@ -41,4 +42,4 @@ namespace QSB.Tools.Events QSBPlayerManager.LocalPlayer.UpdateState(State.ProbeLauncher, message.ToggleValue); } } -} +} \ No newline at end of file diff --git a/QSB/Tools/Events/PlayerSignalscopeEvent.cs b/QSB/Tools/Events/PlayerSignalscopeEvent.cs index f0c4461d..8f2b9955 100644 --- a/QSB/Tools/Events/PlayerSignalscopeEvent.cs +++ b/QSB/Tools/Events/PlayerSignalscopeEvent.cs @@ -21,6 +21,7 @@ namespace QSB.Tools.Events } private void HandleEquip(Signalscope var) => SendEvent(CreateMessage(true)); + private void HandleUnequip() => SendEvent(CreateMessage(false)); private ToggleMessage CreateMessage(bool value) => new ToggleMessage @@ -41,4 +42,4 @@ namespace QSB.Tools.Events QSBPlayerManager.LocalPlayer.UpdateState(State.Signalscope, message.ToggleValue); } } -} +} \ No newline at end of file diff --git a/QSB/Tools/Events/PlayerTranslatorEvent.cs b/QSB/Tools/Events/PlayerTranslatorEvent.cs index 741aeda3..a185daaa 100644 --- a/QSB/Tools/Events/PlayerTranslatorEvent.cs +++ b/QSB/Tools/Events/PlayerTranslatorEvent.cs @@ -21,6 +21,7 @@ namespace QSB.Tools.Events } private void HandleEquip() => SendEvent(CreateMessage(true)); + private void HandleUnequip() => SendEvent(CreateMessage(false)); private ToggleMessage CreateMessage(bool value) => new ToggleMessage @@ -41,4 +42,4 @@ namespace QSB.Tools.Events QSBPlayerManager.LocalPlayer.UpdateState(State.Translator, message.ToggleValue); } } -} +} \ No newline at end of file diff --git a/QSB/Tools/ProbePatches.cs b/QSB/Tools/ProbePatches.cs index e26196aa..f68c04ca 100644 --- a/QSB/Tools/ProbePatches.cs +++ b/QSB/Tools/ProbePatches.cs @@ -26,4 +26,4 @@ namespace QSB.Tools QSB.Helper.HarmonyHelper.AddPrefix("Retrieve", typeof(ProbePatches), nameof(ProbeWarp)); } } -} +} \ No newline at end of file diff --git a/QSB/Tools/QSBFlashlight.cs b/QSB/Tools/QSBFlashlight.cs index 2c186057..ce07b29a 100644 --- a/QSB/Tools/QSBFlashlight.cs +++ b/QSB/Tools/QSBFlashlight.cs @@ -81,4 +81,4 @@ namespace QSB.Tools _wobblePivot.localRotation = OWUtilities.GetWobbleRotation(0.3f, 0.15f) * Quaternion.identity; } } -} +} \ No newline at end of file diff --git a/QSB/Tools/QSBProbe.cs b/QSB/Tools/QSBProbe.cs index aa876086..ad91fab2 100644 --- a/QSB/Tools/QSBProbe.cs +++ b/QSB/Tools/QSBProbe.cs @@ -28,4 +28,4 @@ namespace QSB.Tools gameObject.Hide(); } } -} +} \ No newline at end of file diff --git a/QSB/TransformSync/PlayerCameraSync.cs b/QSB/TransformSync/PlayerCameraSync.cs index 15688294..d4c3ec25 100644 --- a/QSB/TransformSync/PlayerCameraSync.cs +++ b/QSB/TransformSync/PlayerCameraSync.cs @@ -48,4 +48,4 @@ namespace QSB.TransformSync && NetId.Value != uint.MaxValue && NetId.Value != 0U; } -} +} \ No newline at end of file diff --git a/QSB/TransformSync/PlayerProbeSync.cs b/QSB/TransformSync/PlayerProbeSync.cs index 6c71ae2d..d45203ef 100644 --- a/QSB/TransformSync/PlayerProbeSync.cs +++ b/QSB/TransformSync/PlayerProbeSync.cs @@ -98,4 +98,4 @@ namespace QSB.TransformSync && NetId.Value != uint.MaxValue && NetId.Value != 0U; } -} +} \ No newline at end of file diff --git a/QSB/TransformSync/PlayerTransformSync.cs b/QSB/TransformSync/PlayerTransformSync.cs index f710b30c..7f41f7ba 100644 --- a/QSB/TransformSync/PlayerTransformSync.cs +++ b/QSB/TransformSync/PlayerTransformSync.cs @@ -62,4 +62,4 @@ namespace QSB.TransformSync && NetId.Value != uint.MaxValue && NetId.Value != 0U; } -} +} \ No newline at end of file diff --git a/QSB/TransformSync/ShipTransformSync.cs b/QSB/TransformSync/ShipTransformSync.cs index cf831f4d..48089bea 100644 --- a/QSB/TransformSync/ShipTransformSync.cs +++ b/QSB/TransformSync/ShipTransformSync.cs @@ -60,4 +60,4 @@ namespace QSB.TransformSync && NetId.Value != uint.MaxValue && NetId.Value != 0U; } -} +} \ No newline at end of file diff --git a/QSB/TransformSync/TransformSync.cs b/QSB/TransformSync/TransformSync.cs index 2a43a098..98b3a049 100644 --- a/QSB/TransformSync/TransformSync.cs +++ b/QSB/TransformSync/TransformSync.cs @@ -9,7 +9,9 @@ namespace QSB.TransformSync public abstract class TransformSync : PlayerSyncObject { public abstract bool IsReady { get; } + protected abstract Transform InitLocalTransform(); + protected abstract Transform InitRemoteTransform(); public Transform SyncedTransform { get; private set; } @@ -75,7 +77,7 @@ namespace QSB.TransformSync protected virtual void UpdateTransform() { - if (HasAuthority) // If this script is attached to the client's own body on the client's side. + if (HasAuthority) // If this script is attached to the client's own body on the client's side. { if (ReferenceSector == null || ReferenceSector.Sector == null) { @@ -87,7 +89,7 @@ namespace QSB.TransformSync return; } - // If this script is attached to any other body, eg the representations of other players + // If this script is attached to any other body, eg the representations of other players if (SyncedTransform.position == Vector3.zero) { Hide(); @@ -131,6 +133,5 @@ namespace QSB.TransformSync _isVisible = false; } } - } } \ No newline at end of file diff --git a/QSB/Utility/DebugLog.cs b/QSB/Utility/DebugLog.cs index a4987067..f6ab9404 100644 --- a/QSB/Utility/DebugLog.cs +++ b/QSB/Utility/DebugLog.cs @@ -49,4 +49,4 @@ namespace QSB.Utility return stackFrame.GetMethod().DeclaringType.Name; } } -} +} \ No newline at end of file diff --git a/QSB/Utility/FlagsHelper.cs b/QSB/Utility/FlagsHelper.cs index c68b8e92..55236ed9 100644 --- a/QSB/Utility/FlagsHelper.cs +++ b/QSB/Utility/FlagsHelper.cs @@ -28,4 +28,4 @@ flags = (T)(object)(flagsValue & ~flagValue); } } -} +} \ No newline at end of file diff --git a/QSB/Utility/GOExtensions.cs b/QSB/Utility/GOExtensions.cs index e734ac45..9919cdec 100644 --- a/QSB/Utility/GOExtensions.cs +++ b/QSB/Utility/GOExtensions.cs @@ -30,4 +30,4 @@ namespace QSB.Utility return original.gameObject.InstantiateInactive().transform; } } -} +} \ No newline at end of file diff --git a/QSB/Utility/ListExtensions.cs b/QSB/Utility/ListExtensions.cs index b0117404..5513c4d1 100644 --- a/QSB/Utility/ListExtensions.cs +++ b/QSB/Utility/ListExtensions.cs @@ -17,4 +17,4 @@ namespace QSB.Utility } } } -} +} \ No newline at end of file diff --git a/QSB/Utility/QuaternionHelper.cs b/QSB/Utility/QuaternionHelper.cs index 363f5f9c..aca03b08 100644 --- a/QSB/Utility/QuaternionHelper.cs +++ b/QSB/Utility/QuaternionHelper.cs @@ -30,4 +30,4 @@ namespace QSB.Utility return new Quaternion(result.x, result.y, result.z, result.w); } } -} +} \ No newline at end of file diff --git a/QSB/Utility/UnetExtensions.cs b/QSB/Utility/UnetExtensions.cs index 1e93f1fc..64b07a56 100644 --- a/QSB/Utility/UnetExtensions.cs +++ b/QSB/Utility/UnetExtensions.cs @@ -13,4 +13,4 @@ namespace QSB.Utility return QSBPlayerManager.GetPlayer(controller.NetId.Value); } } -} +} \ No newline at end of file diff --git a/QSB/WorldSync/Events/BoolWorldObjectMessage.cs b/QSB/WorldSync/Events/BoolWorldObjectMessage.cs index fa02052a..c3fba654 100644 --- a/QSB/WorldSync/Events/BoolWorldObjectMessage.cs +++ b/QSB/WorldSync/Events/BoolWorldObjectMessage.cs @@ -18,4 +18,4 @@ namespace QSB.WorldSync.Events writer.Write(State); } } -} +} \ No newline at end of file diff --git a/QSB/WorldSync/WorldObject.cs b/QSB/WorldSync/WorldObject.cs index b8f423bd..8fa1b0af 100644 --- a/QSB/WorldSync/WorldObject.cs +++ b/QSB/WorldSync/WorldObject.cs @@ -4,4 +4,4 @@ { public int ObjectId { get; protected set; } } -} +} \ No newline at end of file diff --git a/QSB/WorldSync/WorldRegistry.cs b/QSB/WorldSync/WorldRegistry.cs index cf012da0..b016f674 100644 --- a/QSB/WorldSync/WorldRegistry.cs +++ b/QSB/WorldSync/WorldRegistry.cs @@ -80,4 +80,4 @@ namespace QSB.WorldSync delegateList.ForEach(x => x.DynamicInvoke(instance)); } } -} +} \ No newline at end of file diff --git a/QSB/default-config.json b/QSB/default-config.json index 1d394b36..f110ec1d 100644 --- a/QSB/default-config.json +++ b/QSB/default-config.json @@ -5,4 +5,4 @@ "port": 7777, "debugMode": true } -} +} \ No newline at end of file diff --git a/QSB/manifest.json b/QSB/manifest.json index 3121b217..ca73a10e 100644 --- a/QSB/manifest.json +++ b/QSB/manifest.json @@ -6,4 +6,4 @@ "uniqueName": "Raicuparta.QuantumSpaceBuddies", "version": "0.7.0", "owmlVersion": "0.7.3" -} +} \ No newline at end of file