Beispiel #1
0
        private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            SingleExecute.Instance.Execute(
                delegate()
            {
                foreach (int roomId in fightCache.GetAllWaitingRoomId())
                {
                    _21MutiFightRoom room = fightCache.GetRoomByRoomId(roomId);
                    if (room.IsAllReady())
                    {
                        if (room.isStart)
                        {
                            if (room.countDownTime == 0)
                            {
                                room.Brocast(OpCode._21Multi, _21MultiCode.START_BRO, null);
                                StartFight(roomId);
                            }
                            room.countDownTime -= 100;
                        }
                        else
                        {
                            room.isStart       = true;
                            room.countDownTime = 4000;
                            brocast(room, OpCode._21Multi, _21MultiCode.COUNT_DOWN_BRO, null, null);
                        }
                    }
                    else
                    {
                        if (room.isStart)
                        {
                            brocast(room, OpCode._21Multi, _21MultiCode.STOP_COUNT_DOWN_BRO, null, null);
                        }

                        room.isStart       = false;
                        room.countDownTime = 0;
                    }
                }
            });
        }