Skip to content

Commit

Permalink
Merge Logistics Processors
Browse files Browse the repository at this point in the history
  • Loading branch information
hubastard committed Jul 24, 2021
1 parent 9d3824b commit f7076e6
Show file tree
Hide file tree
Showing 20 changed files with 304 additions and 337 deletions.
8 changes: 1 addition & 7 deletions Nebula.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
version.json = version.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NebulaHost", "NebulaHost\NebulaHost.csproj", "{1927F7FF-230B-4B1B-B7ED-34B58730AFBE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NebulaWorld", "NebulaWorld\NebulaWorld.csproj", "{28AEA139-FB22-4672-AF51-28B728CF2978}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "websocket-sharp", "dep\websocket-sharp\websocket-sharp\websocket-sharp.csproj", "{B357BAC7-529E-4D81-A0D2-71041B19C8DE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NebulaNetwork", "NebulaNetwork\NebulaNetwork.csproj", "{36A3D8AE-2A0A-4A1F-8A65-4FB61B01F779}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NebulaNetwork", "NebulaNetwork\NebulaNetwork.csproj", "{36A3D8AE-2A0A-4A1F-8A65-4FB61B01F779}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -39,10 +37,6 @@ Global
{28B0716C-3926-4865-AB43-6C4431D022D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28B0716C-3926-4865-AB43-6C4431D022D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28B0716C-3926-4865-AB43-6C4431D022D6}.Release|Any CPU.Build.0 = Release|Any CPU
{1927F7FF-230B-4B1B-B7ED-34B58730AFBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1927F7FF-230B-4B1B-B7ED-34B58730AFBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1927F7FF-230B-4B1B-B7ED-34B58730AFBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1927F7FF-230B-4B1B-B7ED-34B58730AFBE}.Release|Any CPU.Build.0 = Release|Any CPU
{28AEA139-FB22-4672-AF51-28B728CF2978}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28AEA139-FB22-4672-AF51-28B728CF2978}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28AEA139-FB22-4672-AF51-28B728CF2978}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions NebulaHost/PacketProcessors/Logistics/ILSShipBroadcastProcessor.cs

This file was deleted.

This file was deleted.

This file was deleted.

75 changes: 0 additions & 75 deletions NebulaHost/PacketProcessors/Logistics/StationUIBroadcaster.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ namespace NebulaNetwork.PacketProcessors.Logistics
class ILSArriveStarPlanetRequestProcessor: PacketProcessor<ILSArriveStarPlanetRequest>
{
private PlayerManager playerManager;

public ILSArriveStarPlanetRequestProcessor()
{
playerManager = MultiplayerHostSession.Instance.PlayerManager;
playerManager = MultiplayerHostSession.Instance?.PlayerManager;
}

public override void ProcessPacket(ILSArriveStarPlanetRequest packet, NebulaConnection conn)
{
if (IsClient) return;

Player player = playerManager.GetPlayer(conn);
if (player == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class ILSArriveStarPlanetResponseProcessor: PacketProcessor<ILSArriveStarPlanetR
{
public override void ProcessPacket(ILSArriveStarPlanetResponse packet, NebulaConnection conn)
{
if (IsHost) return;

StationComponent[] gStationPool = null;
if (packet.Planet == 0) // arrive at solar system
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,28 @@ namespace NebulaNetwork.PacketProcessors.Logistics
[RegisterPacketProcessor]
class ILSRemoteOrderProcessor : PacketProcessor<ILSRemoteOrderData>
{
private PlayerManager playerManager;

public ILSRemoteOrderProcessor()
{
playerManager = MultiplayerHostSession.Instance?.PlayerManager;
}

public override void ProcessPacket(ILSRemoteOrderData packet, NebulaConnection conn)
{
SimulatedWorld.OnILSRemoteOrderUpdate(packet);
if (IsHost)
{
Player player = playerManager.GetPlayer(conn);
if (player != null)
playerManager.SendPacketToOtherPlayers(packet, player);

// TODO: Don't we need to call SimulatedWorld.OnILSRemoteOrderUpdate() here too ??
}

if (IsClient)
{
SimulatedWorld.OnILSRemoteOrderUpdate(packet);
}
}
}
}
Loading

0 comments on commit f7076e6

Please sign in to comment.