/// <summary> /// 构造函数 /// </summary> public FightRoomCache() { this.idRoomDict = new Dictionary <int, FightRoomModel>(); this.uidRoomDict = new Dictionary <int, FightRoomModel>(); this.fightRoomQueue = new Queue <FightRoomModel>(); this.concurrentInt = new ConcurrentInt(-1); }
private AccountCache() { accDic = new Dictionary <string, AccountModle>(); ID = new ConcurrentInt(-1); acc_ClientDic = new Dictionary <string, ClientPeer>(); Client_accDic = new Dictionary <ClientPeer, string>(); }
/// <summary> /// 无参数构造函数 /// </summary> public RoomCache() { ridRoomModelDict = new Dictionary <int, RoomModel>(); uidRidDict = new Dictionary <int, int>(); roomQueue = new Queue <RoomModel>(); concurrentInt = new ConcurrentInt(-1); }
private TimerManager() { id = new ConcurrentInt(-1); timer = new Timer(10); timer.Elapsed += Timer_Elapsed; idModelDict = new ConcurrentDictionary <int, TimeModel>(); removeList = new List <int>(); timer.Start(); }
public TimerManager() { concurrentID = new ConcurrentInt(-1); idTimerDic = new ConcurrentDictionary <int, TimerModle>(); removelistId = new List <int>(); timer = new Timer(1000); timer.Elapsed += Timer_Elapsed;//计时器达到时间间隔后触发的事件 }
public MatchCache() { id = new ConcurrentInt(-1); uIdRidDic = new Dictionary <int, int>(); rIdRoomDic = new Dictionary <int, MatchRoom>(); //默认保存10个房间 roomPool = new Queue <MatchRoom>(roomCapacity); for (int i = 0; i < roomCapacity; i++) { roomPool.Enqueue(new MatchRoom(id.Add_Get())); } }
/// <summary> /// 服务重启 /// </summary> public void ReStart() { taskIdList.Clear(); taskIdToReduceList.Clear(); timeTaskList.Clear(); tempTimeTaskList.Clear(); frameTaskList.Clear(); tempFrameTaskList.Clear(); LogDel = null; frameCounter = 0; id = new ConcurrentInt(-1); serverTimer.Stop(); }
public TimerMananger(int timerInterval = 0, Action <string> logDel = null) { this.LogDel = logDel; id = new ConcurrentInt(-1); frameCounter = 0; //服务器使用需要开启多线程计时 if (timerInterval != 0) { serverTimer = new System.Timers.Timer(timerInterval); serverTimer.AutoReset = true; serverTimer.Elapsed += (object sender, System.Timers.ElapsedEventArgs e) => { this.Update(); }; serverTimer.Start(); } }
public FightHandler() { this.concurrentInt = new ConcurrentInt(-1); }