View Single Post
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 11-18-2011 , 16:06   Re: [ANY] Automatic Steam Update
Reply With Quote #18

Quote:
Originally Posted by psychonic View Post
@ Dr. McKay

Timer callbacks should return an explicit Plugin_Continue or Plugin_Stop for clarity (although anything other than Stop acts as continue for repeating timers). Handled implies Stop for other callback types and I'm not sure what behavior you were going for on a couple of the returns.

It also seems that there could be race conditions with multiple instances of the main timer running if the map is changed (because iirc, steam update check happens at map change). Perhaps just adding the TIMER_FLAG_NO_MAPCHANGE flag would be sufficient in your use case.

P.S. I do like the postpone option. That's handy.
Updated to use Plugin_Continue instead of Plugin_Handled.

I don't forsee any race conditions happening. When the timer is started, is sets suspendPlugin = true, which causes it to ignore any further master server restart requests until the timer is aborted (and the delay time has expired).
__________________
Dr. McKay is offline