/// <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 EnterTableAdd(tb_User _user, cs_entertable_bfc _data) { sc_entertable_bfc _senddata = new sc_entertable_bfc() { result = 0, fn = "sc_entertable_bf", cc = 0 }; BullColorTable table = BullColorLobby.instance.GetTableByRoomIDandTableID(_data.levelid, _data.tableid); if (table == null) { return(JsonUtils.Serialize(_senddata)); } bool _succes = table.EnterTableAdditive(_user); _senddata.result = _succes?1:0; string _redata = JsonUtils.Serialize(_senddata); table.AddSendDataRecord(_user.UserID, _redata); return(_redata); }