/// <summary> /// connect host mode /// </summary> public static void ConnectLocalServer() { // call server OnConnected with server's connection to client NetworkServer.OnConnected(NetworkServer.localConnection); // call client OnConnected with client's connection to server // => previously we used to send a ConnectMessage to // NetworkServer.localConnection. this would queue the message // until NetworkClient.Update processes it. // => invoking the client's OnConnected event directly here makes // tests fail. so let's do it exactly the same order as before by // queueing the event for next Update! //OnConnectedEvent?.Invoke(connection); ((ULocalConnectionToServer)connection).QueueConnectedEvent(); }
/// <summary> /// connect host mode /// </summary> public static void ConnectLocalServer() { NetworkServer.OnConnected(NetworkServer.localConnection); NetworkServer.localConnection.Send(new ConnectMessage()); }
/// <summary> /// connect host mode /// </summary> internal void ConnectLocalServer(NetworkServer server) { server.OnConnected(server.localConnection); server.localConnection.Send(new ConnectMessage()); }