Guest User

Untitled

a guest
Jun 12th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. TimeSpan FastSinceLastTime = DateTime.Now - _fastCycleLastExecution;
  2. if (FastSinceLastTime.TotalMilliseconds >= 100)
  3. {
  4. _fastCycleLastExecution = DateTime.Now;
  5. foreach (Room Room in this._rooms.Values.ToList())
  6. {
  7. //Special Wired Task
  8. if (Room.ProcessFastTask == null || Room.ProcessFastTask.IsCompleted)
  9. {
  10. Room.ProcessFastTask = new Task(Room.ProcessFastTasks);
  11. Room.ProcessFastTask.Start();
  12. Room.IsLagging = 0;
  13. }
  14. else
  15. {
  16. Room.IsLagging++;
  17. if (Room.IsLagging >= 10)
  18. {
  19. Room.isCrashed = true;
  20. //UnloadRoom(Room); This keeps crashing rooms.. disabled for now..
  21. Logging.WriteLine("[WiredCycle] Room crashed (task didn't complete within 30 seconds): " + Room.RoomId);
  22. }
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment