Beispiel #1
0
        protected void Initi(ConcurrentDictionary <int, BaseUser> _pos2user, int minnum, int maxnum, int gameid, BaseSendDataServer _bsds, TimerCallback callback)
        {
            lock (objLock)
            {
                _tablRecord = new tb_tablerecord();
                Interlocked.Exchange(ref _userTokenPos, 0);
                MoneyRecordList = new ConcurrentQueue <MoneyRecord>();
                //记录
                DateTime tempDT = DateTime.Now;

                _tableMathCode     = ToolsEx.GetRoomEnterSixID();
                _guid              = Guid.NewGuid().ToString("N");
                _haveCheckRoomCard = false;
                _applyExitTable    = false;
                _pos2userbase      = _pos2user;
                _num_max           = maxnum;
                _num_min           = minnum;
                _gameid            = gameid;
                _tablestatus       = TableStatusEnum.Initi;
                _bsDataServer      = _bsds;
                ForeashAllDoBase((i) =>
                {
                    _pos2userbase[i]._WaitSecond = _TurnWaitTime;  //20
                });
                _tableSendData.Clear();
                _tableEnterSendData.Clear();
            }
        }
        /// <summary>
        /// 通知所有在线玩家,如公告信息
        /// </summary>
        /// <returns></returns>
        public string DealGM(cs_gm_chesscard _user)
        {
            //处理公告
            sc_getnotice_n _getnotice = new sc_getnotice_n()
            {
                result = 1, fn = "_getnotice", noticelist = new List <string>()
            };

            _getnotice.noticelist.Add("玩家1524879,获得了以排行榜一等级奖!");
            BaseSendDataServer.AutoNotifySendData(JsonUtils.Serialize((_getnotice)));

            sc_base _senddata = new sc_base()
            {
                result = 1, fn = "sc_base"
            };

            return(JsonUtils.Serialize(_senddata));
        }