/// <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);
 }
Ejemplo n.º 2
0
 private AccountCache()
 {
     accDic        = new Dictionary <string, AccountModle>();
     ID            = new ConcurrentInt(-1);
     acc_ClientDic = new Dictionary <string, ClientPeer>();
     Client_accDic = new Dictionary <ClientPeer, string>();
 }
Ejemplo n.º 3
0
 /// <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();
 }
Ejemplo n.º 5
0
        public TimerManager()
        {
            concurrentID = new ConcurrentInt(-1);
            idTimerDic   = new ConcurrentDictionary <int, TimerModle>();

            removelistId   = new List <int>();
            timer          = new Timer(1000);
            timer.Elapsed += Timer_Elapsed;//计时器达到时间间隔后触发的事件
        }
Ejemplo n.º 6
0
 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()));
     }
 }
Ejemplo n.º 7
0
    /// <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();
    }
Ejemplo n.º 8
0
    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();
        }
    }
Ejemplo n.º 9
0
 public FightHandler()
 {
     this.concurrentInt = new ConcurrentInt(-1);
 }