/// <summary> /// 处理消息 /// </summary> /// <param name="clientcommand"></param> /// <returns></returns> public string DealDataEx(string _data, string _ipport, tb_User _user) { string senddata = ""; try { _strIPandPort = _ipport; cs_base _basedata = JsonUtils.Deserialize <cs_base>(_data); switch (_basedata.fn) { case "cs_entertable_bf100": cs_entertable_bf100 _entertable = JsonUtils.Deserialize <cs_entertable_bf100>(_data); senddata = EnterTableAdd(_user, _entertable); break; case "cs_applybanker_bf100": // cs_gamble_bf cs_applybanker_bf100 _enterroom = JsonUtils.Deserialize <cs_applybanker_bf100>(_data); senddata = GetBanker(_user, _enterroom); break; case "cs_gambleone_bf100": // cs_gamble_bf cs_gambleone_bf100 _gambleone = JsonUtils.Deserialize <cs_gambleone_bf100>(_data); return(GambleOne(_user, _gambleone)); case "cs_bankergetbonuspot_bf100": cs_bankergetbonuspot_bf100 _getPot = JsonUtils.Deserialize <cs_bankergetbonuspot_bf100>(_data); senddata = BankerGetBonusPot(_user, _getPot); break; default: ErrorRecord.Record(_basedata.fn + " undeal 201611062128BF "); break; } return(senddata); } catch (Exception ex) { ErrorRecord.Record(ex, " 201206091508BF "); return(""); } }
/// <summary> /// 进入房间 返回现在等待用户数 /// </summary> /// <returns></returns> private string BankerGetBonusPot(tb_User _user, cs_bankergetbonuspot_bf100 _data) { sc_bankergetbonuspot_bf100 _senddata = new sc_bankergetbonuspot_bf100() { result = 0, fn = "sc_bankergetbonuspot_bf100", cc = 0 }; BullFight100Table table = BullFight100Lobby.instance.GetTableByRoomIDandTableID(_data.levelid, _data.tableid); if (table == null) { return(JsonUtils.Serialize(_senddata)); } if (table.BankerGetBonusPot(_user.UserID)) { _senddata.result = 1; } string _redata = JsonUtils.Serialize(_senddata); table.AddSendDataRecord(_user.UserID, _redata); return(_redata); }