Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0071c3a

Browse files
author
FirstGearGames
committedFeb 19, 2022
1.5.0
- FishNetworking 1.3.1 Multipass transport support.
1 parent 81bfaaa commit 0071c3a

File tree

7 files changed

+16
-27
lines changed

7 files changed

+16
-27
lines changed
 

‎FishNet/Plugins/FishySteamworks/CHANGELOG.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
1.5.0
2+
- FishNetworking 1.3.1 Multipass transport support.
3+
14
1.4.4
25
- Removed obsolete method.
36

‎FishNet/Plugins/FishySteamworks/Core/ClientHostSocket.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ internal void IterateIncoming()
9595
while (_incoming.TryDequeue(out LocalPacket packet))
9696
{
9797
ArraySegment<byte> segment = new ArraySegment<byte>(packet.Data, 0, packet.Length);
98-
base.Transport.HandleClientReceivedDataArgs(new ClientReceivedDataArgs(segment, (Channel)packet.Channel));
98+
base.Transport.HandleClientReceivedDataArgs(new ClientReceivedDataArgs(segment, (Channel)packet.Channel, Transport.Index));
9999
ByteArrayPool.Store(packet.Data);
100100
}
101101
}

‎FishNet/Plugins/FishySteamworks/Core/ClientSocket.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ internal void IterateIncoming()
184184
for (int i = 0; i < messageCount; i++)
185185
{
186186
base.GetMessage(base.MessagePointers[i], InboundBuffer, out ArraySegment<byte> segment, out byte channel);
187-
base.Transport.HandleClientReceivedDataArgs(new ClientReceivedDataArgs(segment, (Channel)channel));
187+
base.Transport.HandleClientReceivedDataArgs(new ClientReceivedDataArgs(segment, (Channel)channel, Transport.Index));
188188
}
189189
}
190190
}

‎FishNet/Plugins/FishySteamworks/Core/CommonSocket.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ protected virtual void SetLocalConnectionState(LocalConnectionStates connectionS
3939
_connectionState = connectionState;
4040

4141
if (server)
42-
Transport.HandleServerConnectionState(new ServerConnectionStateArgs(connectionState));
42+
Transport.HandleServerConnectionState(new ServerConnectionStateArgs(connectionState, Transport.Index));
4343
else
44-
Transport.HandleClientConnectionState(new ClientConnectionStateArgs(connectionState));
44+
Transport.HandleClientConnectionState(new ClientConnectionStateArgs(connectionState, Transport.Index));
4545
}
4646
#endregion
4747

‎FishNet/Plugins/FishySteamworks/Core/ServerSocket.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private bool StopConnection(int connectionId, HSteamNetConnection socket)
221221
_steamIds.Remove(connectionId);
222222
if (base.Transport.NetworkManager.CanLog(LoggingType.Common))
223223
Debug.Log($"Client with ConnectionID {connectionId} disconnected.");
224-
base.Transport.HandleRemoteConnectionState(new RemoteConnectionStateArgs(RemoteConnectionStates.Stopped, connectionId));
224+
base.Transport.HandleRemoteConnectionState(new RemoteConnectionStateArgs(RemoteConnectionStates.Stopped, connectionId, Transport.Index));
225225
_cachedConnectionIds.Enqueue(connectionId);
226226

227227
return true;
@@ -272,7 +272,7 @@ private void OnRemoteConnectionState(SteamNetConnectionStatusChangedCallback_t a
272272

273273
if (base.Transport.NetworkManager.CanLog(LoggingType.Common))
274274
Debug.Log($"Client with SteamID {clientSteamID} connected. Assigning connection id {connectionId}");
275-
base.Transport.HandleRemoteConnectionState(new RemoteConnectionStateArgs(RemoteConnectionStates.Started, connectionId));
275+
base.Transport.HandleRemoteConnectionState(new RemoteConnectionStateArgs(RemoteConnectionStates.Started, connectionId, Transport.Index));
276276
}
277277
else if (args.m_info.m_eState == ESteamNetworkingConnectionState.k_ESteamNetworkingConnectionState_ClosedByPeer || args.m_info.m_eState == ESteamNetworkingConnectionState.k_ESteamNetworkingConnectionState_ProblemDetectedLocally)
278278
{
@@ -321,7 +321,7 @@ internal void IterateIncoming()
321321
while (_clientHostIncoming.TryDequeue(out LocalPacket packet))
322322
{
323323
ArraySegment<byte> segment = new ArraySegment<byte>(packet.Data, 0, packet.Length);
324-
base.Transport.HandleServerReceivedDataArgs(new ServerReceivedDataArgs(segment, (Channel)packet.Channel, FishySteamworks.CLIENT_HOST_ID));
324+
base.Transport.HandleServerReceivedDataArgs(new ServerReceivedDataArgs(segment, (Channel)packet.Channel, FishySteamworks.CLIENT_HOST_ID, Transport.Index));
325325
}
326326

327327
foreach (KeyValuePair<HSteamNetConnection, int> item in _steamConnections.First)
@@ -340,7 +340,7 @@ internal void IterateIncoming()
340340
for (int i = 0; i < messageCount; i++)
341341
{
342342
base.GetMessage(base.MessagePointers[i], InboundBuffer, out ArraySegment<byte> segment, out byte channel);
343-
base.Transport.HandleServerReceivedDataArgs(new ServerReceivedDataArgs(segment, (Channel)channel, connectionId));
343+
base.Transport.HandleServerReceivedDataArgs(new ServerReceivedDataArgs(segment, (Channel)channel, connectionId, Transport.Index));
344344
}
345345
}
346346
}
@@ -445,11 +445,11 @@ internal void OnClientHostState(bool started)
445445
if (!started)
446446
{
447447
while (_clientHostIncoming.TryDequeue(out _)) ;
448-
base.Transport.HandleRemoteConnectionState(new RemoteConnectionStateArgs(RemoteConnectionStates.Stopped, FishySteamworks.CLIENT_HOST_ID));
448+
base.Transport.HandleRemoteConnectionState(new RemoteConnectionStateArgs(RemoteConnectionStates.Stopped, FishySteamworks.CLIENT_HOST_ID, Transport.Index));
449449
}
450450
else
451451
{
452-
base.Transport.HandleRemoteConnectionState(new RemoteConnectionStateArgs(RemoteConnectionStates.Started, FishySteamworks.CLIENT_HOST_ID));
452+
base.Transport.HandleRemoteConnectionState(new RemoteConnectionStateArgs(RemoteConnectionStates.Started, FishySteamworks.CLIENT_HOST_ID, Transport.Index));
453453
}
454454

455455

‎FishNet/Plugins/FishySteamworks/FishySteamworks.cs

+2-16
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ public class FishySteamworks : Transport
8585
internal const int CLIENT_HOST_ID = short.MaxValue;
8686
#endregion
8787

88-
public override void Initialize(NetworkManager networkManager)
88+
public override void Initialize(NetworkManager networkManager, int transportIndex)
8989
{
90-
base.Initialize(networkManager);
90+
base.Initialize(networkManager, transportIndex);
9191

9292
_client = new Client.ClientSocket();
9393
_clientHost = new Client.ClientHostSocket();
@@ -558,20 +558,6 @@ private bool StopClient(int connectionId, bool immediately)
558558

559559
#region Channels.
560560
/// <summary>
561-
/// Returns which channel to use by default for reliable.
562-
/// </summary>
563-
public override byte GetDefaultReliableChannel()
564-
{
565-
return 0;
566-
}
567-
/// <summary>
568-
/// Returns which channel to use by default for unreliable.
569-
/// </summary>
570-
public override byte GetDefaultUnreliableChannel()
571-
{
572-
return 1;
573-
}
574-
/// <summary>
575561
/// Gets the MTU for a channel. This should take header size into consideration.
576562
/// For example, if MTU is 1200 and a packet header for this channel is 10 in size, this method should return 1190.
577563
/// </summary>
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.4
1+
1.5.0

0 commit comments

Comments
 (0)
Please sign in to comment.