-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add backward compatibility in Savemanager - Add sprayer and moniter connection syncing
- Loading branch information
Showing
21 changed files
with
223 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ckets/Belt/BeltUpdatePickupItemsPacket.cs → ...ctory/Belt/BeltUpdatePickupItemsPacket.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Packets/Belt/BeltUpdatePutItemOnPacket.cs → ...Factory/Belt/BeltUpdatePutItemOnPacket.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
NebulaModel/Packets/Factory/Belt/ConnectToMonitorPacket.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace NebulaModel.Packets.Factory.Belt | ||
{ | ||
public class ConnectToMonitorPacket | ||
{ | ||
public int MonitorId { get; set; } | ||
public int BeltId { get; set; } | ||
public int Offset { get; set; } | ||
public int PlanetId { get; set; } | ||
|
||
public ConnectToMonitorPacket() { } | ||
public ConnectToMonitorPacket(int monitorId, int beltId, int offset, int planetId) | ||
{ | ||
MonitorId = monitorId; | ||
BeltId = beltId; | ||
Offset = offset; | ||
PlanetId = planetId; | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
NebulaModel/Packets/Factory/Belt/ConnectToSpraycoaterPacket.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace NebulaModel.Packets.Factory.Belt | ||
{ | ||
public class ConnectToSpraycoaterPacket | ||
{ | ||
public int SpraycoaterId { get; set; } | ||
public int CargoBeltId { get; set; } | ||
public int IncBeltId { get; set; } | ||
public int PlanetId { get; set; } | ||
|
||
public ConnectToSpraycoaterPacket() { } | ||
public ConnectToSpraycoaterPacket(int spraycoaterId, int cargoBeltId, int incBeltId, int planetId) | ||
{ | ||
SpraycoaterId = spraycoaterId; | ||
CargoBeltId = cargoBeltId; | ||
IncBeltId = incBeltId; | ||
PlanetId = planetId; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
NebulaNetwork/PacketProcessors/Factory/Belt/ConnectToMonitorProcessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using NebulaAPI; | ||
using NebulaModel.Networking; | ||
using NebulaModel.Packets; | ||
using NebulaModel.Packets.Factory.Belt; | ||
using NebulaWorld; | ||
|
||
namespace NebulaNetwork.PacketProcessors.Factory.Belt | ||
{ | ||
[RegisterPacketProcessor] | ||
internal class ConnectToMonitorProcessor : PacketProcessor<ConnectToMonitorPacket> | ||
{ | ||
public override void ProcessPacket(ConnectToMonitorPacket packet, NebulaConnection conn) | ||
{ | ||
using (Multiplayer.Session.Factories.IsIncomingRequest.On()) | ||
{ | ||
CargoTraffic cargoTraffic = GameMain.galaxy.PlanetById(packet.PlanetId)?.factory?.cargoTraffic; | ||
if (cargoTraffic == null) | ||
{ | ||
return; | ||
} | ||
cargoTraffic.ConnectToMonitor(packet.MonitorId, packet.BeltId, packet.Offset); | ||
} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
NebulaNetwork/PacketProcessors/Factory/Belt/ConnectToSpraycoaterProcessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using NebulaAPI; | ||
using NebulaModel.Networking; | ||
using NebulaModel.Packets; | ||
using NebulaModel.Packets.Factory.Belt; | ||
using NebulaWorld; | ||
|
||
namespace NebulaNetwork.PacketProcessors.Factory.Belt | ||
{ | ||
[RegisterPacketProcessor] | ||
internal class ConnectToSpraycoaterProcessor : PacketProcessor<ConnectToSpraycoaterPacket> | ||
{ | ||
public override void ProcessPacket(ConnectToSpraycoaterPacket packet, NebulaConnection conn) | ||
{ | ||
using (Multiplayer.Session.Factories.IsIncomingRequest.On()) | ||
{ | ||
CargoTraffic cargoTraffic = GameMain.galaxy.PlanetById(packet.PlanetId)?.factory?.cargoTraffic; | ||
if (cargoTraffic == null) | ||
{ | ||
return; | ||
} | ||
cargoTraffic.ConnectToSpraycoater(packet.SpraycoaterId, packet.CargoBeltId, packet.IncBeltId); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
NebulaNetwork/PacketProcessors/Players/RemoveDroneOrdersProcessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.