Пример #1
0
        /// <summary>
        /// Called when a client disconnected from the server
        /// </summary>
        /// <param name="peer">disconnected peer</param>
        /// <param name="disconnectInfo"></param>
        private void OnPeerDisconnectedEvent(NetPeer peer, DisconnectInfo disconnectInfo)
        {
            Console.WriteLine("PLAYER {0} DISCONNECTED. INFO: {1}", peer.EndPoint.ToString(), disconnectInfo.Reason);
            //Remove Player from PM
            PlayerLeftEventArgs args2 = new PlayerLeftEventArgs();

            args2.NetPeer = peer;
            OnPlayerLeft(args2);
        }
Пример #2
0
 protected virtual void OnPlayerLeft(PlayerLeftEventArgs e)
 {
     PlayerLeft?.Invoke(this, e);
 }