Skip to content

Commit

Permalink
Port of Replays from Yogstation (tgstation#48579)
Browse files Browse the repository at this point in the history
* demos (ported from yogstation)

rustg update + write with no format

use external hook for logging

use proper log vars

fix + clarifying comment

don't start the log

release build of rust-g

fix something caught by the lint

Update code/__DEFINES/subsystems.dm

Co-Authored-By: Jordan Brown <[email protected]>

Update code/controllers/subsystem/demo.dm

Co-Authored-By: JJRcop <[email protected]>

Update code/controllers/subsystem/demo.dm

Co-Authored-By: JJRcop <[email protected]>

moves hooks out of a dedicated file

len = 0 to Cut(), remove semicolons

untyped loop

* updated rust_g

* 513 updates
  • Loading branch information
actioninja authored Apr 6, 2020
1 parent c34d948 commit c20a045
Show file tree
Hide file tree
Showing 70 changed files with 909 additions and 433 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/rust_g.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define rustg_git_revparse(rev) call(RUST_G, "rg_git_revparse")(rev)
#define rustg_git_commit_date(rev) call(RUST_G, "rg_git_commit_date")(rev)

#define rustg_log_write(fname, text) call(RUST_G, "log_write")(fname, text)
#define rustg_log_write(fname, text, format) call(RUST_G, "log_write")(fname, text, format)
/proc/rustg_log_close_all() return call(RUST_G, "log_close_all")()

// RUST-G defines & procs for HTTP component
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
#define INIT_ORDER_PATH -50
#define INIT_ORDER_DISCORD -60
#define INIT_ORDER_PERSISTENCE -95
#define INIT_ORDER_DEMO -99 // o avoid a bunch of changes related to initialization being written, do this last
#define INIT_ORDER_CHAT -100 //Should be last to ensure chat remains smooth during init.

// Subsystem fire priority, from lowest to highest priority
Expand Down Expand Up @@ -205,6 +206,8 @@
}\
}\
A.flags_1 &= ~OVERLAY_QUEUED_1;\
if(isturf(A)){SSdemo.mark_turf(A);}\
else if(isobj(A) || ismob(A)){SSdemo.mark_dirty(A);}\
}

// Air subsystem subtasks
Expand Down
8 changes: 5 additions & 3 deletions code/__HELPERS/_logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#define SEND_SOUND(target, sound) DIRECT_OUTPUT(target, sound)
#define SEND_TEXT(target, text) DIRECT_OUTPUT(target, text)
#define WRITE_FILE(file, text) DIRECT_OUTPUT(file, text)
#define WRITE_LOG(log, text) rustg_log_write(log, text)
//This is an external call, "true" and "false" are how rust parses out booleans
#define WRITE_LOG(log, text) rustg_log_write(log, text, "true")
#define WRITE_LOG_NO_FORMAT(log, text) rustg_log_write(log, text, "false")

//print a warning message to world.log
#define WARNING(MSG) warning("[MSG] in [__FILE__] at line [__LINE__] src: [UNLINT(src)] usr: [usr].")
Expand Down Expand Up @@ -190,8 +192,8 @@
/proc/log_mapping(text)
WRITE_LOG(GLOB.world_map_error_log, text)

/* ui logging */
/* ui logging */

/proc/log_tgui(text)
WRITE_LOG(GLOB.tgui_log, text)

Expand Down
3 changes: 3 additions & 0 deletions code/_globalvars/logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ GLOBAL_PROTECT(world_shuttle_log)
GLOBAL_VAR(discord_api_log)
GLOBAL_PROTECT(discord_api_log)

GLOBAL_VAR(demo_log)
GLOBAL_PROTECT(demo_log)

GLOBAL_LIST_EMPTY(bombers)
GLOBAL_PROTECT(bombers)
GLOBAL_LIST_EMPTY(admin_log)
Expand Down
5 changes: 5 additions & 0 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
* * [/obj/item/proc/afterattack]. The return value does not matter.
*/
/obj/item/proc/melee_attack_chain(mob/user, atom/target, params)
SSdemo.mark_dirty(src)
if(isturf(target))
SSdemo.mark_turf(target)
else
SSdemo.mark_dirty(target)
if(tool_behaviour && target.tool_act(user, src, tool_behaviour))
return
if(pre_attack(target, user, params))
Expand Down
4 changes: 3 additions & 1 deletion code/controllers/subsystem/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SUBSYSTEM_DEF(chat)
return


/datum/controller/subsystem/chat/proc/queue(target, message, handle_whitespace = TRUE, trailing_newline = TRUE)
/datum/controller/subsystem/chat/proc/queue(target, message, handle_whitespace = TRUE, trailing_newline = TRUE, confidential = TRUE)
if(!target || !message)
return

Expand All @@ -39,6 +39,8 @@ SUBSYSTEM_DEF(chat)
if (trailing_newline)
message += "<br>"

if(!confidential)
SSdemo.write_chat(target, message)

//url_encode it TWICE, this way any UTF-8 characters are able to be decoded by the Javascript.
//Do the double-encoding here to save nanoseconds
Expand Down
Loading

0 comments on commit c20a045

Please sign in to comment.