/// <summary> /// 给机器配置胜率后,机器人拿大牌,有多个机器时,以早大POS的机器人为准 /// 如果有多个设置胜率帐号在同一桌,则会只有一个机率有效。 /// </summary> /// <param name="pos2RobotAI"></param> /// <param name="_pos2Poker"></param> /// <returns></returns> public Dictionary <int, List <int> > ChangePokerByRobotAI(Dictionary <int, int> pos2RobotAI, Dictionary <int, List <int> > _pos2Poker) { Dictionary <int, PokerBullFightType> _pbftype = new Dictionary <int, PokerBullFightType>(); _myTable.ForeashAllDo((i) => { _pbftype.Add(i, BullFight.GetBullType(_pos2Poker[i])); }); int _maxpos = _myTable._masterPos; PokerBullFightType maxvalue = PokerBullFightType.Bull_No; _myTable.ForeashAllDo((i) => { if (maxvalue < _pbftype[i]) { maxvalue = _pbftype[i]; _maxpos = i; } }); int _RobotRatePos = _maxpos; _myTable.ForeashAllDo((i) => { int _AIRate = pos2RobotAI[i]; if (_AIRate == 0) { return; } int _tempRate = ToolsEx.GetRandomSys(0, 100); if (_tempRate <= _AIRate) { _RobotRatePos = i; } }); List <int> _tempChange = new List <int>();//把最大的牌换给机器人最高胜率的人 _tempChange = _pos2Poker[_RobotRatePos]; _pos2Poker[_RobotRatePos] = _pos2Poker[_maxpos]; _pos2Poker[_maxpos] = _tempChange; return(_pos2Poker); }
/// <summary> /// 至少两人到位了进行 开局 ,开局就会扣掉配置钱=============================================== /// </summary> private void Start(int userid) { lock (objLock) { BullFight100User myu = GetUserByID(userid); if (myu == null) { return; } if (myu.CheckisWatch()) { return; } if (!myu.CheckFirstDeal()) { return; } //if (HaveSomeBodyUnDeal()) return; if (_numpertable < _num_min) { return; } base.StartBase(60 * 4); _pos2UserID = new Dictionary <int, int>(); _pos2IPPort = new Dictionary <int, string>(); _pos2Money = new Dictionary <int, decimal>(); _pos2Win = new Dictionary <int, bool>(); _pos2CardList = new Dictionary <int, List <int> >(); _pos2BullRate = new Dictionary <int, int>(); _pos2Watch = new Dictionary <int, int>(); Queue <int> _tcardLeft = new Queue <int>(); var type = _judge._gametype; _dicPokerList = new Dictionary <int, List <int> >(); _dicPokerBFType = new Dictionary <int, PokerBullFightType>(); _dicPokerGambleTotal = new Dictionary <int, int>(); _pos2GambleTable = new Dictionary <int, int>(); _allGambleTotal = 0; _dicPokerList = BullFight.DistributePoker(out _tcardLeft, 4); foreach (int key in _dicPokerList.Keys) { _dicPokerBFType.Add(key, BullFight.GetBullType(_dicPokerList[key])); _dicPokerGambleTotal.Add(key, 0); } ////Dictionary<int, int> _pos2RobotAI = new Dictionary<int, int>(); ////ForeashAllDo((i) => ////{ //// _pos2RobotAI.Add(i, _DicPos2User[i]._tbUser.winpercent); //_pos2RobotAI.Add(i, i == 1 ? 101 : 0); ////}); ////_judge.ChangePokerByRobotAI(_pos2RobotAI, _dicPokerList); List <int> _temppoker0 = new List <int>() { 0, 0, 0, 0, 0 }; List <UserIDMSG> imList = new List <UserIDMSG>(); List <CommonPosValSD> _uplist = new List <CommonPosValSD>(); _judge.DealReduceDiamond();//执行扣房卡 已处理只扣一次 _judge.SetCurTableorBankerCount(); //同时把每位玩家的数据确认修改了 //发送消息到所有玩家 ForeashAllDo((i) => { BullFight100User tempUser = _DicPos2User[i]; tempUser._isPlaying = true; //tempUser._shouPaiArr = _pokerList[i]; tempUser._pos2Gameble = new Dictionary <int, int>(); tempUser._showCardList = new List <int>() { 0, 0, 0, 0, 0 }; _DicPos2User[i] = tempUser;//必须要赋值回去 要求有3个返馈才处理 _tablRecord.MatchCode = _tableMathCode; _tablRecord._guid = _guid; _tablRecord.StartTime = DateTime.Now; _pos2UserID.Add(i, tempUser._userid); _pos2IPPort.Add(i, tempUser._IPandPort); //发送通知消息 sc_tablestart_bf100_n _start = new sc_tablestart_bf100_n() { result = 1, fn = "sc_tablestart_bf100_n", _msgid = _TurnWaitTime }; _start.tableid = _tableid; _start.pos = i; _start._canGetBanker = false; _start._pos2userid = _uplist;//所有玩家及对应 的位置信息 _start._curTableCount = _judge._curTableOverCount; _start._curBankerCount = 1; _start.ShowCardList = _temppoker0; _start.closefun = true;//需要抢庄,不关闭自动显示功能 imList.Add(new UserIDMSG(tempUser._userid, JsonUtils.Serialize(_start), tempUser._isRobot, tempUser._isDisconnet)); }); BF100SendDataServer.instance.SendDataDelay(imList); _tableSendData.Add(imList); _strStatus = "Start...3 "; DoExecuteSetBanker(); } }