Skip to content

Commit

Permalink
Message Size fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Chykary committed Jun 3, 2021
1 parent a40c24c commit 3e53022
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions FizzySteamworks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public override void ClientConnect(Uri uri)
ClientConnect(uri.Host);
}

public override void ClientSend(int channelId, ArraySegment<byte> segment)
public override void ClientSend(ArraySegment<byte> segment, int channelId)
{
byte[] data = new byte[segment.Count];
Array.Copy(segment.Array, segment.Offset, data, 0, segment.Count);
Expand Down Expand Up @@ -198,7 +198,7 @@ public override Uri ServerUri()
return steamBuilder.Uri;
}

public override void ServerSend(int connectionId, int channelId, ArraySegment<byte> segment)
public override void ServerSend(int connectionId, ArraySegment<byte> segment, int channelId)
{
if (ServerActive())
{
Expand Down Expand Up @@ -242,22 +242,29 @@ public override void Shutdown()

public override int GetMaxPacketSize(int channelId)
{
if (channelId >= Channels.Length)
if (UseNextGenSteamNetworking)
{
Debug.LogError("Channel Id exceeded configured channels! Please configure more channels.");
return 1200;
return Constants.k_cbMaxSteamNetworkingSocketsMessageSizeSend;
}

switch (Channels[channelId])
else
{
case EP2PSend.k_EP2PSendUnreliable:
case EP2PSend.k_EP2PSendUnreliableNoDelay:
if (channelId >= Channels.Length)
{
Debug.LogError("Channel Id exceeded configured channels! Please configure more channels.");
return 1200;
case EP2PSend.k_EP2PSendReliable:
case EP2PSend.k_EP2PSendReliableWithBuffering:
return 1048576;
default:
throw new NotSupportedException();
}

switch (Channels[channelId])
{
case EP2PSend.k_EP2PSendUnreliable:
case EP2PSend.k_EP2PSendUnreliableNoDelay:
return 1200;
case EP2PSend.k_EP2PSendReliable:
case EP2PSend.k_EP2PSendReliableWithBuffering:
return 1048576;
default:
throw new NotSupportedException();
}
}
}

Expand Down

0 comments on commit 3e53022

Please sign in to comment.