AclSave: Difference between revisions
Jump to navigation
Jump to search
m (fix oop note) |
Qwe7769611 (talk | contribs) No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 2: | Line 2: | ||
{{Server function}} | {{Server function}} | ||
<!-- Describe in plain english what this function does. Don't go into details, just give an overview --> | <!-- Describe in plain english what this function does. Don't go into details, just give an overview --> | ||
The ACL XML file is automatically saved whenever the ACL is modified, but the automatic save can be delayed by up to 10 seconds for performance reasons. Calling this function will force an immediate save. | |||
==Syntax== | ==Syntax== | ||
Line 33: | Line 33: | ||
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --> | <!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --> | ||
{{ACL_functions}} | {{ACL_functions}} | ||
[[zh-cn:aclSave]] |
Latest revision as of 08:37, 5 February 2021
The ACL XML file is automatically saved whenever the ACL is modified, but the automatic save can be delayed by up to 10 seconds for performance reasons. Calling this function will force an immediate save.
Syntax
bool aclSave ()
OOP Syntax Help! I don't understand this!
- Note: This function is a static function underneath the ACL class.
- Method: ACL.save(...)
Returns
Returns true if the ACL was successfully changed, false or nil if it could not be saved for some reason, ie. file in use.
Example
This example saves the ACL when somebody types "/save-acl".
function saveACL ( thePlayer, command ) -- Function header. Also where thePlayer is defined. local saved = aclSave() -- Save the ACL if ( saved ) then -- If it was successfully saved then... outputChatBox ( "ACL was successfully saved.", thePlayer, 255, 0, 0 ) -- Output it saved else -- If it wasn't saved for whatever reason then... outputChatBox ( "An unexpected error occured.", thePlayer, 255, 0, 0 ) -- Output it didn't save end end addCommandHandler ( "save-acl", saveACL ) -- Make it trigger for "/save-acl".
See Also
- aclCreate
- aclCreateGroup
- aclDestroy
- aclDestroyGroup
- aclGet
- aclGetGroup
- aclGetName
- aclGetRight
- aclGroupAddACL
- aclGroupAddObject
- aclGroupGetName
- aclGroupList
- aclGroupListACL
- aclGroupListObjects
- aclGroupRemoveACL
- aclGroupRemoveObject
- aclList
- aclListRights
- aclReload
- aclRemoveRight
- aclSave
- aclSetRight
- hasObjectPermissionTo
- isObjectInACLGroup