Skip to content

Commit

Permalink
WIP База
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhEugene committed Nov 16, 2023
1 parent 20e52ff commit 2909256
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 5 deletions.
3 changes: 3 additions & 0 deletions code/__defines/~mods/rust_g.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@
#define rustg_log_write(fname, text, format) RUSTG_CALL(RUST_G, "log_write")(fname, text, format)
/proc/rustg_log_close_all() return RUSTG_CALL(RUST_G, "log_close_all")()

#define rustg_log_write_formatted(log, text) rustg_log_write(log, text, "true")
#define rustg_log_write_no_format(log, text) rustg_log_write(log, text, "false")

#define rustg_noise_get_at_coordinates(seed, x, y) RUSTG_CALL(RUST_G, "noise_get_at_coordinates")(seed, x, y)

#define rustg_sql_connect_pool(options) RUSTG_CALL(RUST_G, "sql_connect_pool")(options)
Expand Down
5 changes: 4 additions & 1 deletion code/_helpers/logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ var/global/log_end= world.system_type == UNIX ? ascii2text(13) : ""
to_world_log("## TESTING: [msg][log_end]")

/proc/game_log(category, text)
to_file(global.diary, "\[[time_stamp()]] [game_id] [category]: [text][log_end]")
// [SIERRA-EDIT] - RUST_G
// to_file(global.diary, "\[[time_stamp()]] [game_id] [category]: [text][log_end]") // SIERRA-EDIT - ORIGINAL
rustg_log_write_formatted("[GLOB.log_directory]/game.log", "[category]: [text]")
// [/SIERRA-EDIT]

/proc/log_admin(text)
GLOB.admin_log.Add(text)
Expand Down
4 changes: 4 additions & 0 deletions code/controllers/master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ var/global/datum/controller/master/Master = new

/datum/controller/master/New()
Uptime() //Uptime as close to boot as possible to set its statics
// [SIERRA-REMOVE] - RUST_G
/*
if (!global.diary)
global.diary = file("data/logs/[time2text(world.timeofday, "YYYY/MM/DD", -world.timezone)].log")
*/
// [/SIERRA-REMOVE]
if (!config)
config = new
total_run_times = list()
Expand Down
7 changes: 5 additions & 2 deletions code/controllers/subsystems/garbage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ SUBSYSTEM_DEF(garbage)
qdel_log += "\tSleeps: [details.slept_destroy]"
if (details.no_hint)
qdel_log += "\tNo hint: [details.no_hint] times"
var/log_file = file("[GLOB.log_directory]/qdel.log")
to_file(log_file, jointext(qdel_log, "\n"))
// [SIERRA-EDIT]
// var/log_file = file("[GLOB.log_directory]/qdel.log") // SIERRA-EDIT - ORIGINAL
// to_file(log_file, jointext(qdel_log, "\n")) // SIERRA-EDIT - ORIGINAL
rustg_log_write_formatted("[GLOB.log_directory]/qdel.log", jointext(qdel_log, "\n"))
// [/SIERRA-EDIT]


/datum/controller/subsystem/garbage/Initialize(start_uptime)
Expand Down
8 changes: 7 additions & 1 deletion code/game/world.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ GLOBAL_VAR(href_logfile)

SetupLogs()
var/date_string = time2text(world.realtime, "YYYY/MM/DD")
to_file(global.diary, "[log_end]\n[log_end]\nStarting up. (ID: [game_id]) [time2text(world.timeofday, "hh:mm.ss")][log_end]\n---------------------[log_end]")
// [SIERRA-EDIT] - RUST_G
// to_file(global.diary, "[log_end]\n[log_end]\nStarting up. (ID: [game_id]) [time2text(world.timeofday, "hh:mm.ss")][log_end]\n---------------------[log_end]") // SIERRA-EDIT - ORIGINAL

// Do not use `game_log` anywhere else! Use `log_game`!
game_log(global.diary, "\n\nStarting up. (ID: [game_id]) [time2text(world.timeofday, "hh:mm.ss")]\n---------------------")
// [/SIERRA-EDIT]


if (config)
if (config.server_name)
Expand Down
52 changes: 51 additions & 1 deletion mods/rust_g/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,57 @@ ID мода: RUST_G

### Дефайны

- `code/__defines/~mods/rust_g.dm`: `RUST_G_SPEED_MULTIPLIER`, `RUST_G_SPEED_BASE`
- `code/__defines/~mods/rust_g.dm`:
- `RUST_G`
- `RUSTG_OVERRIDE_BUILTINS`
- `RUSTG_CALL`
- `rustg_setup_acreplace`
- `rustg_setup_acreplace_with_options`
- `rustg_acreplace`
- `rustg_acreplace_with_replacements`
- `rustg_cnoise_generate`
- `rustg_dmi_strip_metadata`
- `rustg_dmi_create_png`
- `rustg_dmi_resize_png`
- `rustg_dmi_icon_states`
- `rustg_file_read`
- `rustg_file_exists`
- `rustg_file_write`
- `rustg_file_append`
- `rustg_file_get_line_count`
- `rustg_file_seek_line`
- `rustg_git_revparse`
- `rustg_git_commit_date`
- `RUSTG_HTTP_METHOD_GET`
- `RUSTG_HTTP_METHOD_PUT`
- `RUSTG_HTTP_METHOD_DELETE`
- `RUSTG_HTTP_METHOD_PATCH`
- `RUSTG_HTTP_METHOD_HEAD`
- `RUSTG_HTTP_METHOD_POST`
- `rustg_http_request_blocking`
- `rustg_http_request_async`
- `rustg_http_check_request`
- `RUSTG_JOB_NO_RESULTS_YET`
- `RUSTG_JOB_NO_SUCH_JOB`
- `RUSTG_JOB_ERROR`
- `rustg_json_is_valid`
- `rustg_log_write`
- `rustg_log_write_formatted`
- `rustg_log_write_no_format`
- `rustg_noise_get_at_coordinates`
- `rustg_sql_connect_pool`
- `rustg_sql_query_async`
- `rustg_sql_query_blocking`
- `rustg_sql_connected`
- `rustg_sql_disconnect_pool`
- `rustg_sql_check_query`
- `rustg_time_microseconds`
- `rustg_time_milliseconds`
- `rustg_time_reset`
- `rustg_raw_read_toml_file`
- `rustg_raw_toml_encode`
- `rustg_url_encode`
- `rustg_url_decode`
<!--
Если требовалось добавить какие-либо дефайны, укажи файлы,
в которые ты их добавил, а также перечисли имена.
Expand Down

0 comments on commit 2909256

Please sign in to comment.