Skip to content

Commit

Permalink
Reset NetworkGameSession on Init of NetManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Jul 16, 2024
1 parent eab6989 commit 34ef328
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Fika.Core/Networking/FikaClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public bool Started

public void Init()
{
NetworkGameSession.RTT = 0;
NetworkGameSession.LossPercent = 0;

packetProcessor.SubscribeNetSerializable<PlayerStatePacket>(OnPlayerStatePacketReceived);
packetProcessor.SubscribeNetSerializable<GameTimerPacket>(OnGameTimerPacketReceived);
packetProcessor.SubscribeNetSerializable<WeaponPacket>(OnFirearmPacketReceived);
Expand Down
3 changes: 3 additions & 0 deletions Fika.Core/Networking/FikaServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public bool Started

public async Task Init()
{
NetworkGameSession.RTT = 0;
NetworkGameSession.LossPercent = 0;

// Start at 1 to avoid having 0 and making us think it's working when it's not
_currentNetId = 1;

Expand Down

0 comments on commit 34ef328

Please sign in to comment.