Exemple #1
0
 public override void OnTick(SpaRoom room)
 {
     try
     {
         if (room != null)
         {
             room.KickAllPlayer();
             using (PlayerBussiness db = new PlayerBussiness())
             {
                 db.DisposeSpaRoomInfo(room.Spa_Room_Info.RoomID);
             }
             SpaRoomMgr.RemoveSpaRoom(room);
             GSPacketIn pkg = new GSPacketIn(174);
             pkg.WriteInt(room.Spa_Room_Info.RoomID);
             WorldMgr.SpaScene.SendToALL(pkg);
             room.StopTimer();
         }
     }
     catch (Exception ex)
     {
         //if (SpaLogicProcessor.log.IsErrorEnabled)
         {
             SpaLogicProcessor.log.Error("OnTick", ex);
         }
     }
 }
Exemple #2
0
        public GSPacketIn SendSpaRoomInfoUpdateToSpaScenePlayers(SpaRoom room)
        {
            GSPacketIn pkg = new GSPacketIn(173);

            pkg.WriteInt(room.Spa_Room_Info.RoomNumber);
            pkg.WriteInt(room.Spa_Room_Info.RoomID);
            pkg.WriteString(room.Spa_Room_Info.RoomName);
            pkg.WriteString(room.Spa_Room_Info.Pwd);
            pkg.WriteInt(room.RoomLeftMin);
            pkg.WriteInt(room.Count);
            pkg.WriteInt(room.Spa_Room_Info.PlayerID);
            pkg.WriteString(room.Spa_Room_Info.PlayerName);
            pkg.WriteDateTime(room.Spa_Room_Info.BeginTime);
            pkg.WriteString(room.Spa_Room_Info.RoomIntroduction);
            pkg.WriteInt(room.Spa_Room_Info.RoomType);
            pkg.WriteInt(room.Spa_Room_Info.MaxCount);
            this.SendToScenePlayer(pkg);
            return(pkg);
        }
Exemple #3
0
        public override void OnGameData(SpaRoom room, GamePlayer player, GSPacketIn packet)
        {
            SpaCmdType type = (SpaCmdType)packet.ReadByte();

            try
            {
                ISpaCommandHandler handleCommand = this._commandMgr.LoadCommandHandler((int)type);
                if (handleCommand != null)
                {
                    handleCommand.HandleCommand(player, packet);
                }
                else
                {
                    SpaLogicProcessor.log.Error(string.Format("IP: {0}", player.Client.TcpEndpoint));
                }
            }
            catch (Exception e)
            {
                SpaLogicProcessor.log.Error(string.Format("IP:{1}, OnGameData is Error: {0}", e.ToString(), player.Client.TcpEndpoint));
            }
        }
Exemple #4
0
 public virtual void OnGameData(SpaRoom game, GamePlayer player, GSPacketIn packet)
 {
 }
Exemple #5
0
 public virtual void OnTick(SpaRoom room)
 {
 }