示例#1
0
 public void AddPlayerChips(int id, double betAmount)
 {
     BetMessageToServer msg = new BetMessageToServer();
     msg.nickname = ServiceLocator.Get<LoginViewModel>().Nickname;
     msg.betAmount = betAmount;
     msg.playerId = id;
     gameReceiver.SendToServiceAsync(msg);
 }
示例#2
0
 public void PlayerBet(BetMessageToServer msg)
 {
     rwl.AcquireWriterLock(10000);
     string filename = AppDomain.CurrentDomain.BaseDirectory.ToString() + @"/Table1.xml";
     XmlDocument xmlDoc = new XmlDocument();
     xmlDoc.Load(filename);
     XmlNode root = xmlDoc.DocumentElement;
     XmlNode chips = xmlDoc.SelectSingleNode("/Table/Players/Player[@PlayerId='" + msg.playerId + "']/Hands/Hand/Chips");
     XmlElement chip = xmlDoc.CreateElement("Chip");
     chip.SetAttribute("ChipAmount", msg.betAmount.ToString());
     chips.AppendChild(chip);
     xmlDoc.Save(filename);
     rwl.ReleaseWriterLock();
 }