예제 #1
0
    public override void OnStopServer()
    {
        OnServerStopped?.Invoke();

        RoomPlayers.Clear();
        GamePlayers.Clear();
    }
예제 #2
0
        public void closeConnection()
        {
            client.Close();
            server.Stop();

            OnServerStopped.Invoke(this, new ServerEventArgs("Server stopped."));
        }
예제 #3
0
    //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();
    }
예제 #4
0
    public override void OnStopServer()
    {
        //Serveri sammutetaan Huone tyhjennetään
        OnServerStopped?.Invoke();

        RoomPlayers.Clear();
        GamePlayers.Clear();
    }
예제 #5
0
 /// <summary>Stops the server</summary>
 public void Stop()
 {
     Clients = new Dictionary <int, Client>();
     _tcpListener.Stop();
     UdpListener.Close();
     IsRunning = false;
     OnServerStopped?.Invoke(this, new EventArgs());
 }
예제 #6
0
    public override void OnStopServer()
    {
        OnServerStopped?.Invoke();

        RoomPlayers.Clear();
        GamePlayers.Clear();

        ServerChangeScene(menuScene);
    }
예제 #7
0
 private void OnWsServerStopped(object sender, ServerStateEventArgs e)
 {
     if (OnServerStopped == null)
     {
         _logger?.LogDebug("WebSocket session [{id}] has stop!", e.Id);
     }
     else
     {
         OnServerStopped?.Invoke(sender, e);
     }
 }
예제 #8
0
 private void SetIsRunning(bool run = true)
 {
     m_isRunning = run;
     if (run)
     {
         OnServerStarted?.Invoke();
     }
     else
     {
         OnServerStopped?.Invoke();
     }
 }
예제 #9
0
        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;
            }
        }
예제 #10
0
 /// <summary>
 /// When server stops completely.
 /// </summary>
 /// <param name="server"></param>
 private void ServerStopped(NetworkServer server)
 {
     _isActive = false;
     OnServerStopped?.Invoke(server);
 }
예제 #11
0
 //send event upward
 private void Server_OnServerStopped(object sender, ServerEventArgs e)
 {
     OnServerStopped.Invoke(this, new SimulatorEventArgs(e.Message));
 }
예제 #12
0
 /// <summary>
 ///     Handle server stopped notification
 /// </summary>
 protected virtual void OnStopped()
 {
     OnServerStopped?.Invoke(this, new ServerStateEventArgs(Id));
 }
예제 #13
0
 private void ServerStop()
 {
     OnServerStopped?.Invoke();
 }
예제 #14
0
 protected void OnServerStop(NetworkServer server)
 => OnServerStopped?.Invoke(server);
예제 #15
0
 public void DoServerStopped()
 {
     OnServerStopped?.Invoke(this, EventArgs.Empty);
 }