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); }
private CommandReplay GenerateCommandReplay(PokerCommand command) { var list = _gameProvider.GetAllPlayers(); CommandReplay commandReplay = new CommandReplay(); commandReplay.Command = command; commandReplay.Players.AddRange(list); return(commandReplay); }
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); } }
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; } } }
public void SetCommand(PokerCommand command) => _pokerCommand = command;
public void ClearCommand() { LogHelper.DebugLog("Poker clear command"); CurrentCommand = PokerCommand.None; Time = 0; }
public void SetCommand(PokerCommand command) { LogHelper.DebugLog("Poker set command:" + command); CurrentCommand = command; Time = 0; }