Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TimeSpan FastSinceLastTime = DateTime.Now - _fastCycleLastExecution;
- if (FastSinceLastTime.TotalMilliseconds >= 100)
- {
- _fastCycleLastExecution = DateTime.Now;
- foreach (Room Room in this._rooms.Values.ToList())
- {
- //Special Wired Task
- if (Room.ProcessFastTask == null || Room.ProcessFastTask.IsCompleted)
- {
- Room.ProcessFastTask = new Task(Room.ProcessFastTasks);
- Room.ProcessFastTask.Start();
- Room.IsLagging = 0;
- }
- else
- {
- Room.IsLagging++;
- if (Room.IsLagging >= 10)
- {
- Room.isCrashed = true;
- //UnloadRoom(Room); This keeps crashing rooms.. disabled for now..
- Logging.WriteLine("[WiredCycle] Room crashed (task didn't complete within 30 seconds): " + Room.RoomId);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment