private void OnPeerConnected(NetPeer peer) { Log.Info($"Client connected ID: {peer.Id}, {peer.EndPoint}"); NebulaConnection conn = new NebulaConnection(peer, PacketProcessor); PlayerManager.PlayerConnected(conn); }
protected override void OnOpen() { if (SimulatedWorld.IsGameLoaded == false) { // Reject any connection that occurs while the host's game is loading. this.Context.WebSocket.Close((ushort)DisconnectionReason.HostStillLoading, "Host still loading, please try again later."); return; } NebulaModel.Logger.Log.Info($"Client connected ID: {ID}, {Context.UserEndPoint}"); NebulaConnection conn = new NebulaConnection(Context.WebSocket, Context.UserEndPoint, packetProcessor); playerManager.PlayerConnected(conn); }