mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
NetworkServer.OnConnected: call AddConnection in here too, instead of manually doing it from AddLocalClient and OnConnected
This commit is contained in:
parent
fd561db9c2
commit
9957cbc3b5
@ -141,7 +141,6 @@ internal static int AddLocalClient(LocalClient localClient)
|
||||
{
|
||||
connectionId = 0
|
||||
};
|
||||
AddConnection(s_LocalConnection);
|
||||
OnConnected(s_LocalConnection);
|
||||
return 0;
|
||||
}
|
||||
@ -323,7 +322,6 @@ static void OnConnected(int connectionId)
|
||||
|
||||
// add player info
|
||||
NetworkConnection conn = new NetworkConnection(address, serverHostId, connectionId);
|
||||
AddConnection(conn);
|
||||
OnConnected(conn);
|
||||
}
|
||||
else
|
||||
@ -337,6 +335,9 @@ static void OnConnected(int connectionId)
|
||||
static void OnConnected(NetworkConnection conn)
|
||||
{
|
||||
if (LogFilter.Debug) { Debug.Log("Server accepted client:" + conn.connectionId); }
|
||||
|
||||
// add connection and invoke connected event
|
||||
AddConnection(conn);
|
||||
conn.InvokeHandlerNoData((short)MsgType.Connect);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user