public static void S_BroadCastLeaveGameHandler(PacketSession sesion, IPacket packet)
    {
        S_BroadCastLeaveGame Leavepacket   = packet as S_BroadCastLeaveGame;
        ServerSession        serverSession = sesion as ServerSession;

        PlayerManager.Instance.LeaveGame(Leavepacket);
    }
        public void Leave(ClientSession session)
        {
            _sessions.Remove(session);

            S_BroadCastLeaveGame leave = new S_BroadCastLeaveGame();

            leave.playerId = session.SessionId;
            BroadCast(leave.Write());
        }
Beispiel #3
0
 public void LeaveGame(S_BroadCastLeaveGame packet)
 {
     if (_Myplayer.PlayerID == packet.playerId)
     {
         GameObject.Destroy(_Myplayer.gameObject);
         _Myplayer = null;
     }
     else
     {
         Player player = null;
         if (_dic_Players.TryGetValue(packet.playerId, out player))
         {
             GameObject.Destroy(player.gameObject);
             _dic_Players.Remove(packet.playerId);
         }
     }
 }
Beispiel #4
0
 public static void S_BroadCastLeaveGameHandler(PacketSession sesion, IPacket packet)
 {
     S_BroadCastLeaveGame Leavepacket   = packet as S_BroadCastLeaveGame;
     ServerSession        serverSession = sesion as ServerSession;
 }