This commit is contained in:
2025-02-06 22:25:04 +09:00
parent 946cc583b1
commit dd20b145ab

View File

@@ -1,5 +1,5 @@
--- Use this file to add new permission groups to the game; --- Use this file to add new permission groups to the game;
-- start with Permission_Groups.new_group('name'); -- start with Permission_Groups.new_group("name");
-- then use either :allow_all() or :disallow_all() to set the default for non specified actions; -- then use either :allow_all() or :disallow_all() to set the default for non specified actions;
-- then use :allow{} and :disallow{} to specify certain actions to allow/disallow -- then use :allow{} and :disallow{} to specify certain actions to allow/disallow
-- @config Permission-Groups -- @config Permission-Groups
@@ -10,22 +10,22 @@ local Groups = require("modules.exp_legacy.expcore.permission_groups") --- @dep
Groups.new_group("Admin") Groups.new_group("Admin")
:allow_all() :allow_all()
Groups.new_group('Mod') Groups.new_group("Mod")
:allow_all() :allow_all()
:disallow{ :disallow{
'add_permission_group', -- admin "add_permission_group", -- admin
'delete_permission_group', "delete_permission_group",
'edit_permission_group', "edit_permission_group",
'import_permissions_string', "import_permissions_string",
'map_editor_action', "map_editor_action",
'toggle_map_editor', "toggle_map_editor",
'change_multiplayer_config', "change_multiplayer_config",
'set_heat_interface_mode', "set_heat_interface_mode",
'set_heat_interface_temperature', "set_heat_interface_temperature",
'set_infinity_container_filter_item', "set_infinity_container_filter_item",
'set_infinity_container_remove_unfiltered_items', "set_infinity_container_remove_unfiltered_items",
'set_infinity_pipe_filter' "set_infinity_pipe_filter"
} }
Groups.new_group("Trusted") Groups.new_group("Trusted")
:allow_all() :allow_all()
@@ -62,8 +62,6 @@ Groups.new_group("Standard")
"set_infinity_pipe_filter", "set_infinity_pipe_filter",
"admin_action", -- trusted "admin_action", -- trusted
"change_programmable_speaker_alert_parameters", -- standard "change_programmable_speaker_alert_parameters", -- standard
"open_new_platform_button_from_rocket_silo",
"set_rocket_silo_send_to_orbit_automated_mode"
} }
Groups.new_group("Guest") Groups.new_group("Guest")
@@ -86,17 +84,15 @@ Groups.new_group("Guest")
"drop_item", "drop_item",
"open_new_platform_button_from_rocket_silo", "open_new_platform_button_from_rocket_silo",
"set_rocket_silo_send_to_orbit_automated_mode", "set_rocket_silo_send_to_orbit_automated_mode",
"change_programmable_speaker_parameters", -- guest "change_programmable_speaker_parameters",
"change_train_stop_station", "change_train_stop_station",
-- 'deconstruct', -- "deconstruct",
"remove_cables", "remove_cables",
"remove_train_station", "remove_train_station",
"reset_assembling_machine", "reset_assembling_machine",
"rotate_entity", "rotate_entity",
-- 'use_artillery_remote', -- not in 2.0 -- "launch_rocket",
"launch_rocket",
"cancel_research", "cancel_research",
-- 'activate_cut', -- not in 2.0
"flush_opened_entity_fluid", "flush_opened_entity_fluid",
"flush_opened_entity_specific_fluid", "flush_opened_entity_specific_fluid",
} }
@@ -110,15 +106,15 @@ Groups.new_group("Restricted")
local trusted_time = 60*60*60*10 -- 10 hour local trusted_time = 60*60*60*10 -- 10 hour
local standard_time = 60*60*60*3 -- 3 hour local standard_time = 60*60*60*3 -- 3 hour
local function assign_group(player) local function assign_group(player)
local current_group_name = player.permission_group and player.permission_group.name or 'None' local current_group_name = player.permission_group and player.permission_group.name or "None"
if player.admin then if player.admin then
Permission_Groups.set_player_group(player,'Admin') Permission_Groups.set_player_group(player,"Admin")
elseif player.online_time > trusted_time or current_group_name == 'Trusted' then elseif player.online_time > trusted_time or current_group_name == "Trusted" then
Permission_Groups.set_player_group(player,'Trusted') Permission_Groups.set_player_group(player,"Trusted")
elseif player.online_time > standard_time or current_group_name == 'Standard' then elseif player.online_time > standard_time or current_group_name == "Standard" then
Permission_Groups.set_player_group(player,'Standard') Permission_Groups.set_player_group(player,"Standard")
else else
Permission_Groups.set_player_group(player,'Guest') Permission_Groups.set_player_group(player,"Guest")
end end
end end