fix(core): Tightens the network stack (#479)
- [X] Removes network pause/resume - [X] Adds back packet profiler - [X] Adds state machine to keep track and trace netstates - [X] Changes NetState.Running back to using an interlock exchange - [X] Adds preliminary packet throttling support ### Packet Throttling - `[GetThrottle <packetId>` to get the delay in milliseconds for that packet - `[SetThrottle <packetId> <delay>` to set the delay in milliseconds for that packet The settings are saved to `Configuration/throttles.json`
This commit is contained in:
parent
1736469ac0
commit
8903028b5f
36 changed files with 1018 additions and 405 deletions
|
|
@ -11,7 +11,7 @@ namespace Server.Network
|
|||
|
||||
var buffer = (board.BoardName ?? "").GetBytesUtf8();
|
||||
|
||||
Stream.Write((byte)0x00); // PacketID
|
||||
Stream.Write((byte)0x00); // Packet ID
|
||||
Stream.Write(board.Serial); // Bulletin board serial
|
||||
|
||||
// Bulletin board name
|
||||
|
|
@ -38,7 +38,7 @@ namespace Server.Network
|
|||
|
||||
EnsureCapacity(22 + poster.Length + subject.Length + time.Length);
|
||||
|
||||
Stream.Write((byte)0x01); // PacketID
|
||||
Stream.Write((byte)0x01); // Packet ID
|
||||
Stream.Write(board.Serial); // Bulletin board serial
|
||||
Stream.Write(msg.Serial); // Message serial
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ namespace Server.Network
|
|||
|
||||
EnsureCapacity(22 + poster.Length + subject.Length + time.Length);
|
||||
|
||||
Stream.Write((byte)0x02); // PacketID
|
||||
Stream.Write((byte)0x02); // Packet ID
|
||||
Stream.Write(board.Serial); // Bulletin board serial
|
||||
Stream.Write(msg.Serial); // Message serial
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue