protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); // TODO: remove this. For testing only. Clear repositories InMemoryUserRepository.GetInstance().ConnectedUsers.ToList().Clear(); InMemoryUserRepository.GetInstance().WaitingList.ToList().Clear(); InMemoryRoomRepository.GetInstance().Rooms.ToList().Clear(); var physicsTimer = new System.Timers.Timer(15); physicsTimer.Enabled = true; // Hook up the Elapsed event for the timer. physicsTimer.Elapsed += new ElapsedEventHandler(Engine.OnPhysicsTimedEvent); var updateTimer = new Timer(45); updateTimer.Enabled = true; updateTimer.Elapsed += new ElapsedEventHandler(Engine.OnUpdateClientsTimedEvent); }
public HomeController() { this._userRepository = InMemoryUserRepository.GetInstance(); this._roomRepository = InMemoryRoomRepository.GetInstance(); }
public PongRHub() { _userRepository = InMemoryUserRepository.GetInstance(); _roomRepository = InMemoryRoomRepository.GetInstance(); }