Example #1
0
 public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
 {
     if (game is PVEGame)
     {
         PVEGame pve      = game as PVEGame;
         bool    tryAgain = packet.ReadBoolean();
         bool    isHost   = packet.ReadBoolean();
         if (isHost)
         {
             if (tryAgain)
             {
                 if (player.PlayerDetail.RemoveMoney(500, LogMoneyType.Game, LogMoneyType.Game_TryAgain) > 0)
                 {
                     pve.WantTryAgain = 1;
                     game.SendToAll(packet);
                 }
                 else
                 {
                     player.PlayerDetail.SendInsufficientMoney(2);
                 }
             }
             else
             {
                 pve.WantTryAgain = 0;
                 game.SendToAll(packet);
             }
             pve.CheckState(0);
         }
     }
 }
Example #2
0
 public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
 {
     if (game is PVEGame)
     {
         PVEGame pve      = game as PVEGame;
         bool    tryAgain = packet.ReadBoolean();
         bool    isHost   = packet.ReadBoolean();
         if (isHost == true)
         {
             if (tryAgain == true)
             {
                 if (player.PlayerDetail.RemoveMoney(100) > 0)
                 {
                     //退回关卡结算
                     pve.WantTryAgain = 1;
                     game.SendToAll(packet);
                     player.PlayerDetail.LogAddMoney(AddMoneyType.Game, AddMoneyType.Game_TryAgain, player.PlayerDetail.PlayerCharacter.ID, 100, player.PlayerDetail.PlayerCharacter.Money);
                 }
                 else
                 {
                     player.PlayerDetail.SendInsufficientMoney((int)eBattleRemoveMoneyType.TryAgain);
                 }
             }
             else
             {
                 //退回房间
                 pve.WantTryAgain = 0;
                 game.SendToAll(packet);
             }
             pve.CheckState(0);
         }
     }
 }
 public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
 {
     if (game is PVEGame)
     {
         PVEGame pVEGame = game as PVEGame;
         int     num     = packet.ReadInt();
         bool    flag    = packet.ReadBoolean();
         if (flag)
         {
             if (num == 1)
             {
                 if (player.PlayerDetail.RemoveMoney(100) > 0)
                 {
                     pVEGame.WantTryAgain = 1;
                     game.SendToAll(packet);
                     player.PlayerDetail.LogAddMoney(AddMoneyType.Game, AddMoneyType.Game_TryAgain, player.PlayerDetail.PlayerCharacter.ID, 100, player.PlayerDetail.PlayerCharacter.Money);
                 }
                 else
                 {
                     player.PlayerDetail.SendInsufficientMoney(2);
                 }
             }
             else
             {
                 pVEGame.WantTryAgain = 0;
                 game.SendToAll(packet);
             }
             pVEGame.CheckState(0);
         }
     }
 }
Example #4
0
 public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
 {
     if (game is PVEGame && game.GameState != eGameState.Playing)
     {
         PVEGame pveGame = game as PVEGame;
         pveGame.IsPassDrama = packet.ReadBoolean();
         pveGame.CheckState(0);
     }
 }