Skip to content

Commit

Permalink
Accounting for transport enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Hoffmann committed Aug 19, 2020
1 parent 8b2e135 commit ec84968
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void ReceiveData()
{
try
{
while (Receive(out SteamId clientSteamID, out byte[] internalMessage, internal_ch))
while (transport.enabled && Receive(out SteamId clientSteamID, out byte[] internalMessage, internal_ch))
{
if (internalMessage.Length == 1)
{
Expand All @@ -106,7 +106,7 @@ public void ReceiveData()

for (int chNum = 0; chNum < channels.Length; chNum++)
{
while (Receive(out SteamId clientSteamID, out byte[] receiveBuffer, chNum))
while (transport.enabled && Receive(out SteamId clientSteamID, out byte[] receiveBuffer, chNum))
{
OnReceiveData(receiveBuffer, clientSteamID, chNum);
}
Expand Down
7 changes: 5 additions & 2 deletions FizzyFacepunch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ private void Awake()

private void LateUpdate()
{
SteamClient.RunCallbacks();
activeNode?.ReceiveData();
if (enabled)
{
SteamClient.RunCallbacks();
activeNode?.ReceiveData();
}
}

public override bool ClientConnected() => ClientActive() && client.Connected;
Expand Down

0 comments on commit ec84968

Please sign in to comment.