public static void detailInfoForCows(InfoCows info, Dictionary <string, object> data) { if (info == null || data == null) { return; } if (data.ContainsKey("bankerCards")) // 庄家牌型 { DbCowsCard c = BaseJsonSerializer.deserialize <DbCowsCard>(data["bankerCards"].ToString()); info.createBankerCard(c); } if (data.ContainsKey("otherCards1")) // 东牌型 { DbCowsCard c = BaseJsonSerializer.deserialize <DbCowsCard>(data["otherCards1"].ToString()); info.createEastCard(c); } if (data.ContainsKey("otherCards2")) // 南牌型 { DbCowsCard c = BaseJsonSerializer.deserialize <DbCowsCard>(data["otherCards2"].ToString()); info.createSouthCard(c); } if (data.ContainsKey("otherCards3")) // 西牌型 { DbCowsCard c = BaseJsonSerializer.deserialize <DbCowsCard>(data["otherCards3"].ToString()); info.createWestCard(c); } if (data.ContainsKey("otherCards4")) // 北牌型 { DbCowsCard c = BaseJsonSerializer.deserialize <DbCowsCard>(data["otherCards4"].ToString()); info.createNorthCard(c); } }
// 解析牛牛json串信息 public static InfoCows parseInfoCows(string exInfo, GMUser user) { InfoCows info = null; try { DbCowsBet bet = BaseJsonSerializer.deserialize <DbCowsBet>(exInfo); if (bet == null) { return(null); } info = new InfoCows(); info.m_betInfo = bet; ObjectId oid = ObjectId.Parse(bet.key); Dictionary <string, object> data = DBMgr.getInstance().getTableData(TableName.PUMP_COWS_CARD, "_id", oid, user.getDbServerID(), DbName.DB_PUMP); if (data == null) { return(null); } detailInfoForCows(info, data); } catch (System.Exception ex) { } return(info); }
private void genBetInfo(InfoCows info) { DbCowsBet bet = info.m_betInfo; tdEastBet.InnerText = bet.betgold0.ToString(); tdEastWin.InnerText = bet.wingold0.ToString(); tdSouthBet.InnerText = bet.betgold1.ToString(); tdSouthWin.InnerText = bet.wingold1.ToString(); tdWestBet.InnerText = bet.betgold2.ToString(); tdWestWin.InnerText = bet.wingold2.ToString(); tdNorthBet.InnerText = bet.betgold3.ToString(); tdNorthWin.InnerText = bet.wingold3.ToString(); tdSumBet.InnerText = bet.sumBet().ToString(); tdSumWin.InnerText = bet.sumWin().ToString(); }
private void genBetInfo(InfoCows info) { DbCowsBet bet = info.m_betInfo; tdEastBet.InnerText = ItemHelp.showMoneyValue(bet.betgold0).ToString(); tdEastWin.InnerText = ItemHelp.showMoneyValue(bet.wingold0).ToString(); tdSouthBet.InnerText = ItemHelp.showMoneyValue(bet.betgold1).ToString(); tdSouthWin.InnerText = ItemHelp.showMoneyValue(bet.wingold1).ToString(); tdWestBet.InnerText = ItemHelp.showMoneyValue(bet.betgold2).ToString(); tdWestWin.InnerText = ItemHelp.showMoneyValue(bet.wingold2).ToString(); tdNorthBet.InnerText = ItemHelp.showMoneyValue(bet.betgold3).ToString(); tdNorthWin.InnerText = ItemHelp.showMoneyValue(bet.wingold3).ToString(); tdSumBet.InnerText = ItemHelp.showMoneyValue(bet.sumBet()).ToString(); tdSumWin.InnerText = ItemHelp.showMoneyValue(bet.sumWin()).ToString(); }
private void genInfoPanel(GameDetailInfo ginfo) { if (ginfo == null) { return; } MoneyItem item = ginfo.m_item; InfoCows info = (InfoCows)ginfo.m_detailInfo; divHead.InnerText = item.m_genTime; // 玩家ID tdPlayer.InnerText = "玩家ID:" + item.m_playerId.ToString(); // 玩家是否上庄 tdIsBanker.InnerText = info.isBanker() ? DefCC.s_isBanker[0] : DefCC.s_isBanker[1]; if (info.isBanker()) { tdServiceChargeRatio.InnerText = info.getServiceChargeRatio() + "%"; tdServiceCharge.InnerText = info.m_betInfo.costgold.ToString(); } else { trServiceCharge.Visible = false; } // 庄家牌型 genCardInfo(divBankerCard, tdBankerCardType, info.m_bankerCard); // 东牌型 genCardInfo(divEastCard, tdEastCardType, info.m_eastCard); // 南牌型 genCardInfo(divSouthCard, tdSouthCardType, info.m_southCard); // 西牌型 genCardInfo(divWestCard, tdWestCardType, info.m_westCard); // 北牌型 genCardInfo(divNorthCard, tdNorthCardType, info.m_northCard); // 押注信息 genBetInfo(info); }