[x] If doing so, ensure these values are not saved if no changes have been made (the System module should not save values if they match the defaults, although im not sure if this checks against multiple layers, maybe only the top layer currently)
[x] Also ensure RoleService.roleChanged is fired even when the property is multiple layers deep
[x] Setup a separate method to determine (pathway, to, setting)
[x] local success, environment = RoleService.verifySetting(user, pathway, to, setting)[comparer](value), e.g.
local success, environment = RoleService.verifySetting(user, "canView", "bans").is(true)
local success, environment = RoleService.verifySetting(user, "commands").has("kill")
[x] ensure global/private determiner works correctly. also, do i need to set a _nanobloxEnvironment for every variable, or the whole table?
[x] complete 'is' and 'has' comparers
[x] Instead of calculating these values every time requested (which could be a lot), instead predetermine the values within the user (comparing against a tostring key dictionary) which is only updated when the role changes (which is rarely). Update if...
[x] role changed (update all users with that role)
[x] role removed (update all users with that role)
[x] user is given a role
[x] user has a role taken
[x] user loaded on joining the game
[x] the role object changes (update for all users with that role)
[x] Return the environment - if multiple environments across roles then return main.enum.Environment.Multiple
[x] RoleService.getHighestSetting(user, pathway, to, setting)
Role Order
[x] How does this work???? Do environments intermingle roles and role orders or do they remain separate list orders?
[ ] When a role's role order is changed, ensure all roles have different roleOrders
[ ] Consider changes to the following methods and any modules which use them. Then, add an environment parameter, which scans for a specific environment if specified (else all if nil)
[ ] getHighestRole
[ ] getLowestRole
[ ] isSenior
[ ] isPeer
[ ] isJunior
[ ] Also consider having :getRoles return roles by order
[ ] Listen for 'roleOrder', 'environment' and 'inheritCommands'
[ ] Should commands be inherited from different environments??
[ ] ZONE CONFINES:
[ ] role:limitToZone
[ ] role:limitToZones
[ ] for all player args, limit to only players within that zone
[ ] example:
local main = require(game.Nanoblox)
local role = main.services.RoleService.getRole(roleNameOrUID)
role:limitToZone() -- there is also :limitToZones(array)
zone.playerEntered:Connect(function(player)
local user = main.modules.PlayerStore:getUser(player)
role:giveTo(user, main.Enum.RoleType.Temp)
end)
zone.playerExited:Connect(function(player)
local user = main.modules.PlayerStore:getUser(player)
role:takeFrom(user)
end)
[ ] WHEN A PLAYER LEAVES A ZONE (i.e. when its role is removed) END ALL TASKS ASSOCIATED WITH THAT ENVIRONMENT/ROLE
OnPlayerLoaded/Added Setup roles
[ ] Set the users perm 'previousAutoRoles' to {} then when one of these auto (but 'server') roles is given, also apply it to this perm table which remembers
[ ] RETHINK THIS ONE (needs a better name and functionality): A separate RoleService:getRoles method (reconsider that name) Give roles, determined by the role givers
[ ] For the following, use the player methods if present, else default to the async:
[ ] gamepasses - also make sure to listen for PromptGamePassPurchaseFinished
[ ] friends
Get roles from userid
[ ] A method that returns a promise and resolves a list of all the roleUIDs that the user has
[ ] If in server, simply get all right away
[ ] If not server, load the user for their 'previousAutoRoles' table
[ ] Add all of these to the return value, including all records of matching userId within longterm service
PropertyDetails module
[ ] Setup a shared module called 'PropertyDetails' which contains an initial table of category (Roles, Bans, etc) then a sub table with all the recordProperties we wish to send to the client as keys, then details on its displayName, description, etc
First
Setting verification/retriever
local success, environment = RoleService.verifySetting(user, pathway, to, setting)[comparer](value)
, e.g.main.enum.Environment.Multiple
RoleService.getHighestSetting(user, pathway, to, setting)
Role Order
:getRoles
return roles by order:getRolesWithEnvironment(environment)
Role
zone.playerEntered:Connect(function(player) local user = main.modules.PlayerStore:getUser(player) role:giveTo(user, main.Enum.RoleType.Temp) end) zone.playerExited:Connect(function(player) local user = main.modules.PlayerStore:getUser(player) role:takeFrom(user) end)
OnPlayerLoaded/Added Setup roles
player
methods if present, else default to the async:Get roles from userid
PropertyDetails module
Complete all RoleService Settings