Console client: Output similar to PokerTH log.

This commit is contained in:
lotodore
2008-12-24 23:22:23 +00:00
parent 60fd3e2010
commit 6797fa3f54
11 changed files with 404 additions and 112 deletions
+43 -25
View File
@@ -48,53 +48,71 @@ namespace pokerth_console
Console.WriteLine("Game was started. Players: {0}.", outPlayers); Console.WriteLine("Game was started. Players: {0}.", outPlayers);
} }
public void HandStarted(pokerth_lib.Hand h) public void HandStarted(int[] cards)
{ {
Console.WriteLine("New hand. Your cards: {0} {1}. Your money: {2}.", Console.WriteLine("\nNew hand. Your cards: {0}, {1}.",
Log.CardToString(h.Players[h.MyPlayerId].Cards[0]), Log.CardToString(cards[0]),
Log.CardToString(h.Players[h.MyPlayerId].Cards[1]), Log.CardToString(cards[1]));
h.Players[h.MyPlayerId].Money);
} }
public void MyTurn(Hand.State state) public void SmallBlind(string name, uint blind)
{ {
Console.WriteLine("--> {0}: Your turn.", Console.WriteLine("{0} posts small blind (${1}).", name, blind);
Log.StateToString(state)); }
public void BigBlind(string name, uint blind)
{
Console.WriteLine("{0} posts big blind (${1}).", name, blind);
}
public void MyTurn(Hand.State state, uint highestSet, uint minimumRaise, uint money)
{
Console.WriteLine("\n--> {0}: Your turn. Highest set: ${1}. Minimum raise: ${2}. Cash: ${3}.",
Log.StateToString(state), highestSet, minimumRaise, money);
} }
public void PlayersTurn(Hand.State state, string player) public void PlayersTurn(Hand.State state, string player)
{ {
Console.WriteLine("{0}: {1}'s turn.", Console.WriteLine("\n{0}: {1}'s turn.",
Log.StateToString(state), Log.StateToString(state),
player); player);
} }
public void ActionDone(string name, Hand.Action action, uint totalBet, uint money, uint highestSet, uint minimumRaise) public void ActionDone(string name, Hand.Action action, uint curBet)
{ {
Console.WriteLine("{0} acts: {1}. Total bet: {2}. Money left: {3}.", Console.WriteLine("{0} {1}.", name, Log.ActionToString(action, curBet));
name, Log.ActionToString(action), totalBet, money);
Console.WriteLine("Highest set: {0}. Minimum raise: {1}.",
highestSet, minimumRaise);
} }
public void ShowFlopCards(int firstFlopCard, int secondFlopCard, int thirdFlopCard) public void ShowFlopCards(int[] cards)
{ {
Console.WriteLine("Flop cards: {0} {1} {2}.", Console.WriteLine("\n--- Flop --- [{0}, {1}, {2}]",
Log.CardToString(firstFlopCard), Log.CardToString(cards[0]),
Log.CardToString(secondFlopCard), Log.CardToString(cards[1]),
Log.CardToString(thirdFlopCard)); Log.CardToString(cards[2]));
} }
public void ShowTurnCard(int turnCard) public void ShowTurnCards(int[] cards)
{ {
Console.WriteLine("Turn card: {0}.", Console.WriteLine("\n--- Turn --- [{0}, {1}, {2}, {3}]",
Log.CardToString(turnCard)); Log.CardToString(cards[0]),
Log.CardToString(cards[1]),
Log.CardToString(cards[2]),
Log.CardToString(cards[3]));
} }
public void ShowRiverCard(int riverCard) public void ShowRiverCards(int[] cards)
{ {
Console.WriteLine("River card: {0}.", Console.WriteLine("\n--- River --- [{0}, {1}, {2}, {3}, {4}]",
Log.CardToString(riverCard)); Log.CardToString(cards[0]),
Log.CardToString(cards[1]),
Log.CardToString(cards[2]),
Log.CardToString(cards[3]),
Log.CardToString(cards[4]));
}
public void PlayerWinsHideCards(string name, uint moneyWon)
{
Console.WriteLine("\n{0} wins ${1}.", name, moneyWon);
} }
public void Error(string message) public void Error(string message)
+68 -2
View File
@@ -52,6 +52,7 @@ namespace pokerth_lib
m_state = State.Preflop; m_state = State.Preflop;
m_players = players; m_players = players;
m_myPlayerId = myPlayerId; m_myPlayerId = myPlayerId;
m_smallBlind = smallBlind;
} }
public State CurState public State CurState
@@ -85,12 +86,73 @@ namespace pokerth_lib
} }
public uint MyPlayerId public uint MyPlayerId
{
get
{
// no need to lock a mutex, this is read only.
return m_myPlayerId;
}
}
public uint SmallBlind
{
get
{
// no need to lock a mutex, this is read only.
return m_smallBlind;
}
}
public uint HighestSet
{ {
get get
{ {
lock (m_mutex) lock (m_mutex)
{ {
return m_myPlayerId; return m_highestSet;
}
}
set
{
lock (m_mutex)
{
m_highestSet = value;
}
}
}
public uint MinimumRaise
{
get
{
lock (m_mutex)
{
return m_minimumRaise;
}
}
set
{
lock (m_mutex)
{
m_minimumRaise = value;
}
}
}
public int[] TableCards
{
get
{
lock (m_mutex)
{
return (int[])m_tableCards.Clone();
}
}
set
{
lock (m_mutex)
{
m_tableCards = value;
} }
} }
} }
@@ -98,6 +160,10 @@ namespace pokerth_lib
private Object m_mutex; private Object m_mutex;
private State m_state; private State m_state;
private Dictionary<uint, Player> m_players; private Dictionary<uint, Player> m_players;
uint m_myPlayerId; private int[] m_tableCards;
private uint m_myPlayerId;
private uint m_smallBlind;
private uint m_highestSet;
private uint m_minimumRaise;
} }
} }
+9 -6
View File
@@ -28,13 +28,16 @@ namespace pokerth_lib
void InitDone(); void InitDone();
void JoinedGame(string name); void JoinedGame(string name);
void GameStarted(List<string> players); void GameStarted(List<string> players);
void HandStarted(Hand h); void HandStarted(int[] cards);
void MyTurn(Hand.State state); void SmallBlind(string name, uint blind);
void BigBlind(string name, uint blind);
void MyTurn(Hand.State state, uint highestSet, uint minimumRaise, uint money);
void PlayersTurn(Hand.State state, string player); void PlayersTurn(Hand.State state, string player);
void ActionDone(string name, Hand.Action action, uint totalBet, uint money, uint highestSet, uint minimumRaise); void ActionDone(string name, Hand.Action action, uint curBet);
void ShowFlopCards(int firstFlopCard, int secondFlopCard, int thirdFlopCard); void ShowFlopCards(int[] cards);
void ShowTurnCard(int turnCard); void ShowTurnCards(int[] cards);
void ShowRiverCard(int riverCard); void ShowRiverCards(int[] cards);
void PlayerWinsHideCards(string name, uint moneyWon);
void Error(string message); void Error(string message);
} }
} }
+14 -11
View File
@@ -1,5 +1,7 @@
/*************************************************************************** /***************************************************************************
* Copyright (C) 2008 by Lothar May * * Copyright (C) 2008 by Lothar May *
* Inspired by log.cpp of the PokerTH client which is *
* Copyright (C) 2006 by FThauer FHammer *
* * * *
* This file is part of pokerth_console. * * This file is part of pokerth_console. *
* pokerth_console is free software: you can redistribute it and/or * * pokerth_console is free software: you can redistribute it and/or *
@@ -123,37 +125,38 @@ namespace pokerth_lib
return stateString; return stateString;
} }
public static string ActionToString(Hand.Action action) public static string ActionToString(Hand.Action action, uint curSet)
{ {
string actionString; string actionString;
switch (action) switch (action)
{ {
case Hand.Action.None:
actionString = "None";
break;
case Hand.Action.Fold: case Hand.Action.Fold:
actionString = "Fold"; actionString = "folds";
break; break;
case Hand.Action.Check: case Hand.Action.Check:
actionString = "Check"; actionString = "checks";
break; break;
case Hand.Action.Call: case Hand.Action.Call:
actionString = "Call"; actionString = "calls";
break; break;
case Hand.Action.Bet: case Hand.Action.Bet:
actionString = "Bet"; actionString = "bets";
break; break;
case Hand.Action.Raise: case Hand.Action.Raise:
actionString = "Raise"; actionString = "bets";
break; break;
case Hand.Action.AllIn: case Hand.Action.AllIn:
actionString = "All in"; actionString = "is all in with";
break; break;
default : default :
actionString = "Unknown action"; actionString = "(invalid action)";
break; break;
} }
if ((int)action >= 3)
actionString += " $" + Convert.ToString(curSet);
return actionString; return actionString;
} }
} }
+10
View File
@@ -104,6 +104,16 @@ namespace pokerth_lib
} }
} }
public void NewHand()
{
lock (m_mutex)
{
m_cards = null;
m_curAction = Hand.Action.None;
m_totalBet = 0;
}
}
private Object m_mutex; private Object m_mutex;
private int[] m_cards; private int[] m_cards;
private Hand.Action m_curAction; private Hand.Action m_curAction;
+1
View File
@@ -45,5 +45,6 @@ namespace pokerth_lib
void VisitDealFlopCards(NetPacket p); void VisitDealFlopCards(NetPacket p);
void VisitDealTurnCard(NetPacket p); void VisitDealTurnCard(NetPacket p);
void VisitDealRiverCard(NetPacket p); void VisitDealRiverCard(NetPacket p);
void VisitEndOfHandHideCards(NetPacket p);
} }
} }
+71 -48
View File
@@ -136,6 +136,7 @@ namespace pokerth_lib
FlopThirdCard, FlopThirdCard,
TurnCard, TurnCard,
RiverCard, RiverCard,
MoneyWon,
} }
public enum ListPropType public enum ListPropType
@@ -144,6 +145,11 @@ namespace pokerth_lib
ManualBlindSlots, ManualBlindSlots,
} }
public enum RecordPropType
{
PlayerResult,
}
public static NetPacket Create(int type, int size, BinaryReader reader) public static NetPacket Create(int type, int size, BinaryReader reader)
{ {
NetPacket tmpPacket = null; NetPacket tmpPacket = null;
@@ -189,12 +195,76 @@ namespace pokerth_lib
case NetTypeDealRiverCard : case NetTypeDealRiverCard :
tmpPacket = new NetPacketDealRiverCard(size, reader); tmpPacket = new NetPacketDealRiverCard(size, reader);
break; break;
case NetTypeEndOfHandHideCards :
tmpPacket = new NetPacketEndOfHandHideCards(size, reader);
break;
default: default:
break; break;
} }
return tmpPacket; return tmpPacket;
} }
public NetPacket(int type)
{
m_type = type;
m_properties = new Dictionary<PropType, string>();
m_listProperties = new Dictionary<ListPropType, List<string>>();
m_recordProperties = new Dictionary<RecordPropType, List<Dictionary<PropType, string>>>();
}
public Dictionary<PropType, string> Properties
{
set
{
m_properties = value;
}
get
{
return m_properties;
}
}
public Dictionary<ListPropType, List<string>> ListProperties
{
set
{
m_listProperties = value;
}
get
{
return m_listProperties;
}
}
public Dictionary<RecordPropType, List<Dictionary<PropType, string>>> RecordProperties
{
set
{
m_recordProperties = value;
}
get
{
return m_recordProperties;
}
}
public int Type
{
get
{
return m_type;
}
}
public abstract void Accept(INetPacketVisitor visitor);
public abstract byte[] ToByteArray();
static protected int AddPadding(int size)
{
return ((((size) + 3) / 4) * 4);
}
protected void ScanGameInfoBlock(BinaryReader r) protected void ScanGameInfoBlock(BinaryReader r)
{ {
Properties.Add(PropType.MaxNumPlayers, Properties.Add(PropType.MaxNumPlayers,
@@ -258,56 +328,9 @@ namespace pokerth_lib
} }
} }
public NetPacket(int type)
{
m_type = type;
m_properties = new Dictionary<PropType, string>();
m_listProperties = new Dictionary<ListPropType, List<string>>();
}
public Dictionary<PropType, string> Properties
{
set
{
m_properties = value;
}
get
{
return m_properties;
}
}
public Dictionary<ListPropType, List<string>> ListProperties
{
set
{
m_listProperties = value;
}
get
{
return m_listProperties;
}
}
public int Type
{
get
{
return m_type;
}
}
public abstract void Accept(INetPacketVisitor visitor);
public abstract byte[] ToByteArray();
static protected int AddPadding(int size)
{
return ((((size) + 3) / 4) * 4);
}
private int m_type; private int m_type;
private Dictionary<PropType, string> m_properties; private Dictionary<PropType, string> m_properties;
private Dictionary<ListPropType, List<string>> m_listProperties; private Dictionary<ListPropType, List<string>> m_listProperties;
private Dictionary<RecordPropType, List<Dictionary<PropType, string>>> m_recordProperties;
} }
} }
@@ -0,0 +1,59 @@
/***************************************************************************
* Copyright (C) 2008 by Lothar May *
* *
* This file is part of pokerth_console. *
* pokerth_console is free software: you can redistribute it and/or *
* modify it under the terms of the GNU Affero General Public License *
* as published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version. *
* *
* pokerth_console is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the *
* GNU Affero General Public License along with pokerth_console. *
* If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.IO;
namespace pokerth_lib
{
class NetPacketEndOfHandHideCards : NetPacket
{
public NetPacketEndOfHandHideCards()
: base(NetPacket.NetTypeEndOfHandHideCards)
{
}
public NetPacketEndOfHandHideCards(int size, BinaryReader r)
: base(NetPacket.NetTypeEndOfHandHideCards)
{
if (size != 16)
throw new NetPacketException("NetPacketEndOfHandHideCards invalid size.");
Properties.Add(PropType.PlayerId,
Convert.ToString(IPAddress.NetworkToHostOrder((int)r.ReadUInt32())));
Properties.Add(PropType.MoneyWon,
Convert.ToString(IPAddress.NetworkToHostOrder((int)r.ReadUInt32())));
Properties.Add(PropType.PlayerMoney,
Convert.ToString(IPAddress.NetworkToHostOrder((int)r.ReadUInt32())));
}
public override void Accept(INetPacketVisitor visitor)
{
visitor.VisitEndOfHandHideCards(this);
}
public override byte[] ToByteArray()
{
throw new NotImplementedException();
}
}
}
@@ -0,0 +1,69 @@
/***************************************************************************
* Copyright (C) 2008 by Lothar May *
* *
* This file is part of pokerth_console. *
* pokerth_console is free software: you can redistribute it and/or *
* modify it under the terms of the GNU Affero General Public License *
* as published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version. *
* *
* pokerth_console is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the *
* GNU Affero General Public License along with pokerth_console. *
* If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.IO;
namespace pokerth_lib
{
class NetPacketEndOfHandShowCards : NetPacket
{
public NetPacketEndOfHandShowCards()
: base(NetPacket.NetTypeEndOfHandShowCards)
{
}
public NetPacketEndOfHandShowCards(int size, BinaryReader r)
: base(NetPacket.NetTypeEndOfHandShowCards)
{
if (size < 40)
throw new NetPacketException("NetPacketEndOfHandShowCards invalid size.");
int numPlayerResults = IPAddress.NetworkToHostOrder((short)r.ReadUInt16());
r.ReadUInt16(); //reserved
List<Dictionary<PropType, string>> tmpRecordList = new List<Dictionary<PropType, string>>();
for (int i = 0; i < numPlayerResults; i++)
{
Dictionary<PropType, string> tmpList = new Dictionary<PropType, string>();
tmpList.Add(PropType.PlayerId,
Convert.ToString(IPAddress.NetworkToHostOrder((int)r.ReadUInt32())));
tmpList.Add(PropType.FirstCard,
Convert.ToString(IPAddress.NetworkToHostOrder((short)r.ReadUInt16())));
tmpList.Add(PropType.SecondCard,
Convert.ToString(IPAddress.NetworkToHostOrder((short)r.ReadUInt16())));
}
RecordProperties.Add(RecordPropType.PlayerResult, tmpRecordList);
}
public override void Accept(INetPacketVisitor visitor)
{
visitor.VisitEndOfHandHideCards(this);
}
public override byte[] ToByteArray()
{
throw new NotImplementedException();
}
}
}
+1 -1
View File
@@ -43,7 +43,7 @@ namespace pokerth_lib
Convert.ToString(IPAddress.NetworkToHostOrder((int)r.ReadUInt32()))); Convert.ToString(IPAddress.NetworkToHostOrder((int)r.ReadUInt32())));
int curNumPlayers = IPAddress.NetworkToHostOrder((short)r.ReadUInt16()); int curNumPlayers = IPAddress.NetworkToHostOrder((short)r.ReadUInt16());
Properties.Add(PropType.CurNumPlayers, Convert.ToString(curNumPlayers)); Properties.Add(PropType.CurNumPlayers, Convert.ToString(curNumPlayers));
r.ReadBytes(2); // reserved r.ReadUInt16(); // reserved
// Read player ids. // Read player ids.
List<string> playerSlots = new List<string>(); List<string> playerSlots = new List<string>();
+59 -19
View File
@@ -150,17 +150,23 @@ namespace pokerth_lib
public void VisitHandStart(NetPacket p) public void VisitHandStart(NetPacket p)
{ {
// Reset players.
foreach (KeyValuePair<uint, Player> player in m_players)
player.Value.NewHand();
// Assign own cards.
int[] tmpCards = new int[2]; int[] tmpCards = new int[2];
tmpCards[0] = tmpCards[0] =
Convert.ToInt32(p.Properties[NetPacket.PropType.FirstCard]); Convert.ToInt32(p.Properties[NetPacket.PropType.FirstCard]);
tmpCards[1] = tmpCards[1] =
Convert.ToInt32(p.Properties[NetPacket.PropType.SecondCard]); Convert.ToInt32(p.Properties[NetPacket.PropType.SecondCard]);
m_players[m_data.MyPlayerId].Cards = tmpCards; m_players[m_data.MyPlayerId].Cards = tmpCards;
m_data.CurHand = new Hand( m_data.CurHand = new Hand(
m_players, m_players,
m_data.MyPlayerId, m_data.MyPlayerId,
Convert.ToUInt32(p.Properties[NetPacket.PropType.SmallBlind])); Convert.ToUInt32(p.Properties[NetPacket.PropType.SmallBlind]));
m_callback.HandStarted(m_data.CurHand); m_callback.HandStarted(tmpCards);
} }
public void VisitPlayersTurn(NetPacket p) public void VisitPlayersTurn(NetPacket p)
@@ -168,7 +174,8 @@ namespace pokerth_lib
uint curPlayer = Convert.ToUInt32(p.Properties[NetPacket.PropType.PlayerId]); uint curPlayer = Convert.ToUInt32(p.Properties[NetPacket.PropType.PlayerId]);
Hand.State state = (Hand.State)Convert.ToUInt16(p.Properties[NetPacket.PropType.GameState]); Hand.State state = (Hand.State)Convert.ToUInt16(p.Properties[NetPacket.PropType.GameState]);
if (curPlayer == m_data.MyPlayerId) if (curPlayer == m_data.MyPlayerId)
m_callback.MyTurn(state); m_callback.MyTurn(state, m_data.CurHand.HighestSet,
m_data.CurHand.MinimumRaise, m_players[curPlayer].Money);
else else
m_callback.PlayersTurn(state, m_data.PlayerList.GetPlayerInfo(curPlayer).Name); m_callback.PlayersTurn(state, m_data.PlayerList.GetPlayerInfo(curPlayer).Name);
} }
@@ -182,19 +189,32 @@ namespace pokerth_lib
{ {
uint playerId = Convert.ToUInt32(p.Properties[NetPacket.PropType.PlayerId]); uint playerId = Convert.ToUInt32(p.Properties[NetPacket.PropType.PlayerId]);
Player curPlayer = m_data.CurHand.Players[playerId]; Player curPlayer = m_data.CurHand.Players[playerId];
string name = m_data.PlayerList.GetPlayerInfo(playerId).Name;
curPlayer.CurAction = curPlayer.CurAction =
(Hand.Action)Convert.ToUInt16(p.Properties[NetPacket.PropType.PlayerAction]); (Hand.Action)Convert.ToUInt16(p.Properties[NetPacket.PropType.PlayerAction]);
curPlayer.Money = curPlayer.Money =
Convert.ToUInt32(p.Properties[NetPacket.PropType.PlayerMoney]); Convert.ToUInt32(p.Properties[NetPacket.PropType.PlayerMoney]);
curPlayer.TotalBet = uint curBet = Convert.ToUInt32(p.Properties[NetPacket.PropType.PlayerBetTotal])
Convert.ToUInt32(p.Properties[NetPacket.PropType.PlayerBetTotal]); - curPlayer.TotalBet;
m_callback.ActionDone( curPlayer.TotalBet += curBet;
m_data.PlayerList.GetPlayerInfo(playerId).Name,
curPlayer.CurAction, m_data.CurHand.HighestSet = Convert.ToUInt32(p.Properties[NetPacket.PropType.HighestSet]);
curPlayer.TotalBet, m_data.CurHand.MinimumRaise = Convert.ToUInt32(p.Properties[NetPacket.PropType.MinimumRaise]);
curPlayer.Money,
Convert.ToUInt32(p.Properties[NetPacket.PropType.HighestSet]), if (curPlayer.CurAction == Hand.Action.None)
Convert.ToUInt32(p.Properties[NetPacket.PropType.MinimumRaise])); {
if (curBet == m_data.CurHand.SmallBlind)
m_callback.SmallBlind(name, curBet);
else
m_callback.BigBlind(name, curBet);
}
else
{
m_callback.ActionDone(
name,
curPlayer.CurAction,
curBet);
}
} }
public void VisitPlayersActionRejected(NetPacket p) public void VisitPlayersActionRejected(NetPacket p)
@@ -204,22 +224,42 @@ namespace pokerth_lib
public void VisitDealFlopCards(NetPacket p) public void VisitDealFlopCards(NetPacket p)
{ {
m_callback.ShowFlopCards( int[] tmpCards = new int[3];
Convert.ToInt32(p.Properties[NetPacket.PropType.FlopFirstCard]), tmpCards[0] = Convert.ToInt32(p.Properties[NetPacket.PropType.FlopFirstCard]);
Convert.ToInt32(p.Properties[NetPacket.PropType.FlopSecondCard]), tmpCards[1] = Convert.ToInt32(p.Properties[NetPacket.PropType.FlopSecondCard]);
Convert.ToInt32(p.Properties[NetPacket.PropType.FlopThirdCard])); tmpCards[2] = Convert.ToInt32(p.Properties[NetPacket.PropType.FlopThirdCard]);
m_data.CurHand.TableCards = tmpCards;
m_callback.ShowFlopCards(tmpCards);
} }
public void VisitDealTurnCard(NetPacket p) public void VisitDealTurnCard(NetPacket p)
{ {
m_callback.ShowTurnCard( int[] tmpCards = new int[4];
Convert.ToInt32(p.Properties[NetPacket.PropType.TurnCard])); m_data.CurHand.TableCards.CopyTo(tmpCards, 0);
tmpCards[3] = Convert.ToInt32(p.Properties[NetPacket.PropType.TurnCard]);
m_data.CurHand.TableCards = tmpCards;
m_callback.ShowTurnCards(tmpCards);
} }
public void VisitDealRiverCard(NetPacket p) public void VisitDealRiverCard(NetPacket p)
{ {
m_callback.ShowRiverCard( int[] tmpCards = new int[5];
Convert.ToInt32(p.Properties[NetPacket.PropType.RiverCard])); m_data.CurHand.TableCards.CopyTo(tmpCards, 0);
tmpCards[4] = Convert.ToInt32(p.Properties[NetPacket.PropType.RiverCard]);
m_data.CurHand.TableCards = tmpCards;
m_callback.ShowRiverCards(tmpCards);
}
public void VisitEndOfHandHideCards(NetPacket p)
{
uint playerId = Convert.ToUInt32(p.Properties[NetPacket.PropType.PlayerId]);
string name = m_data.PlayerList.GetPlayerInfo(playerId).Name;
Player curPlayer = m_data.CurHand.Players[playerId];
curPlayer.Money = Convert.ToUInt32(p.Properties[NetPacket.PropType.PlayerMoney]);
m_callback.PlayerWinsHideCards(
name,
Convert.ToUInt32(p.Properties[NetPacket.PropType.MoneyWon]));
} }
private PokerTHData m_data; private PokerTHData m_data;