Skip to content

Commit

Permalink
add logging to mob numbers (#60695)
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomagol committed Aug 5, 2021
1 parent cb96e2c commit a38f11a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/__HELPERS/_logging.dm
Expand Up @@ -205,6 +205,9 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))
/proc/log_href(text)
WRITE_LOG(GLOB.world_href_log, "HREF: [text]")

/proc/log_mob_tag(text)
WRITE_LOG(GLOB.world_mob_tag_log, "TAG: [text]")

/proc/log_sql(text)
WRITE_LOG(GLOB.sql_error_log, "SQL: [text]")

Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/logging.dm
Expand Up @@ -12,6 +12,8 @@ GLOBAL_VAR(world_econ_log)
GLOBAL_PROTECT(world_econ_log)
GLOBAL_VAR(world_href_log)
GLOBAL_PROTECT(world_href_log)
GLOBAL_VAR(world_mob_tag_log)
GLOBAL_PROTECT(world_mob_tag_log)
GLOBAL_VAR(round_id)
GLOBAL_PROTECT(round_id)
GLOBAL_VAR(config_error_log)
Expand Down
2 changes: 2 additions & 0 deletions code/game/world.dm
Expand Up @@ -130,6 +130,7 @@ GLOBAL_VAR(restart_counter)
GLOB.world_telecomms_log = "[GLOB.log_directory]/telecomms.log"
GLOB.world_manifest_log = "[GLOB.log_directory]/manifest.log"
GLOB.world_href_log = "[GLOB.log_directory]/hrefs.log"
GLOB.world_mob_tag_log = "[GLOB.log_directory]/mob_tags.log"
GLOB.sql_error_log = "[GLOB.log_directory]/sql.log"
GLOB.world_qdel_log = "[GLOB.log_directory]/qdel.log"
GLOB.world_map_error_log = "[GLOB.log_directory]/map_errors.log"
Expand All @@ -154,6 +155,7 @@ GLOBAL_VAR(restart_counter)
start_log(GLOB.world_telecomms_log)
start_log(GLOB.world_manifest_log)
start_log(GLOB.world_href_log)
start_log(GLOB.world_mob_tag_log)
start_log(GLOB.world_qdel_log)
start_log(GLOB.world_runtime_log)
start_log(GLOB.world_job_debug_log)
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/login.dm
Expand Up @@ -95,6 +95,7 @@
auto_deadmin_on_login()

log_message("Client [key_name(src)] has taken ownership of mob [src]([src.type])", LOG_OWNERSHIP)
log_mob_tag("\[[tag]\] NEW OWNER: [key_name(src)]")
SEND_SIGNAL(src, COMSIG_MOB_CLIENT_LOGIN, client)
client.init_verbs()

Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/mob.dm
Expand Up @@ -85,6 +85,7 @@
initialize_actionspeed()
update_movespeed(TRUE)
become_hearing_sensitive()
log_mob_tag("\[[tag]\] CREATED: [key_name(src)]")

/**
* Generate the tag for this mob
Expand Down Expand Up @@ -1082,6 +1083,9 @@
// Only update if this player is a target
if(obj.target && obj.target.current && obj.target.current.real_name == name)
obj.update_explanation_text()

log_mob_tag("\[[tag]\] RENAMED: [key_name(src)]")

return TRUE

///Updates GLOB.data_core records with new name , see mob/living/carbon/human
Expand Down

0 comments on commit a38f11a

Please sign in to comment.