mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix(SimpleWebTransport): Implement OnServerConnectedWithAddress
This commit is contained in:
parent
c82ae00ef7
commit
237942274d
@ -6,7 +6,7 @@ namespace Mirror.SimpleWeb
|
||||
{
|
||||
public class SimpleWebServer
|
||||
{
|
||||
public event Action<int> onConnect;
|
||||
public event Action<int, string> onConnect;
|
||||
public event Action<int> onDisconnect;
|
||||
public event Action<int, ArraySegment<byte>> onData;
|
||||
public event Action<int, Exception> onError;
|
||||
@ -91,7 +91,7 @@ public void ProcessMessageQueue(MonoBehaviour behaviour)
|
||||
switch (next.type)
|
||||
{
|
||||
case EventType.Connected:
|
||||
onConnect?.Invoke(next.connId);
|
||||
onConnect?.Invoke(next.connId, GetClientAddress(next.connId));
|
||||
break;
|
||||
case EventType.Data:
|
||||
onData?.Invoke(next.connId, next.data.ToSegment());
|
||||
|
@ -300,7 +300,7 @@ public override void ServerStart()
|
||||
SslConfig config = SslConfigLoader.Load(sslEnabled, sslCertJson, sslProtocols);
|
||||
server = new SimpleWebServer(serverMaxMsgsPerTick, TcpConfig, maxMessageSize, maxHandshakeSize, config);
|
||||
|
||||
server.onConnect += OnServerConnected.Invoke;
|
||||
server.onConnect += OnServerConnectedWithAddress.Invoke;
|
||||
server.onDisconnect += OnServerDisconnected.Invoke;
|
||||
server.onData += (int connId, ArraySegment<byte> data) => OnServerDataReceived.Invoke(connId, data, Channels.Reliable);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user