mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
Add startable legacy code
This commit is contained in:
@@ -1,14 +1,23 @@
|
|||||||
--- This file defines the different triggers for the chat bot
|
--- This file defines the different triggers for the chat bot
|
||||||
-- @config Chat-Reply
|
-- @config Chat-Reply
|
||||||
|
|
||||||
local Async = require 'expcore.async'
|
local ExpUtil = require("modules/exp_util")
|
||||||
local format_time = _C.format_time --- @dep expcore.common
|
local Async = require("modules/exp_util/async")
|
||||||
|
|
||||||
-- eg Async(async_message, is_command or player, message)
|
local send_message_async =
|
||||||
local async_message = Async.register(function(player, message)
|
Async.register(function(player, message)
|
||||||
if player == true then game.print(message) else player.print(message) end
|
if player == true then
|
||||||
|
game.print(message)
|
||||||
|
else
|
||||||
|
player.print(message)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
local afk_time_units = {
|
||||||
|
minutes = true,
|
||||||
|
seconds = true,
|
||||||
|
}
|
||||||
|
|
||||||
-- luacheck:ignore 212/player 212/is_command
|
-- luacheck:ignore 212/player 212/is_command
|
||||||
return {
|
return {
|
||||||
allow_command_prefix_for_messages = true, --- @setting allow_command_prefix_for_messages when true any message trigger will print to all player when prefixed
|
allow_command_prefix_for_messages = true, --- @setting allow_command_prefix_for_messages when true any message trigger will print to all player when prefixed
|
||||||
@@ -37,7 +46,7 @@ return {
|
|||||||
max = next_player
|
max = next_player
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return {'chat-bot.afk', max.name, format_time(max.afk_time, {minutes = true, seconds = true, long = true})}
|
return {'chat-bot.afk', max.name, ExpUtil.format_locale_time(max.afk_time, "long", afk_time_units)}
|
||||||
end,
|
end,
|
||||||
['players'] = function(_player, _is_command)
|
['players'] = function(_player, _is_command)
|
||||||
return {'chat-bot.players', #game.players}
|
return {'chat-bot.players', #game.players}
|
||||||
@@ -74,46 +83,46 @@ return {
|
|||||||
end,
|
end,
|
||||||
['makepopcorn'] = function(player, _is_command)
|
['makepopcorn'] = function(player, _is_command)
|
||||||
local timeout = math.floor(180*(math.random()+0.5))
|
local timeout = math.floor(180*(math.random()+0.5))
|
||||||
Async(async_message, true, {'chat-bot.reply', {'chat-bot.get-popcorn-1'}})
|
send_message_async(true, {'chat-bot.reply', {'chat-bot.get-popcorn-1'}})
|
||||||
Async.wait(timeout, async_message, true, {'chat-bot.reply', {'chat-bot.get-popcorn-2', player.name}})
|
send_message_async:start_after(timeout, true, {'chat-bot.reply', {'chat-bot.get-popcorn-2', player.name}})
|
||||||
end,
|
end,
|
||||||
['passsomesnaps'] = function(player, _is_command)
|
['passsomesnaps'] = function(player, _is_command)
|
||||||
local timeout = math.floor(180*(math.random()+0.5))
|
local timeout = math.floor(180*(math.random()+0.5))
|
||||||
Async(async_message, player, {'chat-bot.reply', {'chat-bot.get-snaps-1'}})
|
send_message_async(player, {'chat-bot.reply', {'chat-bot.get-snaps-1'}})
|
||||||
Async.wait(timeout, async_message, true, {'chat-bot.reply', {'chat-bot.get-snaps-2', player.name}})
|
send_message_async:start_after(timeout, true, {'chat-bot.reply', {'chat-bot.get-snaps-2', player.name}})
|
||||||
Async.wait(timeout*(math.random()+0.5), async_message, true, {'chat-bot.reply', {'chat-bot.get-snaps-3', player.name}})
|
send_message_async:start_after(timeout*(math.random()+0.5), true, {'chat-bot.reply', {'chat-bot.get-snaps-3', player.name}})
|
||||||
end,
|
end,
|
||||||
['makecocktail'] = function(player, _is_command)
|
['makecocktail'] = function(player, _is_command)
|
||||||
local timeout = math.floor(180*(math.random()+0.5))
|
local timeout = math.floor(180*(math.random()+0.5))
|
||||||
Async(async_message, true, {'chat-bot.reply', {'chat-bot.get-cocktail-1'}})
|
send_message_async(true, {'chat-bot.reply', {'chat-bot.get-cocktail-1'}})
|
||||||
Async.wait(timeout, async_message, true, {'chat-bot.reply', {'chat-bot.get-cocktail-2', player.name}})
|
send_message_async:start_after(timeout, true, {'chat-bot.reply', {'chat-bot.get-cocktail-2', player.name}})
|
||||||
Async.wait(timeout*(math.random()+0.5), async_message, true, {'chat-bot.reply', {'chat-bot.get-cocktail-3', player.name}})
|
send_message_async:start_after(timeout*(math.random()+0.5), true, {'chat-bot.reply', {'chat-bot.get-cocktail-3', player.name}})
|
||||||
end,
|
end,
|
||||||
['makecoffee'] = function(player, _is_command)
|
['makecoffee'] = function(player, _is_command)
|
||||||
local timeout = math.floor(180*(math.random()+0.5))
|
local timeout = math.floor(180*(math.random()+0.5))
|
||||||
Async(async_message, true, {'chat-bot.reply', {'chat-bot.make-coffee-1'}})
|
send_message_async(true, {'chat-bot.reply', {'chat-bot.make-coffee-1'}})
|
||||||
Async.wait(timeout, async_message, true, {'chat-bot.reply', {'chat-bot.make-coffee-2', player.name}})
|
send_message_async:start_after(timeout, true, {'chat-bot.reply', {'chat-bot.make-coffee-2', player.name}})
|
||||||
end,
|
end,
|
||||||
['orderpizza'] = function(player, _is_command)
|
['orderpizza'] = function(player, _is_command)
|
||||||
local timeout = math.floor(180*(math.random()+0.5))
|
local timeout = math.floor(180*(math.random()+0.5))
|
||||||
Async(async_message, true, {'chat-bot.reply', {'chat-bot.order-pizza-1'}})
|
send_message_async(true, {'chat-bot.reply', {'chat-bot.order-pizza-1'}})
|
||||||
Async.wait(timeout, async_message, true, {'chat-bot.reply', {'chat-bot.order-pizza-2', player.name}})
|
send_message_async:start_after(timeout, true, {'chat-bot.reply', {'chat-bot.order-pizza-2', player.name}})
|
||||||
Async.wait(timeout*(math.random()+0.5), async_message, true, {'chat-bot.reply', {'chat-bot.order-pizza-3', player.name}})
|
send_message_async:start_after(timeout*(math.random()+0.5), true, {'chat-bot.reply', {'chat-bot.order-pizza-3', player.name}})
|
||||||
end,
|
end,
|
||||||
['maketea'] = function(player, _is_command)
|
['maketea'] = function(player, _is_command)
|
||||||
local timeout = math.floor(180*(math.random()+0.5))
|
local timeout = math.floor(180*(math.random()+0.5))
|
||||||
Async(async_message, true, {'chat-bot.reply', {'chat-bot.make-tea-1'}})
|
send_message_async(true, {'chat-bot.reply', {'chat-bot.make-tea-1'}})
|
||||||
Async.wait(timeout, async_message, true, {'chat-bot.reply', {'chat-bot.make-tea-2', player.name}})
|
send_message_async:start_after(timeout, true, {'chat-bot.reply', {'chat-bot.make-tea-2', player.name}})
|
||||||
end,
|
end,
|
||||||
['meadplease'] = function(player, _is_command)
|
['meadplease'] = function(player, _is_command)
|
||||||
local timeout = math.floor(180*(math.random()+0.5))
|
local timeout = math.floor(180*(math.random()+0.5))
|
||||||
Async(async_message, true, {'chat-bot.reply', {'chat-bot.get-mead-1'}})
|
send_message_async(true, {'chat-bot.reply', {'chat-bot.get-mead-1'}})
|
||||||
Async.wait(timeout, async_message, true, {'chat-bot.reply', {'chat-bot.get-mead-2', player.name}})
|
send_message_async:start_after(timeout, true, {'chat-bot.reply', {'chat-bot.get-mead-2', player.name}})
|
||||||
end,
|
end,
|
||||||
['passabeer'] = function(player, _is_command)
|
['passabeer'] = function(player, _is_command)
|
||||||
local timeout = math.floor(180*(math.random()+0.5))
|
local timeout = math.floor(180*(math.random()+0.5))
|
||||||
Async(async_message, true, {'chat-bot.reply', {'chat-bot.get-beer-1'}})
|
send_message_async(true, {'chat-bot.reply', {'chat-bot.get-beer-1'}})
|
||||||
Async.wait(timeout, async_message, true, {'chat-bot.reply', {'chat-bot.get-beer-2', player.name}})
|
send_message_async:start_after(timeout, true, {'chat-bot.reply', {'chat-bot.get-beer-2', player.name}})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
-- either way you can change the requirements to be "admin" if you wanted to
|
-- either way you can change the requirements to be "admin" if you wanted to
|
||||||
-- @config Commands-Auth-Admin
|
-- @config Commands-Auth-Admin
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
|
|
||||||
-- luacheck:ignore 212/command
|
-- luacheck:ignore 212/command
|
||||||
Commands.add_authenticator(function(player, command, tags, reject)
|
Commands.add_authenticator(function(player, command, tags, reject)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
--- This will make commands only work if the role has been allowed it in the role config
|
--- This will make commands only work if the role has been allowed it in the role config
|
||||||
-- @config Commands-Auth-Roles
|
-- @config Commands-Auth-Roles
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
|
|
||||||
-- luacheck:ignore 212/tags
|
-- luacheck:ignore 212/tags
|
||||||
Commands.add_authenticator(function(player, command, tags, reject)
|
Commands.add_authenticator(function(player, command, tags, reject)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
--- This will make commands only work when a valid color from the presets has been selected
|
--- This will make commands only work when a valid color from the presets has been selected
|
||||||
-- @config Commands-Color-Parse
|
-- @config Commands-Color-Parse
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Colours = require 'utils.color_presets' --- @dep utils.color_presets
|
local Colours = require("modules/exp_util/include/color")
|
||||||
|
|
||||||
Commands.add_parse('color',function(input, _, reject)
|
Commands.add_parse('color',function(input, _, reject)
|
||||||
if not input then return end
|
if not input then return end
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ see ./expcore/commands.lua for more details
|
|||||||
surface
|
surface
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
|
|
||||||
-- luacheck:ignore 212/player
|
-- luacheck:ignore 212/player
|
||||||
Commands.add_parse('boolean',function(input, player)
|
Commands.add_parse('boolean',function(input, player)
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
player-role-alive
|
player-role-alive
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
local auto_complete = _C.auto_complete --- @dep expcore.common
|
local auto_complete = _C.auto_complete --- @dep expcore.common
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
-- luacheck:ignore 212/player
|
-- luacheck:ignore 212/player
|
||||||
Commands.add_parse('role',function(input, player, reject)
|
Commands.add_parse('role',function(input, player, reject)
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
-- this config adds Commands.disable and Commands.enable to enable and disable commands for all users
|
-- this config adds Commands.disable and Commands.enable to enable and disable commands for all users
|
||||||
-- @config Commands-Auth-Runtime-Disable
|
-- @config Commands-Auth-Runtime-Disable
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
|
|
||||||
local disabled_commands = {}
|
local disabled_commands = {}
|
||||||
Global.register(disabled_commands, function(tbl)
|
Storage.register(disabled_commands, function(tbl)
|
||||||
disabled_commands = tbl
|
disabled_commands = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
-- 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
|
||||||
|
|
||||||
--local Event = require 'utils.event' -- @dep utils.event
|
--local Event = require("modules/exp_legacy/utils/event") -- @dep utils.event
|
||||||
local Permission_Groups = require 'expcore.permission_groups' --- @dep expcore.permission_groups
|
local Permission_Groups = require("modules.exp_legacy.expcore.permission_groups") --- @dep expcore.permission_groups
|
||||||
|
|
||||||
Permission_Groups.new_group('Admin')
|
Permission_Groups.new_group('Admin')
|
||||||
:allow_all()
|
:allow_all()
|
||||||
@@ -60,7 +60,7 @@ Permission_Groups.new_group('Standard')
|
|||||||
'admin_action', -- trusted
|
'admin_action', -- trusted
|
||||||
'change_programmable_speaker_alert_parameters', -- standard
|
'change_programmable_speaker_alert_parameters', -- standard
|
||||||
'drop_item',
|
'drop_item',
|
||||||
'set_auto_launch_rocket'
|
'change_rocket_silo_mode'
|
||||||
}
|
}
|
||||||
|
|
||||||
Permission_Groups.new_group('Guest')
|
Permission_Groups.new_group('Guest')
|
||||||
@@ -81,7 +81,7 @@ Permission_Groups.new_group('Guest')
|
|||||||
'admin_action', -- trusted
|
'admin_action', -- trusted
|
||||||
'change_programmable_speaker_alert_parameters', -- standard
|
'change_programmable_speaker_alert_parameters', -- standard
|
||||||
'drop_item',
|
'drop_item',
|
||||||
'set_auto_launch_rocket',
|
'change_rocket_silo_mode',
|
||||||
'change_programmable_speaker_parameters', -- guest
|
'change_programmable_speaker_parameters', -- guest
|
||||||
'change_train_stop_station',
|
'change_train_stop_station',
|
||||||
--'deconstruct',
|
--'deconstruct',
|
||||||
@@ -89,10 +89,10 @@ Permission_Groups.new_group('Guest')
|
|||||||
'remove_train_station',
|
'remove_train_station',
|
||||||
'reset_assembling_machine',
|
'reset_assembling_machine',
|
||||||
'rotate_entity',
|
'rotate_entity',
|
||||||
'use_artillery_remote',
|
--'use_artillery_remote', -- not in 2.0
|
||||||
'launch_rocket',
|
'launch_rocket',
|
||||||
'cancel_research',
|
'cancel_research',
|
||||||
'activate_cut',
|
--'activate_cut', -- not in 2.0
|
||||||
'flush_opened_entity_fluid',
|
'flush_opened_entity_fluid',
|
||||||
'flush_opened_entity_specific_fluid'
|
'flush_opened_entity_specific_fluid'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
--- This is the main config file for the role system; file includes defines for roles and role flags and default values
|
--- This is the main config file for the role system; file includes defines for roles and role flags and default values
|
||||||
-- @config Roles
|
-- @config Roles
|
||||||
|
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
local PlayerData = require 'expcore.player_data' --- @dep expcore.player_data
|
local PlayerData = require("modules.exp_legacy.expcore.player_data") --- @dep expcore.player_data
|
||||||
local Statistics = PlayerData.Statistics
|
local Statistics = PlayerData.Statistics
|
||||||
|
|
||||||
--- Role flags that will run when a player changes roles
|
--- Role flags that will run when a player changes roles
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
--- This file contains all the different settings for the autofill system and gui
|
--- This file contains all the different settings for the autofill system and gui
|
||||||
-- @config Autofill
|
-- @config Autofill
|
||||||
|
|
||||||
local table = require 'overrides.table' -- @dep overrides.table
|
local table = require("modules.exp_legacy.overrides.table") -- @dep overrides.table
|
||||||
|
|
||||||
local config = {
|
local config = {
|
||||||
-- General config
|
-- General config
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
-- the key used for the name of the button is the permission name used by the role system;
|
-- the key used for the name of the button is the permission name used by the role system;
|
||||||
-- @config Player-List
|
-- @config Player-List
|
||||||
|
|
||||||
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
local Gui = require("modules.exp_legacy.expcore.gui") --- @dep expcore.gui
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
local Reports = require 'modules.control.reports' --- @dep modules.control.reports
|
local Reports = require("modules.exp_legacy.modules.control.reports") --- @dep modules.control.reports
|
||||||
local Warnings = require 'modules.control.warnings' --- @dep modules.control.warnings
|
local Warnings = require("modules.exp_legacy.modules.control.warnings") --- @dep modules.control.warnings
|
||||||
local Jail = require 'modules.control.jail' --- @dep modules.control.jail
|
local Jail = require("modules.exp_legacy.modules.control.jail") --- @dep modules.control.jail
|
||||||
local Colors = require 'utils.color_presets' --- @dep utils.color_presets
|
local Colors = require("modules/exp_util/include/color")
|
||||||
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
||||||
|
|
||||||
local SelectedPlayer, SelectedAction
|
local SelectedPlayer, SelectedAction
|
||||||
|
|||||||
@@ -8,20 +8,13 @@ log('[START] -----| Explosive Gaming Scenario Loader |-----')
|
|||||||
log('[INFO] Setting up lua environment')
|
log('[INFO] Setting up lua environment')
|
||||||
|
|
||||||
-- Require the global overrides
|
-- Require the global overrides
|
||||||
require 'overrides.stages' -- Data stages used in factorio, often used to test for runtime
|
require("modules.exp_legacy.overrides.table") -- Adds alot more functions to the table module
|
||||||
require 'overrides.print' -- Overrides the _G.print function
|
storage.version = require("modules.exp_legacy.overrides.version") -- The current version for exp gaming scenario
|
||||||
require 'overrides.math' -- Omitting the math library is a very bad idea
|
_C = require("modules.exp_legacy.expcore.common") -- _C is used to store lots of common functions expected to be used
|
||||||
require 'overrides.table' -- Adds alot more functions to the table module
|
|
||||||
global.version = require 'overrides.version' -- The current version for exp gaming scenario
|
|
||||||
inspect = require 'overrides.inspect' -- Used to covert any value into human readable string
|
|
||||||
Debug = require 'overrides.debug' -- Global Debug module
|
|
||||||
_C = require 'expcore.common' -- _C is used to store lots of common functions expected to be used
|
|
||||||
_CHEATS = false
|
|
||||||
_DEBUG = false
|
|
||||||
|
|
||||||
-- Please go to config/file_loader.lua to edit the files that are loaded
|
-- Please go to config/file_loader.lua to edit the files that are loaded
|
||||||
log('[INFO] Reading loader config')
|
log('[INFO] Reading loader config')
|
||||||
local files = require 'config._file_loader'
|
local files = require("modules.exp_legacy.config._file_loader")
|
||||||
|
|
||||||
-- Error handler for loading files
|
-- Error handler for loading files
|
||||||
local errors = {}
|
local errors = {}
|
||||||
@@ -44,14 +37,14 @@ local total_file_count = string.format('%3d', #files)
|
|||||||
for index, path in pairs(files) do
|
for index, path in pairs(files) do
|
||||||
currently_loading = path
|
currently_loading = path
|
||||||
log(string.format('[INFO] Loading file %3d/%s (%s)', index, total_file_count, path))
|
log(string.format('[INFO] Loading file %3d/%s (%s)', index, total_file_count, path))
|
||||||
xpcall(require, error_handler, path)
|
xpcall(require, error_handler, "modules.exp_legacy." .. path)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Override the default require; require can no longer load new scripts
|
|
||||||
log('[INFO] Require Overwrite! No more requires can be made!')
|
|
||||||
require 'overrides.require'
|
|
||||||
|
|
||||||
-- Logs all errors again to make it make it easy to find
|
-- Logs all errors again to make it make it easy to find
|
||||||
log('[INFO] All files loaded with '..error_count..' errors:')
|
log('[INFO] All files loaded with '..error_count..' errors:')
|
||||||
for _, error in ipairs(errors) do log(error) end
|
for _, error in ipairs(errors) do log(error) end
|
||||||
log('[END] -----| Explosive Gaming Scenario Loader |-----')
|
log('[END] -----| Explosive Gaming Scenario Loader |-----')
|
||||||
|
|
||||||
|
--- Register all event handlers via clusterio
|
||||||
|
local Event = require("modules/exp_legacy/utils/event")
|
||||||
|
return Event.real_handlers
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
--[[-- Core Module - Async
|
|
||||||
- An extention of task and token to allow a single require to register and run async functions.
|
|
||||||
@core Async
|
|
||||||
@alias Async
|
|
||||||
|
|
||||||
@usage
|
|
||||||
-- To use Async you must register the allowed functions when the file is loaded, often this will just be giving access to
|
|
||||||
-- some functions within a module if you expect that at part may be blocked by in game permissions or a custom system you have made
|
|
||||||
-- you may also want to register functions that you want to have a time delay, such as waiting 2 seconds before printing a message
|
|
||||||
|
|
||||||
-- When player.admin is called (either command or gui element event) by a player who isnt admin then it will error
|
|
||||||
-- here we register the function to promote the player so that it will run async and outside the player scope
|
|
||||||
local promote_player =
|
|
||||||
Async.register(function(player)
|
|
||||||
player.admin = true
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- This will allow us to bypass the error by running one tick later outside of any player scope
|
|
||||||
Async(promote_player, game.player)
|
|
||||||
|
|
||||||
-- Here we make an sync function that we want to have a delay, note the delay is not defined here
|
|
||||||
local print_message =
|
|
||||||
Async.register(function(player, message)
|
|
||||||
player.print(message)
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- We can then call the async function with a delay using the wait function
|
|
||||||
Async.wait(60, print_message, game.player, 'One second has passed!')
|
|
||||||
|
|
||||||
]]
|
|
||||||
local Task = require 'utils.task' --- @dep utils.task
|
|
||||||
local Token = require 'utils.token' --- @dep utils.token
|
|
||||||
|
|
||||||
local Async = {}
|
|
||||||
|
|
||||||
local internal_run =
|
|
||||||
Token.register(function(params)
|
|
||||||
local func = Token.get(params.token)
|
|
||||||
return func(table.unpack(params.params))
|
|
||||||
end)
|
|
||||||
|
|
||||||
--[[-- Register a new async function, must called when the file is loaded
|
|
||||||
@function register
|
|
||||||
@tparam function callback the function that can be called as an async function
|
|
||||||
@treturn string the uid of the async function which can be passed to Async.run and Async.wait
|
|
||||||
|
|
||||||
@usage-- Registering a function to set the admin state of a player
|
|
||||||
local set_admin =
|
|
||||||
Async.register(function(player, state)
|
|
||||||
if player.valid then
|
|
||||||
player.admin = state
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
@usage-- Registering a function to print to a player
|
|
||||||
local print_to_player =
|
|
||||||
Async.register(function(player, message)
|
|
||||||
if player.valid then
|
|
||||||
player.print(message)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
]]
|
|
||||||
Async.register = Token.register
|
|
||||||
|
|
||||||
--[[-- Runs an async function, you may supply any number of arguments as required by that function
|
|
||||||
@tparam string token the token of the async function you want to run
|
|
||||||
@tparam[opt] any ... the other params that you want to pass to your function
|
|
||||||
|
|
||||||
@usage-- Make a player admin regardless of if you are admin
|
|
||||||
Async.run(set_admin, player, true)
|
|
||||||
|
|
||||||
]]
|
|
||||||
function Async.run(token, ...)
|
|
||||||
Task.queue_task(internal_run, {
|
|
||||||
token = token,
|
|
||||||
params = {...}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
--[[-- Runs an async function after the given number of ticks, you may supply any number of arguments as required by that function
|
|
||||||
@tparam number ticks the number of ticks that you want the function to run after
|
|
||||||
@tparam string token the token of the async function you want to run
|
|
||||||
@tparam[opt] any ... the other params that you want to pass to your function
|
|
||||||
|
|
||||||
@usage-- Print a message to a player after 5 seconds
|
|
||||||
Async.wait(300, print_to_player, 'Hello, World!')
|
|
||||||
|
|
||||||
]]
|
|
||||||
function Async.wait(ticks, token, ...)
|
|
||||||
Task.set_timeout_in_ticks(ticks, internal_run, {
|
|
||||||
token = token,
|
|
||||||
params = {...}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
return setmetatable(Async, {
|
|
||||||
__call = function(self, ...)
|
|
||||||
self.run(...)
|
|
||||||
end
|
|
||||||
})
|
|
||||||
@@ -185,7 +185,6 @@ end)
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
|
||||||
local player_return, write_json = _C.player_return, _C.write_json --- @dep expcore.common
|
local player_return, write_json = _C.player_return, _C.write_json --- @dep expcore.common
|
||||||
local trace = debug.traceback
|
local trace = debug.traceback
|
||||||
|
|
||||||
@@ -392,20 +391,13 @@ local commands = Commands.get()
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
function Commands.get(player)
|
function Commands.get(player)
|
||||||
player = Game.get_player_from_any(player)
|
if not player then return Commands.commands end
|
||||||
|
|
||||||
if not player then
|
|
||||||
return Commands.commands
|
|
||||||
end
|
|
||||||
|
|
||||||
local allowed = {}
|
local allowed = {}
|
||||||
|
|
||||||
for name, command_data in pairs(Commands.commands) do
|
for name, command_data in pairs(Commands.commands) do
|
||||||
if Commands.authorize(player, name) then
|
if Commands.authorize(player, name) then
|
||||||
allowed[name] = command_data
|
allowed[name] = command_data
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return allowed
|
return allowed
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -425,7 +417,6 @@ function Commands.search(keyword, player)
|
|||||||
local custom_commands = Commands.get(player)
|
local custom_commands = Commands.get(player)
|
||||||
local matches = {}
|
local matches = {}
|
||||||
keyword = keyword:lower()
|
keyword = keyword:lower()
|
||||||
|
|
||||||
-- Loops over custom commands
|
-- Loops over custom commands
|
||||||
for name, command_data in pairs(custom_commands) do
|
for name, command_data in pairs(custom_commands) do
|
||||||
-- combines name help and aliases into one message to be searched
|
-- combines name help and aliases into one message to be searched
|
||||||
@@ -435,7 +426,6 @@ function Commands.search(keyword, player)
|
|||||||
matches[name] = command_data
|
matches[name] = command_data
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Loops over the names of game commands
|
-- Loops over the names of game commands
|
||||||
for name, description in pairs(commands.game_commands) do
|
for name, description in pairs(commands.game_commands) do
|
||||||
if name:lower():match(keyword) then
|
if name:lower():match(keyword) then
|
||||||
@@ -448,7 +438,6 @@ function Commands.search(keyword, player)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return matches
|
return matches
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -480,9 +469,7 @@ function Commands.new_command(name, help, descr)
|
|||||||
}, {
|
}, {
|
||||||
__index = Commands._prototype
|
__index = Commands._prototype
|
||||||
})
|
})
|
||||||
|
|
||||||
Commands.commands[name] = command
|
Commands.commands[name] = command
|
||||||
|
|
||||||
return command
|
return command
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
@alias Common
|
@alias Common
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Colours = require 'utils.color_presets' --- @dep utils.color_presets
|
local Colours = require("modules/exp_util/include/color")
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
local Game = require("modules.exp_legacy.utils.game") --- @dep utils.game
|
||||||
|
|
||||||
local Common = {}
|
local Common = {}
|
||||||
|
|
||||||
@@ -138,21 +138,12 @@ end
|
|||||||
--- Will raise an error if called during runtime
|
--- Will raise an error if called during runtime
|
||||||
-- @usage error_if_runtime()
|
-- @usage error_if_runtime()
|
||||||
function Common.error_if_runtime()
|
function Common.error_if_runtime()
|
||||||
if _LIFECYCLE == 8 then
|
if package.lifecycle == 8 then
|
||||||
local function_name = debug.getinfo(2, 'n').name or '<anon>'
|
local function_name = debug.getinfo(2, 'n').name or '<anon>'
|
||||||
error(function_name..' can not be called during runtime', 3)
|
error(function_name..' can not be called during runtime', 3)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Will raise an error if the function is a closure
|
|
||||||
-- @usage error_if_runetime_closure(func)
|
|
||||||
function Common.error_if_runetime_closure(func)
|
|
||||||
if _LIFECYCLE == 8 and Debug.is_closure(func) then
|
|
||||||
local function_name = debug.getinfo(2, 'n').name or '<anon>'
|
|
||||||
error(function_name..' can not be called during runtime with a closure', 3)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Value Returns.
|
--- Value Returns.
|
||||||
-- @section valueReturns
|
-- @section valueReturns
|
||||||
|
|
||||||
@@ -255,7 +246,7 @@ local file_path = get_file_path()
|
|||||||
]]
|
]]
|
||||||
function Common.get_file_path(offset)
|
function Common.get_file_path(offset)
|
||||||
offset = offset or 0
|
offset = offset or 0
|
||||||
return debug.getinfo(offset+2, 'S').source:match('^.+/currently%-playing/(.+)$'):sub(1, -5)
|
return debug.getinfo(offset+2, 'S').short_src:sub(10, -5)
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[-- Converts a table to an enum
|
--[[-- Converts a table to an enum
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ PlayerData.Statistics:combine('JoinCount')
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Storage = require("modules/exp_util/storage")
|
||||||
|
|
||||||
local DatastoreManager = {}
|
local DatastoreManager = {}
|
||||||
local Datastores = {}
|
local Datastores = {}
|
||||||
@@ -156,9 +156,8 @@ local copy = table.deep_copy
|
|||||||
local trace = debug.traceback
|
local trace = debug.traceback
|
||||||
|
|
||||||
--- Save datastores in the global table
|
--- Save datastores in the global table
|
||||||
global.datastores = Data
|
Storage.register(Data, function(tbl)
|
||||||
Event.on_load(function()
|
Data = tbl
|
||||||
Data = global.datastores
|
|
||||||
for datastoreName, datastore in pairs(Datastores) do
|
for datastoreName, datastore in pairs(Datastores) do
|
||||||
datastore.data = Data[datastoreName]
|
datastore.data = Data[datastoreName]
|
||||||
end
|
end
|
||||||
@@ -187,7 +186,7 @@ local ExampleData = Datastore.connect('ExampleData', true) -- saveToDisk
|
|||||||
]]
|
]]
|
||||||
function DatastoreManager.connect(datastoreName, saveToDisk, autoSave, propagateChanges)
|
function DatastoreManager.connect(datastoreName, saveToDisk, autoSave, propagateChanges)
|
||||||
if Datastores[datastoreName] then return Datastores[datastoreName] end
|
if Datastores[datastoreName] then return Datastores[datastoreName] end
|
||||||
if _LIFECYCLE ~= _STAGE.control then
|
if package.lifecycle ~= package.lifecycle_stage.control then
|
||||||
-- Only allow this function to be called during the control stage
|
-- Only allow this function to be called during the control stage
|
||||||
error('New datastore connection can not be created during runtime', 2)
|
error('New datastore connection can not be created during runtime', 2)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
@alias External
|
@alias External
|
||||||
|
|
||||||
@usage-- Printing all server to chat
|
@usage-- Printing all server to chat
|
||||||
local External = require 'expcore.external' --- @dep expcore.external
|
local External = require("modules.exp_legacy.expcore.external") --- @dep expcore.external
|
||||||
|
|
||||||
local message = 'id: %s name: %s version: %s status: %s'
|
local message = 'id: %s name: %s version: %s status: %s'
|
||||||
for server_id, server in pairs(External.get_servers()) do
|
for server_id, server in pairs(External.get_servers()) do
|
||||||
@@ -29,11 +29,11 @@ end
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
function External.valid()
|
function External.valid()
|
||||||
if global.ext == nil then return false end
|
if storage.ext == nil then return false end
|
||||||
if ext == global.ext and var == ext.var then
|
if ext == storage.ext and var == ext.var then
|
||||||
return var ~= nil
|
return var ~= nil
|
||||||
else
|
else
|
||||||
ext = global.ext
|
ext = storage.ext
|
||||||
var = ext.var
|
var = ext.var
|
||||||
return var ~= nil
|
return var ~= nil
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
return require 'expcore.gui._require'
|
return require("modules.exp_legacy.expcore.gui._require")
|
||||||
|
|||||||
@@ -121,15 +121,15 @@ end)
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Gui = require 'expcore.gui.prototype'
|
local Gui = require("modules.exp_legacy.expcore.gui.prototype")
|
||||||
require 'expcore.gui.helper_functions'
|
require("modules.exp_legacy.expcore.gui.helper_functions")
|
||||||
require 'expcore.gui.core_defines'
|
require("modules.exp_legacy.expcore.gui.core_defines")
|
||||||
require 'expcore.gui.top_flow'
|
require("modules.exp_legacy.expcore.gui.top_flow")
|
||||||
require 'expcore.gui.left_flow'
|
require("modules.exp_legacy.expcore.gui.left_flow")
|
||||||
require 'expcore.gui.defines'
|
require("modules.exp_legacy.expcore.gui.defines")
|
||||||
|
|
||||||
local Roles = _C.opt_require('expcore.roles')
|
local Roles = _C.opt_require("modules.exp_legacy.expcore.roles")
|
||||||
local Event = _C.opt_require('utils.event')
|
local Event = _C.opt_require("modules/exp_legacy/utils/event")
|
||||||
|
|
||||||
if Roles and Event then
|
if Roles and Event then
|
||||||
Event.add(Roles.events.on_role_assigned, function(e)
|
Event.add(Roles.events.on_role_assigned, function(e)
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
@module Gui
|
@module Gui
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Gui = require 'expcore.gui.prototype'
|
local Gui = require("modules.exp_legacy.expcore.gui.prototype")
|
||||||
local Event = require 'utils.event'
|
local Event = require("modules/exp_legacy/utils/event")
|
||||||
|
|
||||||
--- Core Defines.
|
--- Core Defines.
|
||||||
-- @section coreDefines
|
-- @section coreDefines
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
@module Gui
|
@module Gui
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Gui = require 'expcore.gui.prototype'
|
local Gui = require("modules.exp_legacy.expcore.gui.prototype")
|
||||||
|
|
||||||
--- Defines.
|
--- Defines.
|
||||||
-- @section defines
|
-- @section defines
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
@module Gui
|
@module Gui
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Gui = require 'expcore.gui.prototype'
|
local Gui = require("modules.exp_legacy.expcore.gui.prototype")
|
||||||
|
|
||||||
--- Helper Functions.
|
--- Helper Functions.
|
||||||
-- @section helperFunctions
|
-- @section helperFunctions
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
@module Gui
|
@module Gui
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Gui = require 'expcore.gui.prototype'
|
local Gui = require("modules.exp_legacy.expcore.gui.prototype")
|
||||||
local mod_gui = require 'mod-gui'
|
local mod_gui = require 'mod-gui'
|
||||||
|
|
||||||
local hide_left_flow = Gui.core_defines.hide_left_flow.name
|
local hide_left_flow = Gui.core_defines.hide_left_flow.name
|
||||||
@@ -89,7 +89,7 @@ end
|
|||||||
function Gui.inject_left_flow_order(provider)
|
function Gui.inject_left_flow_order(provider)
|
||||||
Gui.get_left_flow_order = provider
|
Gui.get_left_flow_order = provider
|
||||||
local debug_info = debug.getinfo(2, "Sn")
|
local debug_info = debug.getinfo(2, "Sn")
|
||||||
local file_name = debug_info.source:match('^.+/currently%-playing/(.+)$'):sub(1, -5)
|
local file_name = debug_info.short_src:sub(10, -5)
|
||||||
local func_name = debug_info.name or ("<anonymous:"..debug_info.linedefined..">")
|
local func_name = debug_info.name or ("<anonymous:"..debug_info.linedefined..">")
|
||||||
Gui._left_flow_order_src = file_name..":"..func_name
|
Gui._left_flow_order_src = file_name..":"..func_name
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
@module Gui
|
@module Gui
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
|
|
||||||
local Gui = {
|
local Gui = {
|
||||||
--- The current highest uid that is being used by a define, will not increase during runtime
|
--- The current highest uid that is being used by a define, will not increase during runtime
|
||||||
@@ -58,7 +58,7 @@ end
|
|||||||
--- Get where a function was defined as a string
|
--- Get where a function was defined as a string
|
||||||
local function get_defined_at(level)
|
local function get_defined_at(level)
|
||||||
local debug_info = debug.getinfo(level, "Sn")
|
local debug_info = debug.getinfo(level, "Sn")
|
||||||
local file_name = debug_info.source:match('^.+/currently%-playing/(.+)$'):sub(1, -5)
|
local file_name = debug_info.short_src:sub(10, -5)
|
||||||
local func_name = debug_info.name or ("<anonymous:"..debug_info.linedefined..">")
|
local func_name = debug_info.name or ("<anonymous:"..debug_info.linedefined..">")
|
||||||
return file_name..":"..func_name
|
return file_name..":"..func_name
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
@module Gui
|
@module Gui
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Gui = require 'expcore.gui.prototype'
|
local Gui = require("modules.exp_legacy.expcore.gui.prototype")
|
||||||
local mod_gui = require 'mod-gui' --- @dep mod-gui
|
local mod_gui = require 'mod-gui' --- @dep mod-gui
|
||||||
|
|
||||||
local toolbar_button_size = 36
|
local toolbar_button_size = 36
|
||||||
@@ -107,7 +107,7 @@ end
|
|||||||
function Gui.inject_top_flow_order(provider)
|
function Gui.inject_top_flow_order(provider)
|
||||||
Gui.get_top_flow_order = provider
|
Gui.get_top_flow_order = provider
|
||||||
local debug_info = debug.getinfo(2, "Sn")
|
local debug_info = debug.getinfo(2, "Sn")
|
||||||
local file_name = debug_info.source:match('^.+/currently%-playing/(.+)$'):sub(1, -5)
|
local file_name = debug_info.short_src:sub(10, -5)
|
||||||
local func_name = debug_info.name or ("<anonymous:"..debug_info.linedefined..">")
|
local func_name = debug_info.name or ("<anonymous:"..debug_info.linedefined..">")
|
||||||
Gui._top_flow_order_src = file_name..":"..func_name
|
Gui._top_flow_order_src = file_name..":"..func_name
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ Permission_Groups.new_group('Restricted') -- this defines a new group called "Re
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
|
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
local Game = require("modules.exp_legacy.utils.game") --- @dep utils.game
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Async = require 'expcore.async' --- @dep expcore.async
|
local Async = require("modules/exp_util/async")
|
||||||
|
|
||||||
local Permissions_Groups = {
|
local Permissions_Groups = {
|
||||||
groups={}, -- store for the different groups that are created
|
groups={}, -- store for the different groups that are created
|
||||||
@@ -34,18 +34,18 @@ local Permissions_Groups = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- Async function to add players to permission groups
|
-- Async function to add players to permission groups
|
||||||
local add_to_permission_group =
|
local add_to_permission_group_async =
|
||||||
Async.register(function(permission_group, player)
|
Async.register(function(permission_group, player)
|
||||||
permission_group.add_player(player)
|
permission_group.add_player(player)
|
||||||
end)
|
end)
|
||||||
Permissions_Groups.async_token_add_to_permission_group = add_to_permission_group
|
Permissions_Groups.add_to_permission_group_async = add_to_permission_group_async
|
||||||
|
|
||||||
-- Async function to remove players from permission groups
|
-- Async function to remove players from permission groups
|
||||||
local remove_from_permission_group =
|
local remove_from_permission_group_async =
|
||||||
Async.register(function(permission_group, player)
|
Async.register(function(permission_group, player)
|
||||||
permission_group.remove_player(player)
|
permission_group.remove_player(player)
|
||||||
end)
|
end)
|
||||||
Permissions_Groups.async_token_remove_from_permission_group = remove_from_permission_group
|
Permissions_Groups.remove_from_permission_group_async = remove_from_permission_group_async
|
||||||
|
|
||||||
--- Getters.
|
--- Getters.
|
||||||
-- Functions that get permission groups
|
-- Functions that get permission groups
|
||||||
@@ -286,7 +286,7 @@ function Permissions_Groups._prototype:add_player(player)
|
|||||||
player = Game.get_player_from_any(player)
|
player = Game.get_player_from_any(player)
|
||||||
local group = self:get_raw()
|
local group = self:get_raw()
|
||||||
if not group or not player then return false end
|
if not group or not player then return false end
|
||||||
Async(add_to_permission_group, group, player)
|
add_to_permission_group_async(group, player)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -302,7 +302,7 @@ function Permissions_Groups._prototype:remove_player(player)
|
|||||||
player = Game.get_player_from_any(player)
|
player = Game.get_player_from_any(player)
|
||||||
local group = self:get_raw()
|
local group = self:get_raw()
|
||||||
if not group or not player then return false end
|
if not group or not player then return false end
|
||||||
Async(remove_from_permission_group, group, player)
|
remove_from_permission_group_async(group, player)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
@core PlayerData
|
@core PlayerData
|
||||||
|
|
||||||
@usage-- Adding a colour setting for players
|
@usage-- Adding a colour setting for players
|
||||||
local PlayerData = require 'expcore.player_data'
|
local PlayerData = require("modules.exp_legacy.expcore.player_data")
|
||||||
local PlayerColors = PlayerData.Settings:combine('Color')
|
local PlayerColors = PlayerData.Settings:combine('Color')
|
||||||
|
|
||||||
-- Set the players color when their data is loaded
|
-- Set the players color when their data is loaded
|
||||||
@@ -19,8 +19,8 @@ PlayerColors:on_save(function(player_name, _)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
@usage-- Add a playtime statistic for players
|
@usage-- Add a playtime statistic for players
|
||||||
local Event = require 'utils.event'
|
local Event = require("modules/exp_legacy/utils/event")
|
||||||
local PlayerData = require 'expcore.player_data'
|
local PlayerData = require("modules.exp_legacy.expcore.player_data")
|
||||||
local Playtime = PlayerData.Statistics:combine('Playtime')
|
local Playtime = PlayerData.Statistics:combine('Playtime')
|
||||||
|
|
||||||
-- When playtime reaches an hour interval tell the player and say thanks
|
-- When playtime reaches an hour interval tell the player and say thanks
|
||||||
@@ -41,11 +41,11 @@ end)
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Async = require("modules/exp_util/async")
|
||||||
local Async = require 'expcore.async' --- @dep expcore.async
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Datastore = require 'expcore.datastore' --- @dep expcore.datastore
|
local Datastore = require("modules.exp_legacy.expcore.datastore") --- @dep expcore.datastore
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse' --- @dep config.expcore.command_general_parse
|
require("modules.exp_legacy.config.expcore.command_general_parse") --- @dep config.expcore.command_general_parse
|
||||||
|
|
||||||
--- Common player data that acts as the root store for player data
|
--- Common player data that acts as the root store for player data
|
||||||
local PlayerData = Datastore.connect('PlayerData', true) -- saveToDisk
|
local PlayerData = Datastore.connect('PlayerData', true) -- saveToDisk
|
||||||
@@ -86,7 +86,8 @@ Commands.new_command('save-data', 'Writes all your player data to a file on your
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
--- Async function called after 5 seconds with no player data loaded
|
--- Async function called after 5 seconds with no player data loaded
|
||||||
local check_data_loaded = Async.register(function(player)
|
local check_data_loaded_async =
|
||||||
|
Async.register(function(player)
|
||||||
local player_data = PlayerData:get(player)
|
local player_data = PlayerData:get(player)
|
||||||
if not player_data or not player_data.valid then
|
if not player_data or not player_data.valid then
|
||||||
player.print{'expcore-data.data-failed'}
|
player.print{'expcore-data.data-failed'}
|
||||||
@@ -127,7 +128,7 @@ end)
|
|||||||
--- Load player data when they join
|
--- Load player data when they join
|
||||||
Event.add(defines.events.on_player_joined_game, function(event)
|
Event.add(defines.events.on_player_joined_game, function(event)
|
||||||
local player = game.players[event.player_index]
|
local player = game.players[event.player_index]
|
||||||
Async.wait(300, check_data_loaded, player)
|
check_data_loaded_async:start_after(300, player)
|
||||||
PlayerData:raw_set(player.name)
|
PlayerData:raw_set(player.name)
|
||||||
PlayerData:request(player)
|
PlayerData:request(player)
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -108,12 +108,12 @@ Roles.define_role_order{
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
local Async = require("modules/exp_util/async")
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Game = require("modules.exp_legacy.utils.game") --- @dep utils.game
|
||||||
local Groups = require 'expcore.permission_groups' --- @dep expcore.permission_groups
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Async = require 'expcore.async' --- @dep expcore.async
|
local Groups = require("modules.exp_legacy.expcore.permission_groups") --- @dep expcore.permission_groups
|
||||||
local Colours = require 'utils.color_presets' --- @dep utils.color_presets
|
local Colours = require("modules/exp_util/include/color")
|
||||||
local write_json = _C.write_json --- @dep expcore.common
|
local write_json = _C.write_json --- @dep expcore.common
|
||||||
|
|
||||||
local Roles = {
|
local Roles = {
|
||||||
@@ -134,7 +134,10 @@ local Roles = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
--- When global is loaded it will have the metatable re-assigned to the roles
|
--- When global is loaded it will have the metatable re-assigned to the roles
|
||||||
Global.register({ Roles.config.players, Roles.config.deferred_roles }, function(tbl)
|
Storage.register({
|
||||||
|
Roles.config.players,
|
||||||
|
Roles.config.deferred_roles
|
||||||
|
}, function(tbl)
|
||||||
Roles.config.players = tbl[1]
|
Roles.config.players = tbl[1]
|
||||||
Roles.config.deferred_roles = tbl[2]
|
Roles.config.deferred_roles = tbl[2]
|
||||||
end)
|
end)
|
||||||
@@ -652,7 +655,6 @@ end)
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
function Roles.define_flag_trigger(name, callback)
|
function Roles.define_flag_trigger(name, callback)
|
||||||
_C.error_if_runtime()
|
|
||||||
Roles.config.flags[name] = Async.register(callback)
|
Roles.config.flags[name] = Async.register(callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1076,9 +1078,9 @@ end
|
|||||||
local function role_update(event)
|
local function role_update(event)
|
||||||
local player = game.players[event.player_index]
|
local player = game.players[event.player_index]
|
||||||
-- Updates flags given to the player
|
-- Updates flags given to the player
|
||||||
for flag, async_token in pairs(Roles.config.flags) do
|
for flag, async_function in pairs(Roles.config.flags) do
|
||||||
local state = Roles.player_has_flag(player, flag)
|
local state = Roles.player_has_flag(player, flag)
|
||||||
Async(async_token, player, state)
|
async_function(player, state)
|
||||||
end
|
end
|
||||||
-- Updates the players permission group
|
-- Updates the players permission group
|
||||||
local highest = Roles.get_player_highest_role(player)
|
local highest = Roles.get_player_highest_role(player)
|
||||||
@@ -1086,7 +1088,7 @@ local function role_update(event)
|
|||||||
if highest.permission_group[1] then
|
if highest.permission_group[1] then
|
||||||
local group = game.permissions.get_group(highest.permission_group[2])
|
local group = game.permissions.get_group(highest.permission_group[2])
|
||||||
if group then
|
if group then
|
||||||
Async(Groups.async_token_add_to_permission_group, group, player)
|
Groups.add_to_permission_group_async(group, player)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Groups.set_player_group(player, highest.permission_group)
|
Groups.set_player_group(player, highest.permission_group)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
"require": [
|
"require": [
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"clusterio": "*"
|
"clusterio": "*",
|
||||||
|
"exp_util": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
--- Adds a better method of player starting items based on production levels.
|
--- Adds a better method of player starting items based on production levels.
|
||||||
-- @addon Advanced-Start
|
-- @addon Advanced-Start
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local config = require 'config.advanced_start' --- @dep config.advanced_start
|
local config = require("modules.exp_legacy.config.advanced_start") --- @dep config.advanced_start
|
||||||
local items = config.items
|
local items = config.items
|
||||||
|
|
||||||
Event.add(defines.events.on_player_created, function(event)
|
Event.add(defines.events.on_player_created, function(event)
|
||||||
@@ -43,7 +43,7 @@ Event.on_init(function()
|
|||||||
remote.call('freeplay', 'set_skip_intro', config.skip_intro)
|
remote.call('freeplay', 'set_skip_intro', config.skip_intro)
|
||||||
if config.research_queue_from_start then
|
if config.research_queue_from_start then
|
||||||
for _, force in pairs(game.forces) do
|
for _, force in pairs(game.forces) do
|
||||||
force.research_queue_enabled = true
|
--force.research_queue_enabled = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not config.disable_base_game_silo_script then
|
if not config.disable_base_game_silo_script then
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
--- Kicks players when all players on the server are afk
|
--- Kicks players when all players on the server are afk
|
||||||
-- @addon afk-kick
|
-- @addon afk-kick
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Async = require("modules/exp_util/async")
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local config = require 'config.afk_kick' --- @dep config.afk_kick
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Async = require 'expcore.async' --- @dep expcore.async
|
local config = require("modules.exp_legacy.config.afk_kick") --- @dep config.afk_kick
|
||||||
|
|
||||||
--- Optional roles require
|
--- Optional roles require
|
||||||
local Roles
|
local Roles
|
||||||
if config.active_role then
|
if config.active_role then
|
||||||
Roles = require 'expcore.roles'
|
Roles = require("modules.exp_legacy.expcore.roles")
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Globals
|
--- Globals
|
||||||
local primitives = { last_active = 0 }
|
local primitives = { last_active = 0 }
|
||||||
Global.register(primitives, function(tbl)
|
Storage.register(primitives, function(tbl)
|
||||||
primitives = tbl
|
primitives = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--- Kicks an afk player, used to add a delay so the gui has time to appear
|
--- Kicks an afk player, used to add a delay so the gui has time to appear
|
||||||
local kick_player =
|
local kick_player_async =
|
||||||
Async.register(function(player)
|
Async.register(function(player)
|
||||||
if game.tick - primitives.last_active < config.kick_time then return end -- Safety Catch
|
if game.tick - primitives.last_active < config.kick_time then return end -- Safety Catch
|
||||||
game.kick_player(player, 'AFK while no active players on the server')
|
game.kick_player(player, 'AFK while no active players on the server')
|
||||||
@@ -54,7 +54,7 @@ Event.on_nth_tick(config.update_time, function()
|
|||||||
}.location = { x=res.width*(0.5 - 0.11*uis), y=res.height*(0.5 - 0.14*uis) }
|
}.location = { x=res.width*(0.5 - 0.11*uis), y=res.height*(0.5 - 0.14*uis) }
|
||||||
|
|
||||||
-- Kick the player, some delay needed because network delay
|
-- Kick the player, some delay needed because network delay
|
||||||
Async.wait(10, kick_player, player)
|
kick_player_async:start_after(10, player)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
-- also displays a ping above users who are named in the message
|
-- also displays a ping above users who are named in the message
|
||||||
-- @addon Chat-Popups
|
-- @addon Chat-Popups
|
||||||
|
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
local FloatingText = require("modules/exp_util/floating_text")
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local config = require 'config.popup_messages' --- @dep config.popup_messages
|
local config = require("modules.exp_legacy.config.popup_messages") --- @dep config.popup_messages
|
||||||
|
|
||||||
local send_text = Game.print_player_floating_text -- (player_index, text, color)
|
local send_text = FloatingText.print_as_player -- (player, text)
|
||||||
|
|
||||||
Event.add(defines.events.on_console_chat, function(event)
|
Event.add(defines.events.on_console_chat, function(event)
|
||||||
if not event.player_index or event.player_index < 1 then return end
|
if not event.player_index or event.player_index < 1 then return end
|
||||||
@@ -18,7 +18,7 @@ Event.add(defines.events.on_console_chat, function(event)
|
|||||||
|
|
||||||
-- Sends the message as text above them
|
-- Sends the message as text above them
|
||||||
if config.show_player_messages then
|
if config.show_player_messages then
|
||||||
send_text(player.index, {'chat-popup.message', player.name, event.message}, player.chat_color)
|
send_text(player, {'chat-popup.message', player.name, event.message})
|
||||||
end
|
end
|
||||||
|
|
||||||
if not config.show_player_mentions then return end
|
if not config.show_player_mentions then return end
|
||||||
@@ -30,7 +30,7 @@ Event.add(defines.events.on_console_chat, function(event)
|
|||||||
for _, mentioned_player in pairs(game.connected_players) do
|
for _, mentioned_player in pairs(game.connected_players) do
|
||||||
if mentioned_player.index ~= player.index then
|
if mentioned_player.index ~= player.index then
|
||||||
if search_string:find(mentioned_player.name:lower(), 1, true) then
|
if search_string:find(mentioned_player.name:lower(), 1, true) then
|
||||||
send_text(mentioned_player.index, {'chat-popup.ping', player.name}, player.chat_color)
|
send_text(mentioned_player, {'chat-popup.ping', player.name})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
--- Adds auto replies to chat messages; as well as chat commands
|
--- Adds auto replies to chat messages; as well as chat commands
|
||||||
-- @addon Chat-Reply
|
-- @addon Chat-Reply
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
local config = require 'config.chat_reply' --- @dep config.chat_reply
|
local config = require("modules.exp_legacy.config.chat_reply") --- @dep config.chat_reply
|
||||||
|
|
||||||
Event.add(defines.events.on_console_chat, function(event)
|
Event.add(defines.events.on_console_chat, function(event)
|
||||||
local player_index = event.player_index
|
local player_index = event.player_index
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
--- Adds a compilatron that walks around the spawn area; adapted from redmew code
|
--- Adds a compilatron that walks around the spawn area; adapted from redmew code
|
||||||
-- @addon Compilatron
|
-- @addon Compilatron
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Async = require("modules/exp_util/async")
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Task = require 'utils.task' --- @dep utils.task
|
local Storage = require("modules/exp_util/storage")
|
||||||
local Token = require 'utils.token' --- @dep utils.token
|
local config = require("modules.exp_legacy.config.compilatron") --- @dep config.compilatron
|
||||||
local config = require 'config.compilatron' --- @dep config.compilatron
|
|
||||||
local messages = config.messages
|
local messages = config.messages
|
||||||
local locations = config.locations
|
local locations = config.locations
|
||||||
|
|
||||||
@@ -14,7 +13,7 @@ local Public = {
|
|||||||
current_messages={}
|
current_messages={}
|
||||||
}
|
}
|
||||||
|
|
||||||
Global.register({
|
Storage.register({
|
||||||
compilatrons = Public.compilatrons,
|
compilatrons = Public.compilatrons,
|
||||||
current_messages = Public.current_messages
|
current_messages = Public.current_messages
|
||||||
}, function(tbl)
|
}, function(tbl)
|
||||||
@@ -22,20 +21,21 @@ Global.register({
|
|||||||
Public.current_messages = tbl.current_messages
|
Public.current_messages = tbl.current_messages
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--- This will re-create the speech bubble after it de-spawns called with set_timeout
|
local speech_bubble_async =
|
||||||
local callback =
|
Async.register(function(data)
|
||||||
Token.register(
|
local message =
|
||||||
function(data)
|
data.entity.surface.create_entity{
|
||||||
local ent = data.ent
|
name = 'compi-speech-bubble',
|
||||||
local name = data.name
|
text = messages[data.name][data.msg_number],
|
||||||
local msg_number = data.msg_number
|
source = data.entity,
|
||||||
local message =
|
position = {0, 0},
|
||||||
ent.surface.create_entity(
|
}
|
||||||
{name = 'compi-speech-bubble', text = messages[name][msg_number], position = {0, 0}, source = ent}
|
|
||||||
)
|
Public.current_messages[data.name] = {
|
||||||
Public.current_messages[name] = {message = message, msg_number = msg_number}
|
message = message,
|
||||||
end
|
msg_number = data.msg_number
|
||||||
)
|
}
|
||||||
|
end)
|
||||||
|
|
||||||
--- This will move the messages onto the next message in the loop
|
--- This will move the messages onto the next message in the loop
|
||||||
local function circle_messages()
|
local function circle_messages()
|
||||||
@@ -57,7 +57,7 @@ local function circle_messages()
|
|||||||
msg_number = 1
|
msg_number = 1
|
||||||
end
|
end
|
||||||
-- this calls the callback above to re-spawn the message after some time
|
-- this calls the callback above to re-spawn the message after some time
|
||||||
Task.set_timeout_in_ticks(300, callback, {ent = ent, name = name, msg_number = msg_number})
|
speech_bubble_async:start_after(300, {ent = ent, name = name, msg_number = msg_number})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
-- also shows player health when a player is attacked
|
-- also shows player health when a player is attacked
|
||||||
-- @addon Damage-Popups
|
-- @addon Damage-Popups
|
||||||
|
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
local FloatingText = require("modules/exp_util/floating_text")
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local config = require 'config.popup_messages' --- @dep config.popup_messages
|
local config = require("modules.exp_legacy.config.popup_messages") --- @dep config.popup_messages
|
||||||
|
|
||||||
Event.add(defines.events.on_entity_damaged, function(event)
|
Event.add(defines.events.on_entity_damaged, function(event)
|
||||||
local entity = event.entity
|
local entity = event.entity
|
||||||
@@ -31,7 +31,7 @@ Event.add(defines.events.on_entity_damaged, function(event)
|
|||||||
|
|
||||||
-- Outputs the message as floating text
|
-- Outputs the message as floating text
|
||||||
if message then
|
if message then
|
||||||
Game.print_floating_text(
|
FloatingText.print(
|
||||||
entity.surface,
|
entity.surface,
|
||||||
position,
|
position,
|
||||||
message,
|
message,
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
--- Makes markers on the map where places have died and reclaims items if not recovered
|
--- Makes markers on the map where places have died and reclaims items if not recovered
|
||||||
-- @addon Death-Logger
|
-- @addon Death-Logger
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local config = require 'config.death_logger' --- @dep config.death_logger
|
local config = require("modules.exp_legacy.config.death_logger") --- @dep config.death_logger
|
||||||
local format_time, move_items = _C.format_time, _C.move_items_stack --- @dep expcore.common
|
local format_time, move_items = _C.format_time, _C.move_items_stack --- @dep expcore.common
|
||||||
|
|
||||||
-- Max amount of ticks a corpse can be alive
|
-- Max amount of ticks a corpse can be alive
|
||||||
@@ -13,7 +13,7 @@ local deaths = {
|
|||||||
archive={} -- deaths moved here after body is gone
|
archive={} -- deaths moved here after body is gone
|
||||||
--{player_name='Cooldude2606', time_of_death='15H 15M', position={x=0, y=0}, corpse=LuaEntity, tag=LuaCustomChartTag}
|
--{player_name='Cooldude2606', time_of_death='15H 15M', position={x=0, y=0}, corpse=LuaEntity, tag=LuaCustomChartTag}
|
||||||
}
|
}
|
||||||
Global.register(deaths, function(tbl)
|
Storage.register(deaths, function(tbl)
|
||||||
deaths = tbl
|
deaths = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
--- Log certain actions into a file when events are triggered
|
--- Log certain actions into a file when events are triggered
|
||||||
-- @addon Deconlog
|
-- @addon Deconlog
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
local format_time = _C.format_time --- @dep expcore.common
|
local format_time = _C.format_time --- @dep expcore.common
|
||||||
local format_number = require('util').format_number --- @dep util
|
local format_number = require("util").format_number --- @dep util
|
||||||
local config = require 'config.deconlog' --- @dep config.deconlog
|
local config = require("modules.exp_legacy.config.deconlog") --- @dep config.deconlog
|
||||||
|
|
||||||
local filepath = "log/decon.log"
|
local filepath = "log/decon.log"
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
--- Sends alert messages to our discord server when certain events are triggered
|
--- Sends alert messages to our discord server when certain events are triggered
|
||||||
-- @addon Discord-Alerts
|
-- @addon Discord-Alerts
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Colors = require 'utils.color_presets' --- @dep utils.color_presets
|
local Colors = require("modules/exp_util/include/color")
|
||||||
local write_json, format_time = _C.write_json, _C.format_time --- @dep expcore.common
|
local write_json, format_time = _C.write_json, _C.format_time --- @dep expcore.common
|
||||||
local config = require 'config.discord_alerts' --- @dep config.discord_alerts
|
local config = require("modules.exp_legacy.config.discord_alerts") --- @dep config.discord_alerts
|
||||||
|
|
||||||
local playtime_format = {hours = true, minutes = true, short = true, string = true}
|
local playtime_format = {hours = true, minutes = true, short = true, string = true}
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ end
|
|||||||
|
|
||||||
--- Repeated protected entity mining
|
--- Repeated protected entity mining
|
||||||
if config.entity_protection then
|
if config.entity_protection then
|
||||||
local EntityProtection = require 'modules.control.protection' --- @dep modules.control.protection
|
local EntityProtection = require("modules.exp_legacy.modules.control.protection") --- @dep modules.control.protection
|
||||||
Event.add(EntityProtection.events.on_repeat_violation, function(event)
|
Event.add(EntityProtection.events.on_repeat_violation, function(event)
|
||||||
local player_name = get_player_name(event)
|
local player_name = get_player_name(event)
|
||||||
emit_event{
|
emit_event{
|
||||||
@@ -112,7 +112,7 @@ end
|
|||||||
|
|
||||||
--- Reports added and removed
|
--- Reports added and removed
|
||||||
if config.player_reports then
|
if config.player_reports then
|
||||||
local Reports = require 'modules.control.reports' --- @dep modules.control.reports
|
local Reports = require("modules.exp_legacy.modules.control.reports") --- @dep modules.control.reports
|
||||||
Event.add(Reports.events.on_player_reported, function(event)
|
Event.add(Reports.events.on_player_reported, function(event)
|
||||||
local player_name, by_player_name = get_player_name(event)
|
local player_name, by_player_name = get_player_name(event)
|
||||||
emit_event{
|
emit_event{
|
||||||
@@ -141,7 +141,7 @@ end
|
|||||||
|
|
||||||
--- Warnings added and removed
|
--- Warnings added and removed
|
||||||
if config.player_warnings then
|
if config.player_warnings then
|
||||||
local Warnings = require 'modules.control.warnings' --- @dep modules.control.warnings
|
local Warnings = require("modules.exp_legacy.modules.control.warnings") --- @dep modules.control.warnings
|
||||||
Event.add(Warnings.events.on_warning_added, function(event)
|
Event.add(Warnings.events.on_warning_added, function(event)
|
||||||
local player_name, by_player_name = get_player_name(event)
|
local player_name, by_player_name = get_player_name(event)
|
||||||
local player = game.get_player(player_name)
|
local player = game.get_player(player_name)
|
||||||
@@ -171,7 +171,7 @@ end
|
|||||||
|
|
||||||
--- When a player is jailed or unjailed
|
--- When a player is jailed or unjailed
|
||||||
if config.player_jail then
|
if config.player_jail then
|
||||||
local Jail = require 'modules.control.jail'
|
local Jail = require("modules.exp_legacy.modules.control.jail")
|
||||||
Event.add(Jail.events.on_player_jailed, function(event)
|
Event.add(Jail.events.on_player_jailed, function(event)
|
||||||
local player_name, by_player_name = get_player_name(event)
|
local player_name, by_player_name = get_player_name(event)
|
||||||
emit_event{
|
emit_event{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
--- Allows the FAGC clientside bot to receive information about bans and unbans and propagate that information to other servers
|
--- Allows the FAGC clientside bot to receive information about bans and unbans and propagate that information to other servers
|
||||||
-- @addon FAGC
|
-- @addon FAGC
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
|
|
||||||
-- Clear the file on startup to minimize its size
|
-- Clear the file on startup to minimize its size
|
||||||
Event.on_init(function()
|
Event.on_init(function()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local Event = require 'utils.event'
|
local Event = require("modules/exp_legacy/utils/event")
|
||||||
|
|
||||||
local controllers_with_inventory = {
|
local controllers_with_inventory = {
|
||||||
[defines.controllers.character] = true,
|
[defines.controllers.character] = true,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
--- Will move players items to spawn when they are banned or kicked, option to clear on leave
|
--- Will move players items to spawn when they are banned or kicked, option to clear on leave
|
||||||
-- @addon Inventory-Clear
|
-- @addon Inventory-Clear
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local events = require 'config.inventory_clear' --- @dep config.inventory_clear
|
local events = require("modules.exp_legacy.config.inventory_clear") --- @dep config.inventory_clear
|
||||||
local move_items_stack = _C.move_items_stack --- @dep expcore.common
|
local move_items_stack = _C.move_items_stack --- @dep expcore.common
|
||||||
|
|
||||||
local function clear_items(event)
|
local function clear_items(event)
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
@addon Lawnmower
|
@addon Lawnmower
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local config = require 'config.lawnmower' --- @dep config.lawnmower
|
local config = require("modules.exp_legacy.config.lawnmower") --- @dep config.lawnmower
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
Commands.new_command('lawnmower', {'expcom-lawnmower.description'}, 'Clean up biter corpse, decoratives and nuclear hole')
|
Commands.new_command('lawnmower', {'expcom-lawnmower.description'}, 'Clean up biter corpse, decoratives and nuclear hole')
|
||||||
:add_param('range', false, 'integer-range', 1, 200)
|
:add_param('range', false, 'integer-range', 1, 200)
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
@addon Logging
|
@addon Logging
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local config = require 'config.logging' --- @dep config.logging
|
local config = require("modules.exp_legacy.config.logging") --- @dep config.logging
|
||||||
local config_res = require 'config.research' --- @dep config.research
|
local config_res = require("modules.exp_legacy.config.research") --- @dep config.research
|
||||||
|
|
||||||
local function add_log(data)
|
local function add_log(data)
|
||||||
game.write_file(config.file_name, data, true, 0)
|
game.write_file(config.file_name, data, true, 0)
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
local Event = require 'utils.event_core' --- @dep utils.event_core
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event_core
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local config = require 'config.miner' --- @dep config.miner
|
local config = require("modules.exp_legacy.config.miner") --- @dep config.miner
|
||||||
|
|
||||||
local miner_data = {}
|
local miner_data = {}
|
||||||
|
Storage.register(miner_data, function(tbl)
|
||||||
Global.register(miner_data, function(tbl)
|
|
||||||
miner_data = tbl
|
miner_data = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
--- Disable new players from having certain items in their inventory, most commonly nukes
|
--- Disable new players from having certain items in their inventory, most commonly nukes
|
||||||
-- @addon Nukeprotect
|
-- @addon Nukeprotect
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
local config = require 'config.nukeprotect' --- @dep config.nukeprotect
|
local config = require("modules.exp_legacy.config.nukeprotect") --- @dep config.nukeprotect
|
||||||
local move_items_stack = _C.move_items_stack --- @dep expcore.common
|
local move_items_stack = _C.move_items_stack --- @dep expcore.common
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
--- Makes polution look much nice of the map, ie not one big red mess
|
--- Makes polution look much nice of the map, ie not one big red mess
|
||||||
-- @addon Pollution-Grading
|
-- @addon Pollution-Grading
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local config = require 'config.pollution_grading' --- @dep config.pollution_grading
|
local config = require("modules.exp_legacy.config.pollution_grading") --- @dep config.pollution_grading
|
||||||
|
|
||||||
local delay = config.update_delay * 3600 -- convert from minutes to ticks
|
local delay = config.update_delay * 3600 -- convert from minutes to ticks
|
||||||
Event.on_nth_tick(delay, function()
|
Event.on_nth_tick(delay, function()
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
--- When a player triggers protection multiple times they are automatically jailed
|
--- When a player triggers protection multiple times they are automatically jailed
|
||||||
-- @addon protection-jail
|
-- @addon protection-jail
|
||||||
|
|
||||||
local Event = require 'utils.event' ---@dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") ---@dep utils.event
|
||||||
local Global = require 'utils.global' ---@dep utils.global
|
local Storage = require("modules/exp_util/storage") ---@dep utils.global
|
||||||
local Jail = require 'modules.control.jail' ---@dep modules.control.jail
|
local Jail = require("modules.exp_legacy.modules.control.jail") ---@dep modules.control.jail
|
||||||
local Protection = require 'modules.control.protection' --- @dep modules.control.protection
|
local Protection = require("modules.exp_legacy.modules.control.protection") --- @dep modules.control.protection
|
||||||
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
||||||
|
|
||||||
--- Stores how many times the repeat violation was triggered
|
--- Stores how many times the repeat violation was triggered
|
||||||
local repeat_count = {}
|
local repeat_count = {}
|
||||||
Global.register(repeat_count, function(tbl)
|
Storage.register(repeat_count, function(tbl)
|
||||||
repeat_count = tbl
|
repeat_count = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
--- When a player is reported, the player is automatically jailed if the combined playtime of the reporters exceeds the reported player
|
--- When a player is reported, the player is automatically jailed if the combined playtime of the reporters exceeds the reported player
|
||||||
-- @addon report-jail
|
-- @addon report-jail
|
||||||
|
|
||||||
local Event = require 'utils.event' ---@dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") ---@dep utils.event
|
||||||
local Jail = require 'modules.control.jail' ---@dep modules.control.jail
|
local Jail = require("modules.exp_legacy.modules.control.jail") ---@dep modules.control.jail
|
||||||
local Reports = require 'modules.control.reports' --- @dep modules.control.reports
|
local Reports = require("modules.exp_legacy.modules.control.reports") --- @dep modules.control.reports
|
||||||
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
||||||
|
|
||||||
--- Returns the playtime of the reporter. Used when calculating the total playtime of all reporters
|
--- Returns the playtime of the reporter. Used when calculating the total playtime of all reporters
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
--- When a player walks around the tiles under them will degrade over time, the same is true when entites are built
|
--- When a player walks around the tiles under them will degrade over time, the same is true when entites are built
|
||||||
-- @addon Scorched-Earth
|
-- @addon Scorched-Earth
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local print_grid_value, clear_flying_text = _C.print_grid_value, _C.clear_flying_text --- @dep expcore.common
|
local print_grid_value, clear_flying_text = _C.print_grid_value, _C.clear_flying_text --- @dep expcore.common
|
||||||
local config = require 'config.scorched_earth' --- @dep config.scorched_earth
|
local config = require("modules.exp_legacy.config.scorched_earth") --- @dep config.scorched_earth
|
||||||
|
|
||||||
-- Loops over the config and finds the wile which has the highest value for strength
|
-- Loops over the config and finds the wile which has the highest value for strength
|
||||||
local max_strength = 0
|
local max_strength = 0
|
||||||
@@ -16,7 +16,7 @@ end
|
|||||||
|
|
||||||
-- Used for debugging the degrade chances
|
-- Used for debugging the degrade chances
|
||||||
local debug_players = {}
|
local debug_players = {}
|
||||||
Global.register(debug_players, function(tbl)
|
Storage.register(debug_players, function(tbl)
|
||||||
debug_players = tbl
|
debug_players = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
--- Adds a custom spawn area with chests and afk turrets
|
--- Adds a custom spawn area with chests and afk turrets
|
||||||
-- @addon Spawn-Area
|
-- @addon Spawn-Area
|
||||||
|
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local config = require 'config.spawn_area' --- @dep config.spawn_area
|
local config = require("modules.exp_legacy.config.spawn_area") --- @dep config.spawn_area
|
||||||
|
|
||||||
local turrets = config.turrets.locations
|
local turrets = config.turrets.locations
|
||||||
Global.register(turrets, function(tbl)
|
Storage.register(turrets, function(tbl)
|
||||||
turrets = tbl
|
turrets = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---LuaPlayerBuiltEntityEventFilters
|
---LuaPlayerBuiltEntityEventFilters
|
||||||
---Events.set_event_filter(defines.events.on_built_entity, {{filter = "name", name = "fast-inserter"}})
|
---Events.set_event_filter(defines.events.on_built_entity, {{filter = "name", name = "fast-inserter"}})
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local config = require 'config.station_auto_name' --- @dep config.chat_reply
|
local config = require("modules.exp_legacy.config.station_auto_name") --- @dep config.chat_reply
|
||||||
|
|
||||||
--Credit to Cooldude2606 for using his lua magic to make this function.
|
--Credit to Cooldude2606 for using his lua magic to make this function.
|
||||||
local directions = {
|
local directions = {
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
--- Makes trees which are marked for decon "decay" quickly to allow faster building
|
--- Makes trees which are marked for decon "decay" quickly to allow faster building
|
||||||
-- @addon Tree-Decon
|
-- @addon Tree-Decon
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
local Gui = require("modules.exp_legacy.expcore.gui") --- @dep expcore.gui
|
||||||
local PlayerData = require 'expcore.player_data' --- @dep expcore.player_data
|
local PlayerData = require("modules.exp_legacy.expcore.player_data") --- @dep expcore.player_data
|
||||||
|
|
||||||
-- Global queue used to store trees that need to be removed, also cache for player roles
|
-- Storage queue used to store trees that need to be removed, also cache for player roles
|
||||||
local cache = {}
|
local cache = {}
|
||||||
local tree_queue = { _head=0 }
|
local tree_queue = { _head=0 }
|
||||||
Global.register({tree_queue, cache}, function(tbl)
|
Storage.register({tree_queue, cache}, function(tbl)
|
||||||
tree_queue = tbl[1]
|
tree_queue = tbl[1]
|
||||||
cache = tbl[2]
|
cache = tbl[2]
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
@commands Admin-Chat
|
@commands Admin-Chat
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
--- Sends a message in chat that only admins can see
|
--- Sends a message in chat that only admins can see
|
||||||
-- @command admin-chat
|
-- @command admin-chat
|
||||||
@@ -17,7 +17,6 @@ Commands.new_command('admin-chat', {'expcom-admin-chat.description'}, 'Sends a m
|
|||||||
:add_alias('ac')
|
:add_alias('ac')
|
||||||
:register(function(player, message)
|
:register(function(player, message)
|
||||||
local player_name_colour = format_chat_player_name(player)
|
local player_name_colour = format_chat_player_name(player)
|
||||||
|
|
||||||
for _, return_player in pairs(game.connected_players) do
|
for _, return_player in pairs(game.connected_players) do
|
||||||
if return_player.admin then
|
if return_player.admin then
|
||||||
return_player.print{'expcom-admin-chat.format', player_name_colour, message}
|
return_player.print{'expcom-admin-chat.format', player_name_colour, message}
|
||||||
|
|||||||
@@ -3,15 +3,15 @@
|
|||||||
@commands Admin-Markers
|
@commands Admin-Markers
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
|
|
||||||
local admins = {} -- Stores all players in admin marker mode
|
local admins = {} -- Stores all players in admin marker mode
|
||||||
local markers = {} -- Stores all admin markers
|
local markers = {} -- Stores all admin markers
|
||||||
|
|
||||||
--- Global variables
|
--- Storage variables
|
||||||
Global.register({
|
Storage.register({
|
||||||
admins = admins,
|
admins = admins,
|
||||||
markers = markers
|
markers = markers
|
||||||
}, function(tbl)
|
}, function(tbl)
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
@commands Artillery
|
@commands Artillery
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
local Selection = require 'modules.control.selection' --- @dep modules.control.selection
|
local Selection = require("modules.exp_legacy.modules.control.selection") --- @dep modules.control.selection
|
||||||
local SelectionArtyArea = 'ArtyArea'
|
local SelectionArtyArea = 'ArtyArea'
|
||||||
|
|
||||||
local function location_break(player, pos)
|
local function location_break(player, pos)
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
@commands Bot Queue
|
@commands Bot Queue
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
Commands.new_command('bot-queue-get', {'expcom-bot-queue.description-get'}, 'Get bot queue')
|
Commands.new_command('bot-queue-get', {'expcom-bot-queue.description-get'}, 'Get bot queue')
|
||||||
:set_flag('admin_only')
|
:set_flag('admin_only')
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
@commands Cheat-Mode
|
@commands Cheat-Mode
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
--- Toggles cheat mode for your player, or another player.
|
--- Toggles cheat mode for your player, or another player.
|
||||||
-- @command toggle-cheat-mode
|
-- @command toggle-cheat-mode
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
@commands Clear-Inventory
|
@commands Clear-Inventory
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local move_items_stack = _C.move_items_stack --- @dep expcore.common
|
local move_items_stack = _C.move_items_stack --- @dep expcore.common
|
||||||
require 'config.expcore.command_role_parse'
|
require("modules.exp_legacy.config.expcore.command_role_parse")
|
||||||
|
|
||||||
--- Clears a players inventory
|
--- Clears a players inventory
|
||||||
-- @command clear-inventory
|
-- @command clear-inventory
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
@commands Connect
|
@commands Connect
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Async = require 'expcore.async' --- @dep expcore.async
|
local Async = require("modules/exp_util/async")
|
||||||
local External = require 'expcore.external' --- @dep expcore.external
|
local External = require("modules.exp_legacy.expcore.external") --- @dep expcore.external
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_role_parse'
|
require("modules.exp_legacy.config.expcore.command_role_parse")
|
||||||
local concat = table.concat
|
local concat = table.concat
|
||||||
|
|
||||||
local request_connection = Async.register(External.request_connection)
|
local request_connection_async = Async.register(External.request_connection)
|
||||||
|
|
||||||
local function get_server_id(server)
|
local function get_server_id(server)
|
||||||
local current_server = External.get_current_server()
|
local current_server = External.get_current_server()
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
@commands Debug
|
@commands Debug
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local DebugView = require 'modules.gui.debug.main_view' --- @dep modules.gui.debug.main_view
|
local DebugView = require("modules.exp_legacy.modules.gui.debug.main_view") --- @dep modules.gui.debug.main_view
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
|
|
||||||
--- Opens the debug pannel for viewing tables.
|
--- Opens the debug pannel for viewing tables.
|
||||||
-- @command debug
|
-- @command debug
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
@commands Enemy
|
@commands Enemy
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
Commands.new_command('kill-biters', {'expcom-enemy.description-kill'}, 'Kill all biters only')
|
Commands.new_command('kill-biters', {'expcom-enemy.description-kill'}, 'Kill all biters only')
|
||||||
:set_flag('admin_only')
|
:set_flag('admin_only')
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
@commands Find
|
@commands Find
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
--- Find a player on your map.
|
--- Find a player on your map.
|
||||||
-- @command find-on-map
|
-- @command find-on-map
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
@commands Toggle Friendly Fire
|
@commands Toggle Friendly Fire
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
-- For Modded Server Use
|
-- For Modded Server Use
|
||||||
Commands.new_command('toggle-friendly-fire', {'expcom-ff.description'}, 'Toggle friendly fire')
|
Commands.new_command('toggle-friendly-fire', {'expcom-ff.description'}, 'Toggle friendly fire')
|
||||||
|
|||||||
@@ -3,14 +3,14 @@
|
|||||||
@commands Help
|
@commands Help
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
local results_per_page = 5
|
local results_per_page = 5
|
||||||
|
|
||||||
local search_cache = {}
|
local search_cache = {}
|
||||||
Global.register(search_cache, function(tbl)
|
Storage.register(search_cache, function(tbl)
|
||||||
search_cache = tbl
|
search_cache = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -25,7 +25,6 @@ Commands.new_command('search-help', {'expcom-chelp.description'}, 'Searches for
|
|||||||
:set_defaults{keyword='', page=1}
|
:set_defaults{keyword='', page=1}
|
||||||
:register(function(player, keyword, page)
|
:register(function(player, keyword, page)
|
||||||
local player_index = player and player.index or 0
|
local player_index = player and player.index or 0
|
||||||
|
|
||||||
-- if keyword is a number then treat it as page number
|
-- if keyword is a number then treat it as page number
|
||||||
if tonumber(keyword) then
|
if tonumber(keyword) then
|
||||||
page = math.floor(tonumber(keyword))
|
page = math.floor(tonumber(keyword))
|
||||||
@@ -45,7 +44,6 @@ Commands.new_command('search-help', {'expcom-chelp.description'}, 'Searches for
|
|||||||
local current_page = 1
|
local current_page = 1
|
||||||
local page_count = 0
|
local page_count = 0
|
||||||
local commands = Commands.search(keyword, player)
|
local commands = Commands.search(keyword, player)
|
||||||
|
|
||||||
-- loops other all commands returned by search, includes game commands
|
-- loops other all commands returned by search, includes game commands
|
||||||
for _, command_data in pairs(commands) do
|
for _, command_data in pairs(commands) do
|
||||||
-- if the number of results if greater than the number already added then it moves onto a new page
|
-- if the number of results if greater than the number already added then it moves onto a new page
|
||||||
@@ -54,7 +52,6 @@ Commands.new_command('search-help', {'expcom-chelp.description'}, 'Searches for
|
|||||||
current_page = current_page + 1
|
current_page = current_page + 1
|
||||||
table.insert(pages, {})
|
table.insert(pages, {})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- adds the new command to the page
|
-- adds the new command to the page
|
||||||
page_count = page_count + 1
|
page_count = page_count + 1
|
||||||
found = found + 1
|
found = found + 1
|
||||||
@@ -67,7 +64,6 @@ Commands.new_command('search-help', {'expcom-chelp.description'}, 'Searches for
|
|||||||
alias_format
|
alias_format
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- adds the result to the cache
|
-- adds the result to the cache
|
||||||
search_cache[player_index] = {
|
search_cache[player_index] = {
|
||||||
keyword=keyword:lower(),
|
keyword=keyword:lower(),
|
||||||
@@ -91,7 +87,6 @@ Commands.new_command('search-help', {'expcom-chelp.description'}, 'Searches for
|
|||||||
Commands.print({'expcom-chelp.footer', found, page, #pages}, 'cyan')
|
Commands.print({'expcom-chelp.footer', found, page, #pages}, 'cyan')
|
||||||
return Commands.error{'expcom-chelp.out-of-range', page}
|
return Commands.error{'expcom-chelp.out-of-range', page}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- blocks command complete message
|
-- blocks command complete message
|
||||||
return Commands.success
|
return Commands.success
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
@commands Home
|
@commands Home
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
local homes = {}
|
local homes = {}
|
||||||
Global.register(homes, function(tbl)
|
Storage.register(homes, function(tbl)
|
||||||
homes = tbl
|
homes = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
@commands Interface
|
@commands Interface
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
|
|
||||||
-- modules that are loaded into the interface env to be accessed
|
-- modules that are loaded into the interface env to be accessed
|
||||||
local interface_modules = {
|
local interface_modules = {
|
||||||
@@ -13,7 +13,6 @@ local interface_modules = {
|
|||||||
['Group'] = 'expcore.permission_groups',
|
['Group'] = 'expcore.permission_groups',
|
||||||
['Roles'] = 'expcore.roles',
|
['Roles'] = 'expcore.roles',
|
||||||
['Gui'] = 'expcore.gui',
|
['Gui'] = 'expcore.gui',
|
||||||
['Async'] = 'expcore.async',
|
|
||||||
['Datastore'] = 'expcore.datastore',
|
['Datastore'] = 'expcore.datastore',
|
||||||
['External'] = 'expcore.external'
|
['External'] = 'expcore.external'
|
||||||
}
|
}
|
||||||
@@ -27,7 +26,7 @@ end
|
|||||||
|
|
||||||
local interface_env = {} -- used as a persistent sandbox for interface commands
|
local interface_env = {} -- used as a persistent sandbox for interface commands
|
||||||
local interface_callbacks = {} -- saves callbacks which can load new values per use
|
local interface_callbacks = {} -- saves callbacks which can load new values per use
|
||||||
Global.register(interface_env, function(tbl)
|
Storage.register(interface_env, function(tbl)
|
||||||
interface_env = tbl
|
interface_env = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
@commands Jail
|
@commands Jail
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Jail = require 'modules.control.jail' --- @dep modules.control.jail
|
local Jail = require("modules.exp_legacy.modules.control.jail") --- @dep modules.control.jail
|
||||||
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
||||||
require 'config.expcore.command_role_parse'
|
require("modules.exp_legacy.config.expcore.command_role_parse")
|
||||||
|
|
||||||
--- Puts a player into jail and removes all other roles.
|
--- Puts a player into jail and removes all other roles.
|
||||||
-- @command jail
|
-- @command jail
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
@commands Kill
|
@commands Kill
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
require 'config.expcore.command_role_parse'
|
require("modules.exp_legacy.config.expcore.command_role_parse")
|
||||||
|
|
||||||
--- Kills yourself or another player.
|
--- Kills yourself or another player.
|
||||||
-- @command kill
|
-- @command kill
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
@commands LastLocation
|
@commands LastLocation
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
--- Get the last location of a player.
|
--- Get the last location of a player.
|
||||||
-- @command last-location
|
-- @command last-location
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
@commands Me
|
@commands Me
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
|
|
||||||
--- Sends an action message in the chat
|
--- Sends an action message in the chat
|
||||||
-- @command me
|
-- @command me
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
@commands Pollution Handle
|
@commands Pollution Handle
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
Commands.new_command('pollution-clear', {'expcom-pol.description-clr'}, 'Clear pollution')
|
Commands.new_command('pollution-clear', {'expcom-pol.description-clr'}, 'Clear pollution')
|
||||||
:set_flag('admin_only')
|
:set_flag('admin_only')
|
||||||
|
|||||||
@@ -3,19 +3,19 @@
|
|||||||
@commands Protection
|
@commands Protection
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
||||||
local EntityProtection = require 'modules.control.protection' --- @dep modules.control.protection
|
local EntityProtection = require("modules.exp_legacy.modules.control.protection") --- @dep modules.control.protection
|
||||||
local Selection = require 'modules.control.selection' --- @dep modules.control.selection
|
local Selection = require("modules.exp_legacy.modules.control.selection") --- @dep modules.control.selection
|
||||||
|
|
||||||
local SelectionProtectEntity = 'ProtectEntity'
|
local SelectionProtectEntity = 'ProtectEntity'
|
||||||
local SelectionProtectArea = 'ProtectArea'
|
local SelectionProtectArea = 'ProtectArea'
|
||||||
|
|
||||||
local renders = {} -- Stores all renders for a player
|
local renders = {} -- Stores all renders for a player
|
||||||
Global.register({
|
Storage.register({
|
||||||
renders = renders
|
renders = renders
|
||||||
}, function(tbl)
|
}, function(tbl)
|
||||||
renders = tbl.renders
|
renders = tbl.renders
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
@commands Rainbow
|
@commands Rainbow
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local format_chat_colour = _C.format_chat_colour --- @dep expcore.common
|
local format_chat_colour = _C.format_chat_colour --- @dep expcore.common
|
||||||
|
|
||||||
local function step_component(c1, c2)
|
local function step_component(c1, c2)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
local Commands = require 'expcore.commands'
|
local Commands = require("modules.exp_legacy.expcore.commands")
|
||||||
|
|
||||||
local function Modules(moduleInventory) -- returns the multiplier of the modules
|
local function Modules(moduleInventory) -- returns the multiplier of the modules
|
||||||
local effect1 = moduleInventory.get_item_count("productivity-module") -- type 1
|
local effect1 = moduleInventory.get_item_count("productivity-module") -- type 1
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
@commands Repair
|
@commands Repair
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local config = require 'config.repair' --- @dep config.repair
|
local config = require("modules.exp_legacy.config.repair") --- @dep config.repair
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
local max_time_to_live = 4294967295 -- unit32 max
|
local max_time_to_live = 4294967295 -- unit32 max
|
||||||
--- Repairs entities on your force around you
|
--- Repairs entities on your force around you
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
@commands Reports
|
@commands Reports
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Reports = require 'modules.control.reports' --- @dep modules.control.reports
|
local Reports = require("modules.exp_legacy.modules.control.reports") --- @dep modules.control.reports
|
||||||
local format_chat_player_name = _C.format_chat_player_name--- @dep expcore.common
|
local format_chat_player_name = _C.format_chat_player_name--- @dep expcore.common
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
--- Print a message to all players who match the value of admin
|
--- Print a message to all players who match the value of admin
|
||||||
local function print_to_players(admin, message)
|
local function print_to_players(admin, message)
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local config = require 'config.research' --- @dep config.research
|
local config = require("modules.exp_legacy.config.research") --- @dep config.research
|
||||||
|
|
||||||
local research = {}
|
local research = {}
|
||||||
Global.register(research, function(tbl)
|
Storage.register(research, function(tbl)
|
||||||
research = tbl
|
research = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
@commands Roles
|
@commands Roles
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
local Colours = require 'utils.color_presets' --- @dep utils.color_presets
|
local Colours = require("modules/exp_util/include/color")
|
||||||
local format_chat_player_name, format_chat_colour_localized = _C.format_chat_player_name, _C.format_chat_colour_localized
|
local format_chat_player_name, format_chat_colour_localized = _C.format_chat_player_name, _C.format_chat_colour_localized
|
||||||
|
|
||||||
--- Assigns a role to a player
|
--- Assigns a role to a player
|
||||||
@@ -68,12 +68,10 @@ Commands.new_command('list-roles', {'expcom-roles.description-list-roles'}, 'Lis
|
|||||||
local role_name = format_chat_colour_localized(role.name, colour)
|
local role_name = format_chat_colour_localized(role.name, colour)
|
||||||
if index == 1 then
|
if index == 1 then
|
||||||
message = {'expcom-roles.list', role_name}
|
message = {'expcom-roles.list', role_name}
|
||||||
|
|
||||||
if player then
|
if player then
|
||||||
local player_name_colour = format_chat_player_name(player)
|
local player_name_colour = format_chat_player_name(player)
|
||||||
message = {'expcom-roles.list-player', player_name_colour, role_name}
|
message = {'expcom-roles.list-player', player_name_colour, role_name}
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
message = {'expcom-roles.list-element', message, role_name}
|
message = {'expcom-roles.list-element', message, role_name}
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
@commands InventorySearch
|
@commands InventorySearch
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local format_number = require('util').format_number --- @dep util
|
local format_number = require("util").format_number --- @dep util
|
||||||
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
||||||
local format_time = _C.format_time
|
local format_time = _C.format_time
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
--- Input parse for items by name
|
--- Input parse for items by name
|
||||||
local function item_parse(input, _, reject)
|
local function item_parse(input, _, reject)
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
@commands Spawn
|
@commands Spawn
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
|
|
||||||
local function teleport(player)
|
local function teleport(player)
|
||||||
local surface = player.surface
|
local surface = player.surface
|
||||||
@@ -52,12 +52,10 @@ Commands.new_command('go-to-spawn', {'expcom-spawn.description'}, 'Teleport to s
|
|||||||
:register(function(player, action_player)
|
:register(function(player, action_player)
|
||||||
if not action_player then
|
if not action_player then
|
||||||
return Commands.error{'expcom-spawn.unavailable'}
|
return Commands.error{'expcom-spawn.unavailable'}
|
||||||
|
|
||||||
elseif action_player == player then
|
elseif action_player == player then
|
||||||
if not teleport(player) then
|
if not teleport(player) then
|
||||||
return Commands.error{'expcom-spawn.unavailable'}
|
return Commands.error{'expcom-spawn.unavailable'}
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif Roles.player_allowed(player, 'command/go-to-spawn/always') then
|
elseif Roles.player_allowed(player, 'command/go-to-spawn/always') then
|
||||||
if not teleport(action_player) then
|
if not teleport(action_player) then
|
||||||
return Commands.error{'expcom-spawn.unavailable'}
|
return Commands.error{'expcom-spawn.unavailable'}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
@commands Spectate
|
@commands Spectate
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Spectate = require 'modules.control.spectate' --- @dep modules.control.spectate
|
local Spectate = require("modules.exp_legacy.modules.control.spectate") --- @dep modules.control.spectate
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
--- Toggles spectator mode for the caller
|
--- Toggles spectator mode for the caller
|
||||||
-- @command spectate
|
-- @command spectate
|
||||||
@@ -13,7 +13,6 @@ Commands.new_command('spectate', {'expcom-spectate.description-spectate'}, 'Togg
|
|||||||
:register(function(player)
|
:register(function(player)
|
||||||
if Spectate.is_spectating(player) then
|
if Spectate.is_spectating(player) then
|
||||||
Spectate.stop_spectate(player)
|
Spectate.stop_spectate(player)
|
||||||
|
|
||||||
else
|
else
|
||||||
Spectate.start_spectate(player)
|
Spectate.start_spectate(player)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
@commands Set game speed
|
@commands Set game speed
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
Commands.new_command('game-speed', {'expcom-speed.description'}, 'Set game speed')
|
Commands.new_command('game-speed', {'expcom-speed.description'}, 'Set game speed')
|
||||||
:add_param('amount', 'number-range', 0.2, 8)
|
:add_param('amount', 'number-range', 0.2, 8)
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
local copy_items_stack = _C.copy_items_stack --- @dep expcore.common
|
local copy_items_stack = _C.copy_items_stack --- @dep expcore.common
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
Commands.new_command('clear-item-on-ground', {'expcom-surface-clearing.description-ci'}, 'Clear Item On Ground')
|
Commands.new_command('clear-item-on-ground', {'expcom-surface-clearing.description-ci'}, 'Clear Item On Ground')
|
||||||
:add_param('range', false, 'integer-range', 1, 1000)
|
:add_param('range', false, 'integer-range', 1, 1000)
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
@commands Teleport
|
@commands Teleport
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
|
|
||||||
local function teleport(from_player, to_player)
|
local function teleport(from_player, to_player)
|
||||||
local surface = to_player.surface
|
local surface = to_player.surface
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
@commands Set Automatic Train
|
@commands Set Automatic Train
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
local format_number = require('util').format_number
|
local format_number = require("util").format_number
|
||||||
|
|
||||||
Commands.new_command('set-trains-to-automatic', {'expcom-train.description'}, 'Set All Trains to Automatic')
|
Commands.new_command('set-trains-to-automatic', {'expcom-train.description'}, 'Set All Trains to Automatic')
|
||||||
:register(function(player)
|
:register(function(player)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
--- Adds a virtual layer to store power to save space.
|
--- Adds a virtual layer to store power to save space.
|
||||||
-- @commands Vlayer
|
-- @commands Vlayer
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
local vlayer = require 'modules.control.vlayer'
|
local vlayer = require("modules.exp_legacy.modules.control.vlayer")
|
||||||
|
|
||||||
Commands.new_command('vlayer-info', {'vlayer.description-vi'}, 'Vlayer Info')
|
Commands.new_command('vlayer-info', {'vlayer.description-vi'}, 'Vlayer Info')
|
||||||
:register(function(_)
|
:register(function(_)
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
@commands Warnings
|
@commands Warnings
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
local Warnings = require 'modules.control.warnings' --- @dep modules.control.warnings
|
local Warnings = require("modules.exp_legacy.modules.control.warnings") --- @dep modules.control.warnings
|
||||||
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
||||||
local config = require 'config.warnings' --- @dep config.warnings
|
local config = require("modules.exp_legacy.config.warnings") --- @dep config.warnings
|
||||||
require 'config.expcore.command_role_parse'
|
require("modules.exp_legacy.config.expcore.command_role_parse")
|
||||||
|
|
||||||
--- Gives a warning to a player; may lead to automatic script action.
|
--- Gives a warning to a player; may lead to automatic script action.
|
||||||
-- @command give-warning
|
-- @command give-warning
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
--- Adds a waterfill
|
--- Adds a waterfill
|
||||||
-- @commands Waterfill
|
-- @commands Waterfill
|
||||||
|
|
||||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||||
require 'config.expcore.command_general_parse'
|
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||||
local Selection = require 'modules.control.selection' --- @dep modules.control.selection
|
local Selection = require("modules.exp_legacy.modules.control.selection") --- @dep modules.control.selection
|
||||||
local SelectionConvertArea = 'WaterfillConvertArea'
|
local SelectionConvertArea = 'ConvertArea'
|
||||||
|
|
||||||
--- Align an aabb to the grid by expanding it
|
--- Align an aabb to the grid by expanding it
|
||||||
local function aabb_align_expand(aabb)
|
local function aabb_align_expand(aabb)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
@usage
|
@usage
|
||||||
-- import the module from the control modules
|
-- import the module from the control modules
|
||||||
local Jail = require 'modules.control.jail' --- @dep modules.control.jail
|
local Jail = require("modules.exp_legacy.modules.control.jail") --- @dep modules.control.jail
|
||||||
|
|
||||||
-- This will move 'MrBiter' to the jail role and remove all other roles from them
|
-- This will move 'MrBiter' to the jail role and remove all other roles from them
|
||||||
-- the player name and reason are only so they can be included in the event for user feedback
|
-- the player name and reason are only so they can be included in the event for user feedback
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
Jail.unjail_player('MrBiter', 'Cooldude2606')
|
Jail.unjail_player('MrBiter', 'Cooldude2606')
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
local Game = require("modules.exp_legacy.utils.game") --- @dep utils.game
|
||||||
|
|
||||||
local valid_player = Game.get_player_from_any
|
local valid_player = Game.get_player_from_any
|
||||||
local assign_roles = Roles.assign_player
|
local assign_roles = Roles.assign_player
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
@usage
|
@usage
|
||||||
-- import the module from the control modules
|
-- import the module from the control modules
|
||||||
local Production = require 'modules.control.production' --- @dep modules.control.production
|
local Production = require("modules.exp_legacy.modules.control.production") --- @dep modules.control.production
|
||||||
|
|
||||||
-- This will return the less precise index from the one given
|
-- This will return the less precise index from the one given
|
||||||
-- this means that one_second will return one_minute or ten_hours will return fifty_hours
|
-- this means that one_second will return one_minute or ten_hours will return fifty_hours
|
||||||
@@ -32,8 +32,8 @@
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Colors = require 'utils.color_presets' --- @dep utils.color_presets
|
local Colors = require("modules/exp_util/include/color")
|
||||||
local format_number = require('util').format_number --- @dep util
|
local format_number = require("util").format_number --- @dep util
|
||||||
|
|
||||||
local precision_index = defines.flow_precision_index
|
local precision_index = defines.flow_precision_index
|
||||||
local Production = {}
|
local Production = {}
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
@alias Protection
|
@alias Protection
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local config = require 'config.protection' --- @dep config.protection
|
local config = require("modules.exp_legacy.config.protection") --- @dep config.protection
|
||||||
local EntityProtection = {
|
local EntityProtection = {
|
||||||
protected_entity_names = table.deep_copy(config.always_protected_names),
|
protected_entity_names = table.deep_copy(config.always_protected_names),
|
||||||
protected_entity_types = table.deep_copy(config.always_protected_types),
|
protected_entity_types = table.deep_copy(config.always_protected_types),
|
||||||
@@ -36,17 +36,17 @@ end
|
|||||||
-- Require roles if a permission is assigned in the config
|
-- Require roles if a permission is assigned in the config
|
||||||
local Roles
|
local Roles
|
||||||
if config.ignore_permission then
|
if config.ignore_permission then
|
||||||
Roles = require 'expcore.roles' --- @dep expcore.roles
|
Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||||
end
|
end
|
||||||
|
|
||||||
----- Global Variables -----
|
----- Storage Variables -----
|
||||||
--- Variables stored in the global table
|
--- Variables stored in the global table
|
||||||
|
|
||||||
local protected_entities = {} -- All entities which are protected
|
local protected_entities = {} -- All entities which are protected
|
||||||
local protected_areas = {} -- All areas which are protected
|
local protected_areas = {} -- All areas which are protected
|
||||||
local repeats = {} -- Stores repeat removals by players
|
local repeats = {} -- Stores repeat removals by players
|
||||||
|
|
||||||
Global.register({
|
Storage.register({
|
||||||
protected_entities = protected_entities,
|
protected_entities = protected_entities,
|
||||||
protected_areas = protected_areas,
|
protected_areas = protected_areas,
|
||||||
repeats = repeats
|
repeats = repeats
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
@usage
|
@usage
|
||||||
-- import the module from the control modules
|
-- import the module from the control modules
|
||||||
local Reports = require 'modules.control.reports' --- @dep modules.control.reports
|
local Reports = require("modules.exp_legacy.modules.control.reports") --- @dep modules.control.reports
|
||||||
|
|
||||||
-- This will place a report on "MrBiter" (must be a valid player) the report will have been made
|
-- This will place a report on "MrBiter" (must be a valid player) the report will have been made
|
||||||
-- by "Cooldude2606" (must be the player name) with the reason 'Liking biters too much' this can be
|
-- by "Cooldude2606" (must be the player name) with the reason 'Liking biters too much' this can be
|
||||||
@@ -24,8 +24,8 @@
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
local Game = require("modules.exp_legacy.utils.game") --- @dep utils.game
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
|
|
||||||
local valid_player = Game.get_player_from_any
|
local valid_player = Game.get_player_from_any
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ local Reports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local user_reports = Reports.user_reports
|
local user_reports = Reports.user_reports
|
||||||
Global.register(user_reports, function(tbl)
|
Storage.register(user_reports, function(tbl)
|
||||||
Reports.user_reports = tbl
|
Reports.user_reports = tbl
|
||||||
user_reports = Reports.user_reports
|
user_reports = Reports.user_reports
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
@usage
|
@usage
|
||||||
-- import the module from the control modules
|
-- import the module from the control modules
|
||||||
local Rockets = require 'modules.control.rockets' --- @dep modules.control.rockets
|
local Rockets = require("modules.exp_legacy.modules.control.rockets") --- @dep modules.control.rockets
|
||||||
|
|
||||||
-- Some basic information is stored for each silo that has been built
|
-- Some basic information is stored for each silo that has been built
|
||||||
-- the data includes: the tick it was built, the rockets launched from it and more
|
-- the data includes: the tick it was built, the rockets launched from it and more
|
||||||
@@ -25,9 +25,9 @@
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local config = require 'config.gui.rockets' --- @dep config.rockets
|
local config = require("modules.exp_legacy.config.gui.rockets") --- @dep config.rockets
|
||||||
|
|
||||||
local largest_rolling_avg = 0
|
local largest_rolling_avg = 0
|
||||||
for _, avg_over in pairs(config.stats.rolling_avg) do
|
for _, avg_over in pairs(config.stats.rolling_avg) do
|
||||||
@@ -45,7 +45,7 @@ local Rockets = {
|
|||||||
local rocket_times = Rockets.times
|
local rocket_times = Rockets.times
|
||||||
local rocket_stats = Rockets.stats
|
local rocket_stats = Rockets.stats
|
||||||
local rocket_silos = Rockets.silos
|
local rocket_silos = Rockets.silos
|
||||||
Global.register({
|
Storage.register({
|
||||||
rocket_times = rocket_times,
|
rocket_times = rocket_times,
|
||||||
rocket_stats = rocket_stats,
|
rocket_stats = rocket_stats,
|
||||||
rocket_silos = rocket_silos
|
rocket_silos = rocket_silos
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
@alias Selection
|
@alias Selection
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local Selection = {
|
local Selection = {
|
||||||
events = {
|
events = {
|
||||||
--- When a player enters selection mode
|
--- When a player enters selection mode
|
||||||
@@ -24,7 +24,7 @@ local Selection = {
|
|||||||
local selection_tool = { name='selection-tool' }
|
local selection_tool = { name='selection-tool' }
|
||||||
|
|
||||||
local selections = {}
|
local selections = {}
|
||||||
Global.register({
|
Storage.register({
|
||||||
selections = selections
|
selections = selections
|
||||||
}, function(tbl)
|
}, function(tbl)
|
||||||
selections = tbl.selections
|
selections = tbl.selections
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
local Gui = require("modules.exp_legacy.expcore.gui") --- @dep expcore.gui
|
||||||
|
|
||||||
----- Locals -----
|
----- Locals -----
|
||||||
local follow_label -- Gui constructor
|
local follow_label -- Gui constructor
|
||||||
@@ -9,8 +9,8 @@ local following = {}
|
|||||||
local spectating = {}
|
local spectating = {}
|
||||||
local Public = {}
|
local Public = {}
|
||||||
|
|
||||||
----- Global data -----
|
----- Storage data -----
|
||||||
Global.register({
|
Storage.register({
|
||||||
following = following,
|
following = following,
|
||||||
spectating = spectating
|
spectating = spectating
|
||||||
}, function(tbl)
|
}, function(tbl)
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ Tasks.update_task(task_id, 'We need more iron!', game.player.name)
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Datastore = require 'expcore.datastore' --- @dep expcore.datastore
|
local Datastore = require("modules.exp_legacy.expcore.datastore") --- @dep expcore.datastore
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
|
|
||||||
--- Stores all data for the warp gui
|
--- Stores all data for the warp gui
|
||||||
local TaskData = Datastore.connect('TaskData')
|
local TaskData = Datastore.connect('TaskData')
|
||||||
@@ -19,9 +19,9 @@ TaskData:set_serializer(function(raw_key) return raw_key.task_id end)
|
|||||||
|
|
||||||
local Tasks = {}
|
local Tasks = {}
|
||||||
|
|
||||||
-- Global lookup table for force name to task ids
|
-- Storage lookup table for force name to task ids
|
||||||
local force_tasks = {_uid=1}
|
local force_tasks = {_uid=1}
|
||||||
Global.register(force_tasks, function(tbl)
|
Storage.register(force_tasks, function(tbl)
|
||||||
force_tasks = tbl
|
force_tasks = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
@alias vlayer
|
@alias vlayer
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local config = require 'config.vlayer' --- @dep config.vlayer
|
local config = require("modules.exp_legacy.config.vlayer") --- @dep config.vlayer
|
||||||
local move_items_stack = _C.move_items_stack
|
local move_items_stack = _C.move_items_stack
|
||||||
|
|
||||||
local mega = 1000000
|
local mega = 1000000
|
||||||
@@ -35,7 +35,7 @@ local vlayer_data = {
|
|||||||
surface = table.deep_copy(config.surface)
|
surface = table.deep_copy(config.surface)
|
||||||
}
|
}
|
||||||
|
|
||||||
Global.register(vlayer_data, function(tbl)
|
Storage.register(vlayer_data, function(tbl)
|
||||||
vlayer_data = tbl
|
vlayer_data = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
@usage
|
@usage
|
||||||
-- import the module from the control modules
|
-- import the module from the control modules
|
||||||
local Warnings = require 'modules.control.warnings' --- @dep modules.control.warnings
|
local Warnings = require("modules.exp_legacy.modules.control.warnings") --- @dep modules.control.warnings
|
||||||
|
|
||||||
-- This will add a warning to the player
|
-- This will add a warning to the player
|
||||||
Warnings.add_warning('MrBiter', 'Cooldude2606', 'Killed too many biters')
|
Warnings.add_warning('MrBiter', 'Cooldude2606', 'Killed too many biters')
|
||||||
@@ -21,15 +21,15 @@
|
|||||||
Warnings.clear_warnings('MrBiter', 'Cooldude2606')
|
Warnings.clear_warnings('MrBiter', 'Cooldude2606')
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
local Game = require("modules.exp_legacy.utils.game") --- @dep utils.game
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local config = require 'config.warnings' --- @dep config.warnings
|
local config = require("modules.exp_legacy.config.warnings") --- @dep config.warnings
|
||||||
|
|
||||||
local valid_player = Game.get_player_from_any
|
local valid_player = Game.get_player_from_any
|
||||||
|
|
||||||
--- Stores the quickbar filters for a player
|
--- Stores the quickbar filters for a player
|
||||||
local PlayerData = require 'expcore.player_data' --- @dep expcore.player_data
|
local PlayerData = require("modules.exp_legacy.expcore.player_data") --- @dep expcore.player_data
|
||||||
local PlayerWarnings = PlayerData.Required:combine('Warnings')
|
local PlayerWarnings = PlayerData.Required:combine('Warnings')
|
||||||
PlayerWarnings:set_metadata{
|
PlayerWarnings:set_metadata{
|
||||||
stringify = function(value)
|
stringify = function(value)
|
||||||
@@ -75,7 +75,7 @@ local Warnings = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local user_script_warnings = Warnings.user_script_warnings
|
local user_script_warnings = Warnings.user_script_warnings
|
||||||
Global.register(user_script_warnings, function(tbl)
|
Storage.register(user_script_warnings, function(tbl)
|
||||||
Warnings.user_script_warnings = tbl
|
Warnings.user_script_warnings = tbl
|
||||||
user_script_warnings = tbl
|
user_script_warnings = tbl
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ Warps.make_warp_tag(warp_id)
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Datastore = require 'expcore.datastore' --- @dep expcore.datastore
|
local Datastore = require("modules.exp_legacy.expcore.datastore") --- @dep expcore.datastore
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
local Storage = require("modules/exp_util/storage")
|
||||||
local config = require 'config.gui.warps' --- @dep config.warps
|
local config = require("modules.exp_legacy.config.gui.warps") --- @dep config.warps
|
||||||
|
|
||||||
--- Stores all data for the warp system
|
--- Stores all data for the warp system
|
||||||
local WrapData = Datastore.connect('WrapData')
|
local WrapData = Datastore.connect('WrapData')
|
||||||
@@ -31,10 +31,10 @@ WrapData:set_serializer(function(raw_key) return raw_key.warp_id end)
|
|||||||
|
|
||||||
local Warps = {}
|
local Warps = {}
|
||||||
|
|
||||||
-- Global lookup table for force name to task ids
|
-- Storage lookup table for force name to task ids
|
||||||
local force_warps = {_uid=1}
|
local force_warps = {_uid=1}
|
||||||
---@cast force_warps table<string, { spawn: string, [number]: string }>
|
---@cast force_warps table<string, { spawn: string, [number]: string }>
|
||||||
Global.register(force_warps, function(tbl)
|
Storage.register(force_warps, function(tbl)
|
||||||
force_warps = tbl
|
force_warps = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
--- Stores if you use alt mode or not and auto applies it
|
--- Stores if you use alt mode or not and auto applies it
|
||||||
-- @data Alt-View
|
-- @data Alt-View
|
||||||
|
|
||||||
local Event = require 'utils.event' ---@dep utils.event
|
local Event = require("modules/exp_legacy/utils/event") ---@dep utils.event
|
||||||
|
|
||||||
--- Stores the visible state of alt mode
|
--- Stores the visible state of alt mode
|
||||||
local PlayerData = require 'expcore.player_data' --- @dep expcore.player_data
|
local PlayerData = require("modules.exp_legacy.expcore.player_data") --- @dep expcore.player_data
|
||||||
local UsesAlt = PlayerData.Settings:combine('UsesAlt')
|
local UsesAlt = PlayerData.Settings:combine('UsesAlt')
|
||||||
UsesAlt:set_default(false)
|
UsesAlt:set_default(false)
|
||||||
UsesAlt:set_metadata{
|
UsesAlt:set_metadata{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user