forked from StarbloomSS13/StarbloomSS13
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ready for Review] Admin lua scripting (#65635)
Co-authored-by: Mothblocks <[email protected]>
- Loading branch information
1 parent
88268b3
commit afe30af
Showing
45 changed files
with
2,228 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,5 +24,6 @@ | |
}, | ||
"[scss]": { | ||
"editor.rulers": [80] | ||
} | ||
}, | ||
"Lua.diagnostics.enable": false | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#define AUXTOOLS_FULL_INIT 2 | ||
#define AUXTOOLS_PARTIAL_INIT 1 | ||
|
||
GLOBAL_LIST_EMPTY(auxtools_initialized) | ||
|
||
#define AUXTOOLS_CHECK(LIB)\ | ||
if (GLOB.auxtools_initialized[LIB] != AUXTOOLS_FULL_INIT) {\ | ||
if (fexists(LIB)) {\ | ||
var/string = call(LIB,"auxtools_init")();\ | ||
if(findtext(string, "SUCCESS")) {\ | ||
GLOB.auxtools_initialized[LIB] = AUXTOOLS_FULL_INIT;\ | ||
} else {\ | ||
CRASH(string);\ | ||
}\ | ||
} else {\ | ||
CRASH("No file named [LIB] found!")\ | ||
}\ | ||
}\ | ||
|
||
#define AUXTOOLS_SHUTDOWN(LIB)\ | ||
if (GLOB.auxtools_initialized[LIB] == AUXTOOLS_FULL_INIT && fexists(LIB)){\ | ||
call(LIB,"auxtools_shutdown")();\ | ||
GLOB.auxtools_initialized[LIB] = AUXTOOLS_PARTIAL_INIT;\ | ||
}\ | ||
|
||
#define AUXTOOLS_FULL_SHUTDOWN(LIB)\ | ||
if (GLOB.auxtools_initialized[LIB] && fexists(LIB)){\ | ||
call(LIB,"auxtools_full_shutdown")();\ | ||
GLOB.auxtools_initialized[LIB] = FALSE;\ | ||
}\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// Macro for getting the auxtools library file | ||
#define AUXLUA (world.system_type == MS_WINDOWS ? "auxlua.dll" : __detect_auxtools("auxlua")) | ||
|
||
/proc/__detect_auxtools(library) | ||
if(IsAdminAdvancedProcCall()) | ||
return | ||
if (fexists("./lib[library].so")) | ||
return "./lib[library].so" | ||
else if (fexists("[world.GetConfig("env", "HOME")]/.byond/bin/lib[library].so")) | ||
return "[world.GetConfig("env", "HOME")]/.byond/bin/lib[library].so" | ||
else | ||
CRASH("Could not find lib[library].so") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/// Logging for loading and caching assets | ||
/proc/log_asset(text) | ||
if(CONFIG_GET(flag/log_asset)) | ||
WRITE_LOG(GLOB.world_asset_log, "ASSET: [text]") | ||
|
||
/// Logging for config errors | ||
/// Rarely gets called; just here in case the config breaks. | ||
/proc/log_config(text) | ||
WRITE_LOG(GLOB.config_error_log, text) | ||
SEND_TEXT(world.log, text) | ||
|
||
/proc/log_filter_raw(text) | ||
WRITE_LOG(GLOB.filter_log, "FILTER: [text]") | ||
|
||
/// Logging for job slot changes | ||
/proc/log_job_debug(text) | ||
if (CONFIG_GET(flag/log_job_debug)) | ||
WRITE_LOG(GLOB.world_job_debug_log, "JOB: [text]") | ||
|
||
/// Logging for mapping errors | ||
/proc/log_mapping(text, skip_world_log) | ||
#ifdef UNIT_TESTS | ||
GLOB.unit_test_mapping_logs += text | ||
#endif | ||
WRITE_LOG(GLOB.world_map_error_log, text) | ||
if(skip_world_log) | ||
return | ||
SEND_TEXT(world.log, text) | ||
|
||
/// Logging for game performance | ||
/proc/log_perf(list/perf_info) | ||
. = "[perf_info.Join(",")]\n" | ||
WRITE_LOG_NO_FORMAT(GLOB.perf_log, .) | ||
|
||
/// Logging for hard deletes | ||
/proc/log_qdel(text) | ||
WRITE_LOG(GLOB.world_qdel_log, "QDEL: [text]") | ||
|
||
/// Logging for SQL errors | ||
/proc/log_query_debug(text) | ||
WRITE_LOG(GLOB.query_debug_log, "SQL: [text]") | ||
|
||
/// Logging for DB errors | ||
/proc/log_sql(text) | ||
WRITE_LOG(GLOB.sql_error_log, "SQL: [text]") | ||
|
||
/// Logging for world/Topic | ||
/proc/log_topic(text) | ||
WRITE_LOG(GLOB.world_game_log, "TOPIC: [text]") | ||
|
||
/* Log to the logfile only. */ | ||
/proc/log_runtime(text) | ||
WRITE_LOG(GLOB.world_runtime_log, text) | ||
|
||
/// Log to both DD and the logfile. | ||
/proc/log_world(text) | ||
#ifdef USE_CUSTOM_ERROR_HANDLER | ||
WRITE_LOG(GLOB.world_runtime_log, text) | ||
#endif | ||
SEND_TEXT(world.log, text) | ||
|
||
/// Logging for lua scripting | ||
/proc/log_lua(text) | ||
WRITE_LOG(GLOB.lua_log, text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/datum/config_entry/str_list/lua_path | ||
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN |
Oops, something went wrong.