/// <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_bfc": cs_entertable_bfc _entertable = JsonUtils.Deserialize <cs_entertable_bfc>(_data); senddata = EnterTableAdd(_user, _entertable); break; case "cs_gambleone_bfc": // cs_gamble_bf cs_gambleone_bfc _gambleone = JsonUtils.Deserialize <cs_gambleone_bfc>(_data); return(GambleOne(_user, _gambleone)); default: ErrorRecord.Record(_basedata.fn + " undeal 201611062128BF "); break; } return(senddata); } catch (Exception ex) { ErrorRecord.Record(ex, " 201206091508BF "); return(""); } }
/// <summary> /// 下注一次,只有升庄牛牛才会有的 /// </summary> /// <returns></returns> private string GambleOne(tb_User _user, cs_gambleone_bfc _data) { sc_gambleone_bfc _senddata = new sc_gambleone_bfc() { result = 0, fn = "sc_gambleone_bfc", cc = 0 }; BullColorTable table = BullColorLobby.instance.GetTableByRoomIDandTableID(_data.levelid, _data.tableid); if (table == null) { return(JsonUtils.Serialize(_senddata)); } table.GambleOne(_user.UserID, _data.targetpos, _data.rate, _data.lx, _data.ly); _senddata.result = 1; _senddata.lx = _data.lx; _senddata.ly = _data.ly; string _redata = JsonUtils.Serialize(_senddata); table.AddSendDataRecord(_user.UserID, _redata); return(_redata); }