-
-
Notifications
You must be signed in to change notification settings - Fork 499
Add isResourceProtected function #1254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
'protected' seems slightly ambiguous. Should we make the name more indicative of the base functionality? e.g. isResourceStoppable or something better |
I think isResourceStoppable would be more ambiguous than isResourceProtected. Because protected resource is stoppable, but only with stopResource, restartResource functions. |
|
I don't think this is the right solution at all, the runcode resource (and admin panel code executor) would first need to check if the functions I believe that the mtaserver.conf value 'protected' should rather be authoritative.. just return false from any functions capable of manipulating the running state ( |
|
Hm, protection can indeed be slightly confusing but I can't think of something other than Adding this function is fine because scripts should be able to get this attribute. Alternatively we could extend https://wiki.multitheftauto.com/wiki/GetResourceInfo to support See I'm not sure about whether scripts should be able to start or stop protected resources. But I generally find the existence of resource "protection" a little weird and it would be useful to get more info about why (what scenarios) people protect resources. Discussion about changing the behaviour is a separate issue though, since we'd still need |
|
My suggestion above about using I'm going to merge this now - if we come up with a better name, we can change it |
Closes #1253