diff --git a/Nitrox.Bootloader/Main.cs b/Nitrox.Bootloader/Main.cs
index a466472ac3..7a25b6c42f 100644
--- a/Nitrox.Bootloader/Main.cs
+++ b/Nitrox.Bootloader/Main.cs
@@ -1,6 +1,5 @@
using System;
using System.IO;
-using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
diff --git a/Nitrox.Bootloader/Nitrox.Bootloader.csproj b/Nitrox.Bootloader/Nitrox.Bootloader.csproj
index 501e29ab24..cad927795f 100644
--- a/Nitrox.Bootloader/Nitrox.Bootloader.csproj
+++ b/Nitrox.Bootloader/Nitrox.Bootloader.csproj
@@ -1,27 +1,27 @@
-
+
-
-
- Debug
- AnyCPU
- {E4226522-9189-410B-93B2-792942FBD588}
- Library
- Properties
- Nitrox.Bootloader
- Nitrox.Bootloader
- 512
- false
-
-
- AnyCPU
- true
- full
- false
- prompt
- 4
-
-
-
-
-
-
+
+
+ Debug
+ AnyCPU
+ {E4226522-9189-410B-93B2-792942FBD588}
+ Library
+ Properties
+ Nitrox.Bootloader
+ Nitrox.Bootloader
+ 512
+ false
+
+
+ AnyCPU
+ true
+ full
+ false
+ prompt
+ 4
+
+
+
+
+
+
\ No newline at end of file
diff --git a/NitroxClient/Communication/MultiplayerSession/ConnectionState/Disconnected.cs b/NitroxClient/Communication/MultiplayerSession/ConnectionState/Disconnected.cs
index cbb5b6c937..2ecb788001 100644
--- a/NitroxClient/Communication/MultiplayerSession/ConnectionState/Disconnected.cs
+++ b/NitroxClient/Communication/MultiplayerSession/ConnectionState/Disconnected.cs
@@ -20,7 +20,7 @@ public void NegotiateReservation(IMultiplayerSessionConnectionContext sessionCon
IClient client = sessionConnectionContext.Client;
string ipAddress = sessionConnectionContext.IpAddress;
int port = sessionConnectionContext.ServerPort;
- StartClient(ipAddress, client,port);
+ StartClient(ipAddress, client, port);
EstablishSessionPolicy(sessionConnectionContext, client);
}
}
@@ -55,7 +55,7 @@ private static void StartClient(string ipAddress, IClient client, int port)
{
if (!client.IsConnected)
{
- client.Start(ipAddress,port);
+ client.Start(ipAddress, port);
if (!client.IsConnected)
{
diff --git a/NitroxClient/Communication/MultiplayerSession/MultiplayerSessionManager.cs b/NitroxClient/Communication/MultiplayerSession/MultiplayerSessionManager.cs
index d1423fe909..652e2bcdde 100644
--- a/NitroxClient/Communication/MultiplayerSession/MultiplayerSessionManager.cs
+++ b/NitroxClient/Communication/MultiplayerSession/MultiplayerSessionManager.cs
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using NitroxClient.Communication.Abstract;
using NitroxClient.Communication.MultiplayerSession.ConnectionState;
-using NitroxClient.Debuggers;
using NitroxClient.GameLogic;
using NitroxModel;
using NitroxModel.Helper;
diff --git a/NitroxClient/Communication/Packets/Processors/ChatMessageProcessor.cs b/NitroxClient/Communication/Packets/Processors/ChatMessageProcessor.cs
index ed09f510dc..7a93c1a024 100644
--- a/NitroxClient/Communication/Packets/Processors/ChatMessageProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/ChatMessageProcessor.cs
@@ -3,7 +3,6 @@
using NitroxClient.Communication.Packets.Processors.Abstract;
using NitroxClient.GameLogic;
using NitroxClient.GameLogic.ChatUI;
-using NitroxModel.Core;
using NitroxModel.DataStructures.Util;
using NitroxModel.Logger;
using NitroxModel.Packets;
diff --git a/NitroxClient/Communication/Packets/Processors/ConstructionAmountChangedProcessor.cs b/NitroxClient/Communication/Packets/Processors/ConstructionAmountChangedProcessor.cs
index ea65cd4710..2f2fa2afaa 100644
--- a/NitroxClient/Communication/Packets/Processors/ConstructionAmountChangedProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/ConstructionAmountChangedProcessor.cs
@@ -11,7 +11,7 @@ public class ConstructionAmountChangedProcessor : ClientPacketProcessor();
BaseDeconstructable baseDeconstructable = deconstructing.GetComponent();
diff --git a/NitroxClient/Communication/Packets/Processors/EntityMetadataUpdateProcessor.cs b/NitroxClient/Communication/Packets/Processors/EntityMetadataUpdateProcessor.cs
index 460b76424a..624c59826e 100644
--- a/NitroxClient/Communication/Packets/Processors/EntityMetadataUpdateProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/EntityMetadataUpdateProcessor.cs
@@ -16,7 +16,7 @@ public override void Process(EntityMetadataUpdate update)
Optional metadataProcessor = EntityMetadataProcessor.FromMetaData(update.NewValue);
Validate.IsTrue(metadataProcessor.HasValue, $"No processor found for EntityMetadata of type {update.NewValue.GetType()}");
-
+
metadataProcessor.Value.ProcessMetadata(gameObject, update.NewValue);
}
}
diff --git a/NitroxClient/Communication/Packets/Processors/EntityTransformUpdatesProcessor.cs b/NitroxClient/Communication/Packets/Processors/EntityTransformUpdatesProcessor.cs
index 0dd7f2bcec..a91e7d041c 100644
--- a/NitroxClient/Communication/Packets/Processors/EntityTransformUpdatesProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/EntityTransformUpdatesProcessor.cs
@@ -1,6 +1,5 @@
using NitroxClient.Communication.Packets.Processors.Abstract;
using NitroxClient.MonoBehaviours;
-using NitroxClient.Unity.Smoothing;
using NitroxModel.DataStructures.Util;
using NitroxModel.Packets;
using NitroxModel_Subnautica.DataStructures;
diff --git a/NitroxClient/Communication/Packets/Processors/EscapePodRadioRepairProcessor.cs b/NitroxClient/Communication/Packets/Processors/EscapePodRadioRepairProcessor.cs
index 835109f8a5..7eb1222f03 100644
--- a/NitroxClient/Communication/Packets/Processors/EscapePodRadioRepairProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/EscapePodRadioRepairProcessor.cs
@@ -1,6 +1,6 @@
using NitroxClient.Communication.Packets.Processors.Abstract;
-using NitroxModel.Packets;
using NitroxClient.GameLogic;
+using NitroxModel.Packets;
namespace NitroxClient.Communication.Packets.Processors
{
diff --git a/NitroxClient/Communication/Packets/Processors/EscapePodRepairProcessor.cs b/NitroxClient/Communication/Packets/Processors/EscapePodRepairProcessor.cs
index beeb95864f..3b6dc02ecb 100644
--- a/NitroxClient/Communication/Packets/Processors/EscapePodRepairProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/EscapePodRepairProcessor.cs
@@ -1,6 +1,6 @@
using NitroxClient.Communication.Packets.Processors.Abstract;
-using NitroxModel.Packets;
using NitroxClient.GameLogic;
+using NitroxModel.Packets;
namespace NitroxClient.Communication.Packets.Processors
{
diff --git a/NitroxClient/Communication/Packets/Processors/ExosuitArmActionProcessor.cs b/NitroxClient/Communication/Packets/Processors/ExosuitArmActionProcessor.cs
index 1d88d9d7ee..1ba105b059 100644
--- a/NitroxClient/Communication/Packets/Processors/ExosuitArmActionProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/ExosuitArmActionProcessor.cs
@@ -41,14 +41,14 @@ public override void Process(ExosuitArmActionPacket packet)
case TechType.ExosuitGrapplingArmModule:
exosuitModuleEvent.UseGrappling(gameObject.GetComponent(), packet.ArmAction, packet.OpVector);
break;
- case TechType.ExosuitTorpedoArmModule:
- exosuitModuleEvent.UseTorpedo(gameObject.GetComponent(), packet.ArmAction, packet.OpVector, packet.OpRotation);
+ case TechType.ExosuitTorpedoArmModule:
+ exosuitModuleEvent.UseTorpedo(gameObject.GetComponent(), packet.ArmAction, packet.OpVector, packet.OpRotation);
break;
default:
Log.Error("Got an arm tech that is not handled: " + packet.TechType + " with action: " + packet.ArmAction + " for id " + packet.ArmId);
break;
}
-
+
}
}
}
diff --git a/NitroxClient/Communication/Packets/Processors/GameModeChangedProcessor.cs b/NitroxClient/Communication/Packets/Processors/GameModeChangedProcessor.cs
index 2b6df04e99..2132f8f012 100644
--- a/NitroxClient/Communication/Packets/Processors/GameModeChangedProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/GameModeChangedProcessor.cs
@@ -7,7 +7,7 @@ public class GameModeChangedProcessor : ClientPacketProcessor
{
public override void Process(GameModeChanged packet)
{
- GameModeUtils.SetGameMode((GameModeOption)(int) packet.GameMode, GameModeOption.None);
+ GameModeUtils.SetGameMode((GameModeOption)(int)packet.GameMode, GameModeOption.None);
}
}
}
diff --git a/NitroxClient/Communication/Packets/Processors/InitialPlayerSyncProcessor.cs b/NitroxClient/Communication/Packets/Processors/InitialPlayerSyncProcessor.cs
index e0b053f3f6..ac64d88d65 100644
--- a/NitroxClient/Communication/Packets/Processors/InitialPlayerSyncProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/InitialPlayerSyncProcessor.cs
@@ -1,12 +1,12 @@
-using NitroxClient.Communication.Packets.Processors.Abstract;
-using NitroxModel.Packets;
+using System;
+using System.Collections;
using System.Collections.Generic;
+using NitroxClient.Communication.Abstract;
+using NitroxClient.Communication.Packets.Processors.Abstract;
using NitroxClient.GameLogic.InitialSync.Base;
-using System;
-using NitroxModel.Logger;
using NitroxClient.MonoBehaviours;
-using System.Collections;
-using NitroxClient.Communication.Abstract;
+using NitroxModel.Logger;
+using NitroxModel.Packets;
namespace NitroxClient.Communication.Packets.Processors
{
diff --git a/NitroxClient/Communication/Packets/Processors/KnownTechEntryAddProcessor.cs b/NitroxClient/Communication/Packets/Processors/KnownTechEntryAddProcessor.cs
index 243f98207b..6d2267fcff 100644
--- a/NitroxClient/Communication/Packets/Processors/KnownTechEntryAddProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/KnownTechEntryAddProcessor.cs
@@ -2,7 +2,6 @@
using NitroxClient.Communication.Packets.Processors.Abstract;
using NitroxModel.Packets;
using NitroxModel_Subnautica.DataStructures;
-using NitroxModel_Subnautica.Helper;
namespace NitroxClient.Communication.Packets.Processors
{
diff --git a/NitroxClient/Communication/Packets/Processors/ModuleRemovedProcessor.cs b/NitroxClient/Communication/Packets/Processors/ModuleRemovedProcessor.cs
index d168c1fc1b..089f2f0e31 100644
--- a/NitroxClient/Communication/Packets/Processors/ModuleRemovedProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/ModuleRemovedProcessor.cs
@@ -24,7 +24,7 @@ public override void Process(ModuleRemoved packet)
Log.Error("Could not find equipment type for " + owner.name);
return;
}
-
+
GameObject item = NitroxEntity.RequireObjectFrom(packet.ItemId);
Pickupable pickupable = item.RequireComponent();
Equipment equipment = opEquipment.Value;
@@ -32,7 +32,7 @@ public override void Process(ModuleRemoved packet)
InventoryItem inventoryItem = itemsBySlot[packet.Slot];
itemsBySlot[packet.Slot] = null;
- equipment.ReflectionCall("UpdateCount",false,false,pickupable.GetTechType(), false);
+ equipment.ReflectionCall("UpdateCount", false, false, pickupable.GetTechType(), false);
Equipment.SendEquipmentEvent(pickupable, UNEQUIP_EVENT_TYPE_ID, owner, packet.Slot);
equipment.ReflectionCall("NotifyUnequip", false, false, packet.Slot, inventoryItem);
diff --git a/NitroxClient/Communication/Packets/Processors/PDAEncyclopediaEntryAddProcessor.cs b/NitroxClient/Communication/Packets/Processors/PDAEncyclopediaEntryAddProcessor.cs
index 75af1855a3..dc7cb863d3 100644
--- a/NitroxClient/Communication/Packets/Processors/PDAEncyclopediaEntryAddProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/PDAEncyclopediaEntryAddProcessor.cs
@@ -17,7 +17,7 @@ public override void Process(PDAEncyclopediaEntryAdd packet)
{
using (packetSender.Suppress())
{
- PDAEncyclopedia.Add(packet.Key,true);
+ PDAEncyclopedia.Add(packet.Key, true);
}
}
}
diff --git a/NitroxClient/Communication/Packets/Processors/PDALogEntryAddProcessor.cs b/NitroxClient/Communication/Packets/Processors/PDALogEntryAddProcessor.cs
index ebf6042537..4c2523798b 100644
--- a/NitroxClient/Communication/Packets/Processors/PDALogEntryAddProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/PDALogEntryAddProcessor.cs
@@ -20,12 +20,11 @@ public override void Process(PDALogEntryAdd packet)
using (packetSender.Suppress())
{
Dictionary entries = (Dictionary)(typeof(PDALog).GetField("entries", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null));
-
+
if (!entries.ContainsKey(packet.Key))
{
- PDALog.EntryData entryData;
- if (!PDALog.GetEntryData(packet.Key, out entryData))
+ if (!PDALog.GetEntryData(packet.Key, out PDALog.EntryData entryData))
{
entryData = new PDALog.EntryData();
entryData.key = packet.Key;
diff --git a/NitroxClient/Communication/Packets/Processors/PDAScannerEntryAddProcessor.cs b/NitroxClient/Communication/Packets/Processors/PDAScannerEntryAddProcessor.cs
index 4a0a2e1420..c4c948f5c7 100644
--- a/NitroxClient/Communication/Packets/Processors/PDAScannerEntryAddProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/PDAScannerEntryAddProcessor.cs
@@ -5,7 +5,6 @@
using NitroxClient.Communication.Packets.Processors.Abstract;
using NitroxModel.Packets;
using NitroxModel_Subnautica.DataStructures;
-using NitroxModel_Subnautica.Helper;
using UnityEngine;
namespace NitroxClient.Communication.Packets.Processors
@@ -27,8 +26,7 @@ public override void Process(PDAEntryAdd packet)
TechType techType = packet.TechType.ToUnity();
PDAScanner.EntryData entryData = PDAScanner.GetEntryData(techType);
- PDAScanner.Entry entry;
- if (!PDAScanner.GetPartialEntryByKey(techType, out entry))
+ if (!PDAScanner.GetPartialEntryByKey(techType, out PDAScanner.Entry entry))
{
MethodInfo methodAdd = typeof(PDAScanner).GetMethod("Add", BindingFlags.NonPublic | BindingFlags.Static, null, new Type[] { typeof(TechType), typeof(int) }, null);
entry = (PDAScanner.Entry)methodAdd.Invoke(null, new object[] { techType, packet.Unlocked });
diff --git a/NitroxClient/Communication/Packets/Processors/PDAScannerEntryRemoveProcessor.cs b/NitroxClient/Communication/Packets/Processors/PDAScannerEntryRemoveProcessor.cs
index 8240bbf311..b89b15beff 100644
--- a/NitroxClient/Communication/Packets/Processors/PDAScannerEntryRemoveProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/PDAScannerEntryRemoveProcessor.cs
@@ -4,7 +4,6 @@
using NitroxClient.Communication.Packets.Processors.Abstract;
using NitroxModel.Packets;
using NitroxModel_Subnautica.DataStructures;
-using NitroxModel_Subnautica.Helper;
namespace NitroxClient.Communication.Packets.Processors
{
@@ -21,9 +20,8 @@ public override void Process(PDAEntryRemove packet)
{
using (packetSender.Suppress())
{
- PDAScanner.Entry entry;
- if (PDAScanner.GetPartialEntryByKey(packet.TechType.ToUnity(), out entry))
+ if (PDAScanner.GetPartialEntryByKey(packet.TechType.ToUnity(), out PDAScanner.Entry entry))
{
List partial = (List)(typeof(PDAScanner).GetField("partial", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null));
HashSet complete = (HashSet)(typeof(PDAScanner).GetField("complete", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null));
diff --git a/NitroxClient/Communication/Packets/Processors/PingRenamedProcessor.cs b/NitroxClient/Communication/Packets/Processors/PingRenamedProcessor.cs
index 75c2a5bd66..f5d196ed63 100644
--- a/NitroxClient/Communication/Packets/Processors/PingRenamedProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/PingRenamedProcessor.cs
@@ -1,5 +1,4 @@
-using System;
-using NitroxClient.Communication.Abstract;
+using NitroxClient.Communication.Abstract;
using NitroxClient.Communication.Packets.Processors.Abstract;
using NitroxClient.MonoBehaviours;
using NitroxClient.Unity.Helper;
diff --git a/NitroxClient/Communication/Packets/Processors/PlaceBasePieceProcessor.cs b/NitroxClient/Communication/Packets/Processors/PlaceBasePieceProcessor.cs
index fb163d1cfa..cedd4a7f98 100644
--- a/NitroxClient/Communication/Packets/Processors/PlaceBasePieceProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/PlaceBasePieceProcessor.cs
@@ -1,6 +1,6 @@
using NitroxClient.Communication.Packets.Processors.Abstract;
-using NitroxModel.Packets;
using NitroxClient.GameLogic.Bases;
+using NitroxModel.Packets;
namespace NitroxClient.Communication.Packets.Processors
{
diff --git a/NitroxClient/Communication/Packets/Processors/RemotePlayerEquipmentAddedProcessor.cs b/NitroxClient/Communication/Packets/Processors/RemotePlayerEquipmentAddedProcessor.cs
index 4f6ed5cf69..c9cec3fe42 100644
--- a/NitroxClient/Communication/Packets/Processors/RemotePlayerEquipmentAddedProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/RemotePlayerEquipmentAddedProcessor.cs
@@ -2,7 +2,6 @@
using NitroxClient.GameLogic;
using NitroxModel.Packets;
using NitroxModel_Subnautica.DataStructures;
-using NitroxModel_Subnautica.Helper;
namespace NitroxClient.Communication.Packets.Processors
{
@@ -19,8 +18,7 @@ public override void Process(RemotePlayerEquipmentAdded packet)
{
ushort playerId = packet.PlayerId;
- RemotePlayer player;
- if (!playerManager.TryFind(playerId, out player))
+ if (!playerManager.TryFind(playerId, out RemotePlayer player))
{
return;
}
diff --git a/NitroxClient/Communication/Packets/Processors/RemotePlayerEquipmentRemovedProcessor.cs b/NitroxClient/Communication/Packets/Processors/RemotePlayerEquipmentRemovedProcessor.cs
index ecffa42e2b..ec332ae143 100644
--- a/NitroxClient/Communication/Packets/Processors/RemotePlayerEquipmentRemovedProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/RemotePlayerEquipmentRemovedProcessor.cs
@@ -2,7 +2,6 @@
using NitroxClient.GameLogic;
using NitroxModel.Packets;
using NitroxModel_Subnautica.DataStructures;
-using NitroxModel_Subnautica.Helper;
namespace NitroxClient.Communication.Packets.Processors
{
@@ -19,8 +18,7 @@ public override void Process(RemotePlayerEquipmentRemoved packet)
{
ushort playerId = packet.PlayerId;
- RemotePlayer player;
- if (!playerManager.TryFind(playerId, out player))
+ if (!playerManager.TryFind(playerId, out RemotePlayer player))
{
return;
}
diff --git a/NitroxClient/Communication/Packets/Processors/SceneDebuggerChangeProcessor.cs b/NitroxClient/Communication/Packets/Processors/SceneDebuggerChangeProcessor.cs
index 5d583f6b34..cfdbd118ad 100644
--- a/NitroxClient/Communication/Packets/Processors/SceneDebuggerChangeProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/SceneDebuggerChangeProcessor.cs
@@ -1,10 +1,10 @@
using System.Linq;
using System.Reflection;
+using NitroxClient.Communication.Abstract;
using NitroxClient.Communication.Packets.Processors.Abstract;
using NitroxModel.Logger;
using NitroxModel.Packets;
using UnityEngine;
-using NitroxClient.Communication.Abstract;
namespace NitroxClient.Communication.Packets.Processors
{
diff --git a/NitroxClient/Communication/Packets/Processors/SeamothModuleActionProcessor.cs b/NitroxClient/Communication/Packets/Processors/SeamothModuleActionProcessor.cs
index d033f22a58..b717f91da3 100644
--- a/NitroxClient/Communication/Packets/Processors/SeamothModuleActionProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/SeamothModuleActionProcessor.cs
@@ -4,7 +4,6 @@
using NitroxModel.Helper;
using NitroxModel.Packets;
using NitroxModel_Subnautica.DataStructures;
-using NitroxModel_Subnautica.Helper;
using UnityEngine;
namespace NitroxClient.Communication.Packets.Processors
diff --git a/NitroxClient/Communication/Packets/Processors/StorageSlotAddItemProcessor.cs b/NitroxClient/Communication/Packets/Processors/StorageSlotAddItemProcessor.cs
index 02f8f7b0bc..f63c4209b5 100644
--- a/NitroxClient/Communication/Packets/Processors/StorageSlotAddItemProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/StorageSlotAddItemProcessor.cs
@@ -21,13 +21,13 @@ public StorageSlotAddItemProcessor(IPacketSender packetSender, StorageSlots stor
}
public override void Process(StorageSlotItemAdd packet)
- {
+ {
ItemData itemData = packet.ItemData;
- GameObject item = SerializationHelper.GetGameObject(itemData.SerializedData);
-
+ GameObject item = SerializationHelper.GetGameObject(itemData.SerializedData);
+
NitroxEntity.SetNewId(item, itemData.ItemId);
- storageSlots.AddItem(item, itemData.ContainerId);
+ storageSlots.AddItem(item, itemData.ContainerId);
}
}
}
diff --git a/NitroxClient/Communication/Packets/Processors/VehicleDockingProcessor.cs b/NitroxClient/Communication/Packets/Processors/VehicleDockingProcessor.cs
index d416f3ad9b..c89809df80 100644
--- a/NitroxClient/Communication/Packets/Processors/VehicleDockingProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/VehicleDockingProcessor.cs
@@ -1,15 +1,13 @@
-using NitroxClient.Communication.Abstract;
+using System.Collections;
+using NitroxClient.Communication.Abstract;
using NitroxClient.Communication.Packets.Processors.Abstract;
using NitroxClient.GameLogic;
+using NitroxClient.MonoBehaviours;
using NitroxClient.Unity.Helper;
-using NitroxModel.Packets;
-using System.Collections;
-using UnityEngine;
using NitroxModel.DataStructures;
-using NitroxClient.MonoBehaviours;
using NitroxModel.Logger;
-using NitroxModel.Helper;
-using NitroxModel.DataStructures.Util;
+using NitroxModel.Packets;
+using UnityEngine;
namespace NitroxClient.Communication.Packets.Processors
{
@@ -43,7 +41,7 @@ public override void Process(VehicleDocking packet)
vehicle.GetComponent().Exit();
}
vehicle.StartCoroutine(DelayAnimationAndDisablePiloting(vehicle, vehicleDockingBay, packet.VehicleId, packet.PlayerId));
- }
+ }
IEnumerator DelayAnimationAndDisablePiloting(Vehicle vehicle, VehicleDockingBay vehicleDockingBay, NitroxId vehicleId, ushort playerId)
{
diff --git a/NitroxClient/Communication/Packets/Processors/VehicleOnPilotModeChangedProcessor.cs b/NitroxClient/Communication/Packets/Processors/VehicleOnPilotModeChangedProcessor.cs
index 75145e35d1..7b68515361 100644
--- a/NitroxClient/Communication/Packets/Processors/VehicleOnPilotModeChangedProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/VehicleOnPilotModeChangedProcessor.cs
@@ -23,7 +23,7 @@ public override void Process(VehicleOnPilotModeChanged packet)
{
GameObject vehicleGo = NitroxEntity.RequireObjectFrom(packet.VehicleId);
Vehicle vehicle = vehicleGo.RequireComponent();
-
+
// If the vehicle is docked, then we will manually set the piloting mode
// once the animations complete. This prevents weird behaviour such as the
// player existing the vehicle while it is about to dock (the event fires
diff --git a/NitroxClient/Communication/Packets/Processors/VehicleUndockingProcessor.cs b/NitroxClient/Communication/Packets/Processors/VehicleUndockingProcessor.cs
index 71375f7281..131671cdc0 100644
--- a/NitroxClient/Communication/Packets/Processors/VehicleUndockingProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/VehicleUndockingProcessor.cs
@@ -1,14 +1,14 @@
-using NitroxClient.Communication.Abstract;
+using System.Collections;
+using NitroxClient.Communication.Abstract;
using NitroxClient.Communication.Packets.Processors.Abstract;
using NitroxClient.GameLogic;
+using NitroxClient.MonoBehaviours;
using NitroxClient.Unity.Helper;
+using NitroxModel.DataStructures.Util;
using NitroxModel.Helper;
+using NitroxModel.Logger;
using NitroxModel.Packets;
-using System.Collections;
using UnityEngine;
-using NitroxClient.MonoBehaviours;
-using NitroxModel.DataStructures.Util;
-using NitroxModel.Logger;
namespace NitroxClient.Communication.Packets.Processors
{
@@ -32,10 +32,10 @@ public override void Process(VehicleUndocking packet)
Vehicle vehicle = vehicleGo.RequireComponent();
VehicleDockingBay vehicleDockingBay = vehicleDockingBayGo.RequireComponentInChildren();
-
+
using (packetSender.Suppress())
{
-
+
if (packet.UndockingStart)
{
StartVehicleUndocking(packet, vehicleGo, vehicle, vehicleDockingBay);
@@ -52,9 +52,9 @@ private void StartVehicleUndocking(VehicleUndocking packet, GameObject vehicleGo
Optional player = remotePlayerManager.Find(packet.PlayerId);
vehicleDockingBay.subRoot.BroadcastMessage("OnLaunchBayOpening", SendMessageOptions.DontRequireReceiver);
SkyEnvironmentChanged.Broadcast(vehicleGo, (GameObject)null);
-
+
if (player.HasValue)
- {
+ {
RemotePlayer playerInstance = player.Value;
vehicle.mainAnimator.SetBool("player_in", true);
playerInstance.Attach(vehicle.playerPosition.transform);
@@ -68,7 +68,7 @@ private void StartVehicleUndocking(VehicleUndocking packet, GameObject vehicleGo
}
vehicleDockingBay.StartCoroutine(StartUndockingAnimation(vehicleDockingBay));
}
-
+
public IEnumerator StartUndockingAnimation(VehicleDockingBay vehicleDockingBay)
{
yield return new WaitForSeconds(2.0f);
diff --git a/NitroxClient/Communication/Packets/Processors/WeldActionProcessor.cs b/NitroxClient/Communication/Packets/Processors/WeldActionProcessor.cs
index 3973014c4d..7f502d168c 100644
--- a/NitroxClient/Communication/Packets/Processors/WeldActionProcessor.cs
+++ b/NitroxClient/Communication/Packets/Processors/WeldActionProcessor.cs
@@ -2,7 +2,6 @@
using NitroxClient.Communication.Packets.Processors.Abstract;
using NitroxClient.GameLogic;
using NitroxClient.MonoBehaviours;
-using NitroxModel.DataStructures.Util;
using NitroxModel.Logger;
using NitroxModel.Packets;
using UnityEngine;
diff --git a/NitroxClient/Debuggers/EntityDebugger.cs b/NitroxClient/Debuggers/EntityDebugger.cs
index d3337a6710..6953f6d821 100644
--- a/NitroxClient/Debuggers/EntityDebugger.cs
+++ b/NitroxClient/Debuggers/EntityDebugger.cs
@@ -80,7 +80,7 @@ public override void OnGUI()
GUI.backgroundColor = labelBgColor;
GUI.color = labelFgColor;
GUI.Box(drawSize, textContent);
-
+
GUI.backgroundColor = oldBgColor;
}
}
diff --git a/NitroxClient/Debuggers/NetworkDebugger.cs b/NitroxClient/Debuggers/NetworkDebugger.cs
index 1b21f1fa9b..7baf2b26af 100644
--- a/NitroxClient/Debuggers/NetworkDebugger.cs
+++ b/NitroxClient/Debuggers/NetworkDebugger.cs
@@ -192,8 +192,7 @@ private void AddPacket(Packet packet, bool isSent)
}
}
- int count;
- if (countByType.TryGetValue(packetType, out count))
+ if (countByType.TryGetValue(packetType, out int count))
{
countByType[packetType] = count + 1;
}
diff --git a/NitroxClient/Debuggers/SceneDebugger.cs b/NitroxClient/Debuggers/SceneDebugger.cs
index 110ea80177..799c69345c 100644
--- a/NitroxClient/Debuggers/SceneDebugger.cs
+++ b/NitroxClient/Debuggers/SceneDebugger.cs
@@ -237,7 +237,7 @@ private void RenderTabScenes()
using (new GUILayout.VerticalScope("Box"))
{
GUILayout.Label("All scenes", "header");
- for (int i = 0; i < SceneManager.sceneCountInBuildSettings+1; i++)
+ for (int i = 0; i < SceneManager.sceneCountInBuildSettings + 1; i++)
{
Scene currentScene;
string path = "";
diff --git a/NitroxClient/GameLogic/Bases/BuildThrottlingQueue.cs b/NitroxClient/GameLogic/Bases/BuildThrottlingQueue.cs
index 7ff84b5231..b84bff8c0b 100644
--- a/NitroxClient/GameLogic/Bases/BuildThrottlingQueue.cs
+++ b/NitroxClient/GameLogic/Bases/BuildThrottlingQueue.cs
@@ -1,7 +1,7 @@
-using NitroxModel.DataStructures.GameLogic;
-using NitroxModel.Logger;
-using System.Collections.Generic;
+using System.Collections.Generic;
using NitroxModel.DataStructures;
+using NitroxModel.DataStructures.GameLogic;
+using NitroxModel.Logger;
namespace NitroxClient.GameLogic.Bases
{
@@ -11,13 +11,13 @@ namespace NitroxClient.GameLogic.Bases
* hold build events for future processing. Incoming packets can be converted
* to more generic BuildEvent classes that can be re-used. Examples: we want
* to re-use logic for ConstructionCompleted packet and InitialPlayerSync build
- * packets - this class helps faciliate that.
+ * packets - this class helps facilitate that.
*/
public class BuildThrottlingQueue : Queue
{
public bool NextEventRequiresFreshFrame()
{
- if(Count > 0)
+ if (Count > 0)
{
BuildEvent nextEvent = Peek();
return nextEvent.RequiresFreshFrame();
@@ -28,31 +28,31 @@ public bool NextEventRequiresFreshFrame()
public void EnqueueBasePiecePlaced(BasePiece basePiece)
{
- Log.Info("Enqueuing base piece to be placed techtype: " + basePiece.TechType + " id: " + basePiece.Id + " parentId: " + basePiece.ParentId.OrElse(null) + " build index: " + basePiece.BuildIndex );
+ Log.Info($"Enqueuing base piece to be placed - TechType: {basePiece.TechType}, Id: {basePiece.Id}, ParentId: {basePiece.ParentId.OrElse(null)}, BuildIndex: {basePiece.BuildIndex}");
Enqueue(new BasePiecePlacedEvent(basePiece));
}
public void EnqueueConstructionCompleted(NitroxId id, NitroxId baseId)
{
- Log.Info("Enqueuing item to have construction completed id: " + id);
+ Log.Info($"Enqueuing item to have construction completed - Id: {id}");
Enqueue(new ConstructionCompletedEvent(id, baseId));
}
public void EnqueueAmountChanged(NitroxId id, float amount)
{
- Log.Info("Enqueuing item to have construction amount changed id: " + id);
+ Log.Info($"Enqueuing item to have construction amount changed - Id: {id}");
Enqueue(new ConstructionAmountChangedEvent(id, amount));
}
public void EnqueueDeconstructionBegin(NitroxId id)
{
- Log.Info("Enqueuing item to have deconstruction beginning id: " + id);
+ Log.Info($"Enqueuing item to have deconstruction beginning - Id: {id}");
Enqueue(new DeconstructionBeginEvent(id));
}
public void EnqueueDeconstructionCompleted(NitroxId id)
{
- Log.Info("Enqueuing item to have deconstruction completed id: " + id);
+ Log.Info($"Enqueuing item to have deconstruction completed - Id: {id}");
Enqueue(new DeconstructionCompletedEvent(id));
}
}
diff --git a/NitroxClient/GameLogic/Bases/Metadata/BasePieceMetadataProcessor.cs b/NitroxClient/GameLogic/Bases/Metadata/BasePieceMetadataProcessor.cs
index 336247a3bb..d1e350ba11 100644
--- a/NitroxClient/GameLogic/Bases/Metadata/BasePieceMetadataProcessor.cs
+++ b/NitroxClient/GameLogic/Bases/Metadata/BasePieceMetadataProcessor.cs
@@ -26,7 +26,7 @@ static BasePieceMetadataProcessor()
foreach (BasePieceMetadataProcessor processor in processors)
{
-
+
Type metadataType = processor.GetType().BaseType.GetGenericArguments()[0];
processorsByType.Add(metadataType, processor);
}
@@ -34,9 +34,8 @@ static BasePieceMetadataProcessor()
public static BasePieceMetadataProcessor FromMetaData(BasePieceMetadata metadata)
{
- BasePieceMetadataProcessor processor;
- if (processorsByType.TryGetValue(metadata.GetType(), out processor))
+ if (processorsByType.TryGetValue(metadata.GetType(), out BasePieceMetadataProcessor processor))
{
return processor;
}
diff --git a/NitroxClient/GameLogic/Bases/Spawning/BaseBioReactorSpawnProcessor.cs b/NitroxClient/GameLogic/Bases/Spawning/BaseBioReactorSpawnProcessor.cs
index 27568f95f4..f4d178a0a7 100644
--- a/NitroxClient/GameLogic/Bases/Spawning/BaseBioReactorSpawnProcessor.cs
+++ b/NitroxClient/GameLogic/Bases/Spawning/BaseBioReactorSpawnProcessor.cs
@@ -1,5 +1,4 @@
-using System.Linq;
-using NitroxClient.MonoBehaviours;
+using NitroxClient.MonoBehaviours;
using NitroxClient.Unity.Helper;
using NitroxModel.DataStructures;
using NitroxModel.Helper;
diff --git a/NitroxClient/GameLogic/Bases/Spawning/BasePieceSpawnPrioritizer.cs b/NitroxClient/GameLogic/Bases/Spawning/BasePieceSpawnPrioritizer.cs
index 588fd57b7e..00e79b9c87 100644
--- a/NitroxClient/GameLogic/Bases/Spawning/BasePieceSpawnPrioritizer.cs
+++ b/NitroxClient/GameLogic/Bases/Spawning/BasePieceSpawnPrioritizer.cs
@@ -66,15 +66,14 @@ public List OrderBasePiecesByPriority(List inputPieces)
.ThenBy(piece => piece.IsFurniture) // Ensure base building block go before furniture
.ThenBy(piece => ComputeBasePiecePriority(piece)) // Ensure remaining pieces are prioritized by above order.
.ThenBy(piece => piece.BuildIndex)
- .ToList();
+ .ToList();
}
private int ComputeBasePiecePriority(BasePiece basePiece)
{
TechType techType = basePiece.TechType.ToUnity();
- int position;
- if (PiecesToPriority.TryGetValue(techType, out position))
+ if (PiecesToPriority.TryGetValue(techType, out int position))
{
return position;
}
diff --git a/NitroxClient/GameLogic/Bases/Spawning/BasePieceSpawnProcessor.cs b/NitroxClient/GameLogic/Bases/Spawning/BasePieceSpawnProcessor.cs
index 8063e8d5eb..e670337bf3 100644
--- a/NitroxClient/GameLogic/Bases/Spawning/BasePieceSpawnProcessor.cs
+++ b/NitroxClient/GameLogic/Bases/Spawning/BasePieceSpawnProcessor.cs
@@ -40,9 +40,8 @@ public static BasePieceSpawnProcessor From(BaseDeconstructable baseDeconstructab
{
TechType techType = (TechType)baseDeconstructable.ReflectionGet("recipe");
- BasePieceSpawnProcessor processor;
- if (processorsByType.TryGetValue(techType, out processor))
+ if (processorsByType.TryGetValue(techType, out BasePieceSpawnProcessor processor))
{
Log.Info("Found custom BasePieceSpawnProcessor for " + techType);
return processor;
diff --git a/NitroxClient/GameLogic/Bases/Spawning/BaseRoomWaterParkProcessor.cs b/NitroxClient/GameLogic/Bases/Spawning/BaseRoomWaterParkProcessor.cs
index 6e2cbc9953..2e442d1080 100644
--- a/NitroxClient/GameLogic/Bases/Spawning/BaseRoomWaterParkProcessor.cs
+++ b/NitroxClient/GameLogic/Bases/Spawning/BaseRoomWaterParkProcessor.cs
@@ -1,8 +1,8 @@
using NitroxClient.MonoBehaviours;
using NitroxModel.DataStructures;
-using UnityEngine;
-using NitroxModel.Logger;
using NitroxModel.Helper;
+using NitroxModel.Logger;
+using UnityEngine;
namespace NitroxClient.GameLogic.Bases.Spawning
{
@@ -12,7 +12,7 @@ namespace NitroxClient.GameLogic.Bases.Spawning
* contains a Planter. When the object spawns, we use this class to set a deterministic id seeded by the parent id.
* This keeps inventory actions in sync and allows for persistent storage of each container's contents.
*/
- public class BaseRoomWaterParkProcessor: BasePieceSpawnProcessor
+ public class BaseRoomWaterParkProcessor : BasePieceSpawnProcessor
{
public override TechType[] ApplicableTechTypes { get; } =
{
@@ -24,7 +24,7 @@ public override void SpawnPostProcess(Base latestBase, Int3 latestCell, GameObje
NitroxId pieceId = NitroxEntity.GetId(finishedPiece);
WaterParkPiece waterParkPiece = finishedPiece.GetComponent();
- if(!waterParkPiece)
+ if (!waterParkPiece)
{
// The BaseWater has multiple base pieces, but only one of them (the bottom) contains the WaterParkPiece component...
return;
diff --git a/NitroxClient/GameLogic/Building.cs b/NitroxClient/GameLogic/Building.cs
index a7bb121008..7ccaa00a5b 100644
--- a/NitroxClient/GameLogic/Building.cs
+++ b/NitroxClient/GameLogic/Building.cs
@@ -24,7 +24,7 @@ public class Building
private readonly RotationMetadataFactory rotationMetadataFactory;
private float timeSinceLastConstructionChangeEvent;
-
+
public Building(IPacketSender packetSender, RotationMetadataFactory rotationMetadataFactory)
{
this.packetSender = packetSender;
@@ -37,11 +37,11 @@ public void PlaceBasePiece(BaseGhost baseGhost, ConstructableBase constructableB
{
return;
}
-
+
NitroxId id = NitroxEntity.GetId(constructableBase.gameObject);
NitroxId parentBaseId = null;
-
+
if (baseGhost != null)
{
if (baseGhost.TargetBase != null)
@@ -53,8 +53,8 @@ public void PlaceBasePiece(BaseGhost baseGhost, ConstructableBase constructableB
parentBaseId = NitroxEntity.GetId(baseGhost.GhostBase.gameObject);
}
}
-
- if(parentBaseId == null)
+
+ if (parentBaseId == null)
{
Base aBase = constructableBase.gameObject.GetComponentInParent();
if (aBase != null)
@@ -62,7 +62,7 @@ public void PlaceBasePiece(BaseGhost baseGhost, ConstructableBase constructableB
parentBaseId = NitroxEntity.GetId(aBase.gameObject);
}
}
-
+
Vector3 placedPosition = constructableBase.gameObject.transform.position;
Transform camera = Camera.main.transform;
Optional rotationMetadata = rotationMetadataFactory.From(baseGhost);
@@ -92,7 +92,7 @@ public void PlaceFurniture(GameObject gameObject, TechType techType, Vector3 ite
{
Base playerBase = gameObject.GetComponentInParent();
- if(playerBase != null)
+ if (playerBase != null)
{
parentId = NitroxEntity.GetId(playerBase.gameObject);
}
@@ -119,7 +119,7 @@ public void ChangeConstructionAmount(GameObject gameObject, float amount)
}
timeSinceLastConstructionChangeEvent = 0.0f;
-
+
NitroxId id = NitroxEntity.GetId(gameObject);
if (amount < 0.95f) // Construction complete event handled by function below
@@ -133,7 +133,7 @@ public void ConstructionComplete(GameObject ghost, Optional lastTargetBase
{
NitroxId baseId = null;
Optional