Skip to content

Commit

Permalink
fix(Telepathy): Implement OnServerConnectedWithAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGadget1024 committed Jul 20, 2024
1 parent 2379422 commit 9dcc6a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Assets/Mirror/Transports/Telepathy/Telepathy/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Server : Common
{
// events to hook into
// => OnData uses ArraySegment for allocation free receives later
public Action<int> OnConnected;
public Action<int, string> OnConnected;
public Action<int, ArraySegment<byte>> OnData;
public Action<int> OnDisconnected;

Expand Down Expand Up @@ -388,7 +388,7 @@ public int Tick(int processLimit, Func<bool> checkEnabled = null)
switch (eventType)
{
case EventType.Connected:
OnConnected?.Invoke(connectionId);
OnConnected?.Invoke(connectionId, GetClientAddress(connectionId));
break;
case EventType.Data:
OnData?.Invoke(connectionId, message);
Expand Down
2 changes: 1 addition & 1 deletion Assets/Mirror/Transports/Telepathy/TelepathyTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public override void ServerStart()
// system's hook (e.g. statistics OnData) was added is to wrap
// them all in a lambda and always call the latest hook.
// (= lazy call)
server.OnConnected = (connectionId) => OnServerConnected.Invoke(connectionId);
server.OnConnected = (connectionId, remoteClientAddress) => OnServerConnectedWithAddress.Invoke(connectionId, remoteClientAddress);
server.OnData = (connectionId, segment) => OnServerDataReceived.Invoke(connectionId, segment, Channels.Reliable);
server.OnDisconnected = (connectionId) => OnServerDisconnected.Invoke(connectionId);

Expand Down

0 comments on commit 9dcc6a0

Please sign in to comment.