public override void OnStopServer() { OnServerStopped?.Invoke(); RoomPlayers.Clear(); GamePlayers.Clear(); }
public void closeConnection() { client.Close(); server.Stop(); OnServerStopped.Invoke(this, new ServerEventArgs("Server stopped.")); }
//When server/host is stopped //Perhaps when a delete room button is clicked? Which will result in kicking every one out of the room public override void OnStopServer() { OnServerStopped?.Invoke(); RoomPlayers.Clear(); //Clear the list of existing players, ready for a new game GamePlayers.Clear(); }
public override void OnStopServer() { //Serveri sammutetaan Huone tyhjennetään OnServerStopped?.Invoke(); RoomPlayers.Clear(); GamePlayers.Clear(); }
/// <summary>Stops the server</summary> public void Stop() { Clients = new Dictionary <int, Client>(); _tcpListener.Stop(); UdpListener.Close(); IsRunning = false; OnServerStopped?.Invoke(this, new EventArgs()); }
public override void OnStopServer() { OnServerStopped?.Invoke(); RoomPlayers.Clear(); GamePlayers.Clear(); ServerChangeScene(menuScene); }
private void OnWsServerStopped(object sender, ServerStateEventArgs e) { if (OnServerStopped == null) { _logger?.LogDebug("WebSocket session [{id}] has stop!", e.Id); } else { OnServerStopped?.Invoke(sender, e); } }
private void SetIsRunning(bool run = true) { m_isRunning = run; if (run) { OnServerStarted?.Invoke(); } else { OnServerStopped?.Invoke(); } }
void ProcessNetworkEvent(NetworkEvent e) { switch (e.Type) { case NetEventType.ServerInitialized: OnServerStartSuccess?.Invoke(e); break; case NetEventType.ServerInitFailed: OnServerStartFailure?.Invoke(e); break; // Received after network.StopServer case NetEventType.ServerClosed: OnServerStopped?.Invoke(e); break; case NetEventType.NewConnection: OnNewConnection?.Invoke(e); break; case NetEventType.ConnectionFailed: OnConnectionFailed?.Invoke(e); break; case NetEventType.Disconnected: OnDisconnection?.Invoke(e); break; case NetEventType.ReliableMessageReceived: OnMessageReceived?.Invoke(e, true); break; case NetEventType.UnreliableMessageReceived: OnMessageReceived?.Invoke(e, false); break; } }
/// <summary> /// When server stops completely. /// </summary> /// <param name="server"></param> private void ServerStopped(NetworkServer server) { _isActive = false; OnServerStopped?.Invoke(server); }
//send event upward private void Server_OnServerStopped(object sender, ServerEventArgs e) { OnServerStopped.Invoke(this, new SimulatorEventArgs(e.Message)); }
/// <summary> /// Handle server stopped notification /// </summary> protected virtual void OnStopped() { OnServerStopped?.Invoke(this, new ServerStateEventArgs(Id)); }
private void ServerStop() { OnServerStopped?.Invoke(); }
protected void OnServerStop(NetworkServer server) => OnServerStopped?.Invoke(server);
public void DoServerStopped() { OnServerStopped?.Invoke(this, EventArgs.Empty); }