-
-
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.
Merge pull request #489 from starfi5h/pr-dysonSphereStatus
- Loading branch information
Showing
11 changed files
with
142 additions
and
58 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.Universe | ||
{ | ||
public class DysonSphereStatusPacket | ||
{ | ||
public int StarIndex { get; set; } | ||
public float GrossRadius { get; set; } | ||
public long EnergyReqCurrentTick { get; set; } | ||
public long EnergyGenCurrentTick { get; set; } | ||
|
||
public DysonSphereStatusPacket() {} | ||
public DysonSphereStatusPacket(DysonSphere dysonSphere) | ||
{ | ||
StarIndex = dysonSphere.starData.index; | ||
GrossRadius = dysonSphere.grossRadius; | ||
EnergyReqCurrentTick = dysonSphere.energyReqCurrentTick; | ||
EnergyGenCurrentTick = dysonSphere.energyGenCurrentTick; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
NebulaNetwork/PacketProcessors/Universe/DysonSphereStatusProcessor.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,23 @@ | ||
using NebulaAPI; | ||
using NebulaModel.Networking; | ||
using NebulaModel.Packets; | ||
using NebulaModel.Packets.Universe; | ||
|
||
namespace NebulaNetwork.PacketProcessors.Universe | ||
{ | ||
[RegisterPacketProcessor] | ||
internal class DysonSphereStatusProcessor : PacketProcessor<DysonSphereStatusPacket> | ||
{ | ||
public override void ProcessPacket(DysonSphereStatusPacket packet, NebulaConnection conn) | ||
{ | ||
DysonSphere dysonSphere = GameMain.data.dysonSpheres[packet.StarIndex]; | ||
if (IsHost || dysonSphere == null) | ||
{ | ||
return; | ||
} | ||
dysonSphere.grossRadius = packet.GrossRadius; | ||
dysonSphere.energyReqCurrentTick = packet.EnergyReqCurrentTick; | ||
dysonSphere.energyGenCurrentTick = packet.EnergyGenCurrentTick; | ||
} | ||
} | ||
} |
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