Skip to content

Commit 4fc20b6

Browse files
committed
Removed escapepod referenced content
1 parent 62f7c51 commit 4fc20b6

File tree

15 files changed

+46
-7
lines changed

15 files changed

+46
-7
lines changed

Nitrox.Test/Server/Serialization/WorldPersistenceTest.cs

+2
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,12 @@ private static void EntityTest(Entity entity, Entity entityAfter)
376376
{
377377
case PlaceholderGroupWorldEntity _ when worldEntityAfter is PlaceholderGroupWorldEntity _:
378378
break;
379+
#if SUBNAUTICA
379380
case EscapePodWorldEntity escapePodWorldEntity when worldEntityAfter is EscapePodWorldEntity escapePodWorldEntityAfter:
380381
Assert.AreEqual(escapePodWorldEntity.Damaged, escapePodWorldEntityAfter.Damaged);
381382
Assert.IsTrue(escapePodWorldEntity.Players.SequenceEqual(escapePodWorldEntityAfter.Players));
382383
break;
384+
#endif
383385
case PlayerWorldEntity _ when worldEntityAfter is PlayerWorldEntity _:
384386
break;
385387
case VehicleWorldEntity vehicleWorldEntity when worldEntityAfter is VehicleWorldEntity vehicleWorldEntityAfter:

NitroxClient/GameLogic/Entities.cs

+2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ public Entities(IPacketSender packetSender, ThrottledPacketSender throttledPacke
4242
entitySpawnersByType[typeof(InventoryItemEntity)] = new InventoryItemEntitySpawner();
4343
entitySpawnersByType[typeof(WorldEntity)] = new WorldEntitySpawner(playerManager, localPlayer);
4444
entitySpawnersByType[typeof(PlaceholderGroupWorldEntity)] = entitySpawnersByType[typeof(WorldEntity)];
45+
#if SUBNAUTICA
4546
entitySpawnersByType[typeof(EscapePodWorldEntity)] = entitySpawnersByType[typeof(WorldEntity)];
47+
#endif
4648
entitySpawnersByType[typeof(PlayerWorldEntity)] = entitySpawnersByType[typeof(WorldEntity)];
4749
entitySpawnersByType[typeof(VehicleWorldEntity)] = entitySpawnersByType[typeof(WorldEntity)];
4850
}

NitroxClient/GameLogic/Helper/EquipmentHelper.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using NitroxClient.Unity.Helper;
44
using NitroxModel.DataStructures.Util;
@@ -14,7 +14,9 @@ public class EquipmentHelper
1414
o => o.GetComponent<BaseNuclearReactor>().AliveOrNull()?._equipment,
1515
o => o.GetComponent<CyclopsDecoyLoadingTube>().AliveOrNull()?.decoySlots,
1616
o => o.GetComponent<Exosuit>().AliveOrNull()?.modules,
17+
#if SUBNAUTICA
1718
o => o.GetComponent<SeaMoth>().AliveOrNull()?.modules,
19+
#endif
1820
o => o.GetComponent<UpgradeConsole>().AliveOrNull()?.modules,
1921
o => o.GetComponent<Vehicle>().AliveOrNull()?.modules,
2022
o => o.GetComponent<VehicleUpgradeConsoleInput>().AliveOrNull()?.equipment,

NitroxClient/GameLogic/LocalPlayer.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ public void BroadcastLocation(Vector3 location, Vector3 velocity, Quaternion bod
7777
public void BroadcastDeath(Vector3 deathPosition) => packetSender.Send(new PlayerDeathEvent(multiplayerSession.Reservation.PlayerId, deathPosition.ToDto()));
7878

7979
public void BroadcastSubrootChange(Optional<NitroxId> subrootId) => packetSender.Send(new SubRootChanged(multiplayerSession.Reservation.PlayerId, subrootId));
80-
80+
#if SUBNAUTICA
8181
public void BroadcastEscapePodChange(Optional<NitroxId> escapePodId) => packetSender.Send(new EscapePodChanged(multiplayerSession.Reservation.PlayerId, escapePodId));
82+
#endif
8283

8384
public void BroadcastWeld(NitroxId id, float healthAdded) => packetSender.Send(new WeldAction(id, healthAdded));
8485

NitroxClient/GameLogic/RemotePlayer.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,11 @@ public void SetVehicle(Vehicle newVehicle)
233233
// Therefore we need to make sure that the MultiplayerVehicleControl component exists before using it
234234
switch (newVehicle)
235235
{
236+
#if SUBNAUTICA
236237
case SeaMoth:
237238
newVehicle.gameObject.EnsureComponent<MultiplayerSeaMoth>().Enter();
238239
break;
240+
#endif
239241
case Exosuit:
240242
newVehicle.gameObject.EnsureComponent<MultiplayerExosuit>().Enter();
241243
break;
@@ -245,8 +247,9 @@ public void SetVehicle(Vehicle newVehicle)
245247
RigidBody.isKinematic = newVehicle;
246248

247249
Vehicle = newVehicle;
248-
250+
#if SUBNAUTICA
249251
AnimationController["in_seamoth"] = newVehicle is SeaMoth;
252+
#endif
250253
AnimationController["in_exosuit"] = AnimationController["using_mechsuit"] = newVehicle is Exosuit;
251254
}
252255
}

NitroxModel/DataStructures/GameLogic/Entities/EscapePodEntity.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if SUBNAUTICA
12
using System;
23
using NitroxModel.DataStructures.GameLogic.Entities.Metadata;
34
using NitroxModel.DataStructures.Unity;
@@ -65,3 +66,4 @@ public override string ToString()
6566

6667
}
6768
}
69+
#endif

NitroxModel/DataStructures/GameLogic/Entities/WorldEntity.cs

+2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ namespace NitroxModel.DataStructures.GameLogic.Entities
1515
[Serializable]
1616
[DataContract]
1717
[ProtoInclude(51, typeof(PlaceholderGroupWorldEntity))]
18+
#if SUBNAUTICA
1819
[ProtoInclude(52, typeof(EscapePodWorldEntity))]
20+
#endif
1921
[ProtoInclude(53, typeof(PlayerWorldEntity))]
2022
[ProtoInclude(54, typeof(VehicleWorldEntity))]
2123
[ProtoInclude(55, typeof(CellRootEntity))]

NitroxModel/Packets/EscapePodChanged.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
#if SUBNAUTICA
2+
using System;
23
using NitroxModel.DataStructures;
34
using NitroxModel.DataStructures.Util;
45

@@ -18,3 +19,4 @@ public EscapePodChanged(ushort playerId, Optional<NitroxId> escapePodId)
1819
}
1920
}
2021

22+
#endif

NitroxModel/Packets/InitialPlayerSync.cs

+11-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ namespace NitroxModel.Packets
1212
{
1313
[Serializable]
1414
public class InitialPlayerSync : Packet
15-
{
15+
{
16+
#if SUBNAUTICA
1617
public NitroxId AssignedEscapePodId { get; }
18+
#endif
1719
public List<EquippedItemData> EquippedItems { get; }
1820
public List<BasePiece> BasePieces { get; }
1921
public List<NitroxTechType> UsedItems { get; }
@@ -36,7 +38,9 @@ public class InitialPlayerSync : Packet
3638

3739
public InitialPlayerSync(NitroxId playerGameObjectId,
3840
bool firstTimeConnecting,
41+
#if SUBNAUTICA
3942
NitroxId assignedEscapePodId,
43+
#endif
4044
IEnumerable<EquippedItemData> equipment,
4145
IEnumerable<BasePiece> basePieces,
4246
IEnumerable<NitroxTechType> usedItems,
@@ -55,7 +59,9 @@ public InitialPlayerSync(NitroxId playerGameObjectId,
5559
SubnauticaPlayerPreferences preferences,
5660
TimeData timeData)
5761
{
62+
#if SUBNAUTICA
5863
AssignedEscapePodId = assignedEscapePodId;
64+
#endif
5965
PlayerGameObjectId = playerGameObjectId;
6066
FirstTimeConnecting = firstTimeConnecting;
6167
EquippedItems = equipment.ToList();
@@ -79,7 +85,9 @@ public InitialPlayerSync(NitroxId playerGameObjectId,
7985

8086
/// <remarks>Used for deserialization</remarks>
8187
public InitialPlayerSync(
88+
#if SUBNAUTICA
8289
NitroxId assignedEscapePodId,
90+
#endif
8391
List<EquippedItemData> equippedItems,
8492
List<BasePiece> basePieces,
8593
List<NitroxTechType> usedItems,
@@ -100,7 +108,9 @@ public InitialPlayerSync(
100108
SubnauticaPlayerPreferences preferences,
101109
TimeData timeData)
102110
{
111+
#if SUBNAUTICA
103112
AssignedEscapePodId = assignedEscapePodId;
113+
#endif
104114
PlayerGameObjectId = playerGameObjectId;
105115
FirstTimeConnecting = firstTimeConnecting;
106116
EquippedItems = equippedItems;

NitroxServer/Communication/Packets/Processors/EscapePodChangedPacketProcessor.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using NitroxModel.Packets;
1+
#if SUBNAUTICA
2+
using NitroxModel.Packets;
23
using NitroxServer.Communication.Packets.Processors.Abstract;
34
using NitroxServer.GameLogic;
45

@@ -21,3 +22,4 @@ public override void Process(EscapePodChanged packet, Player player)
2122
}
2223
}
2324
}
25+
#endif

NitroxServer/Communication/Packets/Processors/PlayerJoiningMultiplayerSessionProcessor.cs

+4
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ public PlayerJoiningMultiplayerSessionProcessor(ScheduleKeeper scheduleKeeper, S
3636
public override void Process(PlayerJoiningMultiplayerSession packet, NitroxConnection connection)
3737
{
3838
Player player = playerManager.PlayerConnected(connection, packet.ReservationKey, out bool wasBrandNewPlayer);
39+
#if SUBNAUTUICA
3940
NitroxId assignedEscapePodId = world.EscapePodManager.AssignPlayerToEscapePod(player.Id, out Optional<EscapePodWorldEntity> newlyCreatedEscapePod);
4041

4142
if (newlyCreatedEscapePod.HasValue)
4243
{
4344
SpawnEntities spawnNewEscapePod = new(newlyCreatedEscapePod.Value);
4445
playerManager.SendPacketToOtherPlayers(spawnNewEscapePod, player);
4546
}
47+
#endif
4648

4749
List<EquippedItemData> equippedItems = player.GetEquipment();
4850
List<NitroxTechType> techTypes = equippedItems.Select(equippedItem => equippedItem.TechType).ToList();
@@ -69,7 +71,9 @@ public override void Process(PlayerJoiningMultiplayerSession packet, NitroxConne
6971

7072
InitialPlayerSync initialPlayerSync = new(player.GameObjectId,
7173
wasBrandNewPlayer,
74+
#if SUBNAUTICA
7275
assignedEscapePodId,
76+
#endif
7377
equippedItems,
7478
world.BaseManager.GetBasePiecesForNewlyConnectedPlayer(),
7579
player.UsedItems,

NitroxServer/GameLogic/EscapePodManager.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if SUBNAUTICA
12
using System;
23
using System.Collections.Generic;
34
using NitroxModel.DataStructures;
@@ -155,3 +156,4 @@ private static bool IsPodFull(EscapePodWorldEntity pod)
155156
}
156157
}
157158
}
159+
#endif

NitroxServer/Serialization/World/World.cs

+2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ public class World
1212
public ScheduleKeeper ScheduleKeeper { get; set; }
1313
public TimeKeeper TimeKeeper { get; set; }
1414
public SimulationOwnershipData SimulationOwnershipData { get; set; }
15+
#if SUBNAUTCIA
1516
public EscapePodManager EscapePodManager { get; set; }
17+
#endif
1618
public BatchEntitySpawner BatchEntitySpawner { get; set; }
1719
public EntitySimulation EntitySimulation { get; set; }
1820
public EntityRegistry EntityRegistry { get; set; }

NitroxServer/Serialization/World/WorldPersistence.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,9 @@ public World CreateWorld(PersistedWorldData pWorldData, ServerGameMode gameMode)
200200
PlayerManager = new PlayerManager(pWorldData.PlayerData.GetPlayers(), config),
201201

202202
BaseManager = new BaseManager(pWorldData.BaseData.PartiallyConstructedPieces, pWorldData.BaseData.CompletedBasePieceHistory),
203-
203+
#if SUBNAUTICA
204204
EscapePodManager = new EscapePodManager(entityRegistry, randomStart, seed),
205+
#endif
205206

206207
EntityRegistry = entityRegistry,
207208

NitroxServer/ServerAutoFacRegistrar.cs

+2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ private static void RegisterCoreDependencies(ContainerBuilder containerBuilder)
3333
containerBuilder.RegisterType<PlayerManager>().SingleInstance();
3434
containerBuilder.RegisterType<DefaultServerPacketProcessor>().InstancePerLifetimeScope();
3535
containerBuilder.RegisterType<PacketHandler>().InstancePerLifetimeScope();
36+
#if SUBNAUTICA
3637
containerBuilder.RegisterType<EscapePodManager>().InstancePerLifetimeScope();
38+
#endif
3739
containerBuilder.RegisterType<EntitySimulation>().SingleInstance();
3840
containerBuilder.RegisterType<ConsoleCommandProcessor>().SingleInstance();
3941

0 commit comments

Comments
 (0)