Ejemplo n.º 1
0
        public static void SendToClient(PokerCommand command, PokerBattle battle)
        {
            battle.Step = command;
            LemonMessage msg = new LemonMessage();

            msg.Body = new JsonSerialize().SerializeToString(battle);
            SendMsgToAllClient(command, battle, msg);
        }
Ejemplo n.º 2
0
        private CommandReplay GenerateCommandReplay(PokerCommand command)
        {
            var list = _gameProvider.GetAllPlayers();

            CommandReplay commandReplay = new CommandReplay();

            commandReplay.Command = command;
            commandReplay.Players.AddRange(list);

            return(commandReplay);
        }
Ejemplo n.º 3
0
        public static void SendMsgToAllClient(PokerCommand command, PokerBattle battle, LemonMessage msg)
        {
            SocketServer socketServer = PokerServer.Instance.GetServer();

            foreach (var c in socketServer.AllConnect())
            {
                if (!battle.Sides.Any(s => s.AccountID == c.ConnectID))
                {
                    continue;
                }
                try
                {
                    c.SendMessage(msg);
                }
                catch (Exception ex)
                {
                    LogHelper.LogError("Poker发送出错:" + ex.Message + " " + ex.StackTrace);
                }
                LogHelper.DebugLog("Poker send " + command);
            }
        }
Ejemplo n.º 4
0
        private void PostCommandVisualFixes(PokerCommand pokerCommand)
        {
            if (PokerHand == null)
            {
                return;
            }

            if (pokerCommand == null)
            {
                return;
            }

            if (pokerCommand is PokerCommands.Fold)
            {
                var fold = pokerCommand as PokerCommands.Fold;
                if (fold.FoldAndShow)
                {
                    SetPlayerCards(MapToPreferredSeat(fold.Player.SeatNumber), fold.Player.PocketCards);
                    _ucReplayerPlayers[MapToPreferredSeat(fold.Player.SeatNumber)].Image_Card0.Visibility = Visibility.Visible;
                    _ucReplayerPlayers[MapToPreferredSeat(fold.Player.SeatNumber)].Image_Card1.Visibility = Visibility.Visible;
                }
            }
        }
Ejemplo n.º 5
0
 public void SetCommand(PokerCommand command) => _pokerCommand = command;
Ejemplo n.º 6
0
 public void ClearCommand()
 {
     LogHelper.DebugLog("Poker clear command");
     CurrentCommand = PokerCommand.None;
     Time           = 0;
 }
Ejemplo n.º 7
0
 public void SetCommand(PokerCommand command)
 {
     LogHelper.DebugLog("Poker set command:" + command);
     CurrentCommand = command;
     Time           = 0;
 }