From ccdccb57af2d1b741e19c7d47235b5e8d3e11ad9 Mon Sep 17 00:00:00 2001 From: AnturK Date: Thu, 28 Dec 2017 21:22:29 +0100 Subject: [PATCH 1/3] Adds roundend nuke disk location tracking to feedback. --- code/__HELPERS/roundend.dm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 1f1bab691e..6d5efe8287 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -1,5 +1,6 @@ /datum/controller/subsystem/ticker/proc/gather_roundend_feedback() var/clients = GLOB.player_list.len +<<<<<<< HEAD var/surviving_humans = 0 var/surviving_total = 0 var/ghosts = 0 @@ -36,6 +37,22 @@ gather_antag_success_rate() /datum/controller/subsystem/ticker/proc/gather_antag_success_rate() +======= + var/popcount = count_survivors() + SSblackbox.record_feedback("nested tally", "round_end_stats", clients, list("clients")) + SSblackbox.record_feedback("nested tally", "round_end_stats", popcount[POPCOUNT_GHOSTS], list("ghosts")) + SSblackbox.record_feedback("nested tally", "round_end_stats", popcount[POPCOUNT_HUMAN_SURVIVORS], list("survivors", "human")) + SSblackbox.record_feedback("nested tally", "round_end_stats", popcount[POPCOUNT_SURVIVORS], list("survivors", "total")) + SSblackbox.record_feedback("nested tally", "round_end_stats", popcount[POPCOUNT_HUMAN_ESCAPEES], list("escapees", "human")) + SSblackbox.record_feedback("nested tally", "round_end_stats", popcount[POPCOUNT_ESCAPEES], list("escapees", "total")) + //Antag information + gather_antag_data() + + //Nuke disk + record_nuke_disk_location() + +/datum/controller/subsystem/ticker/proc/gather_antag_data() +>>>>>>> d863eb4... Adds roundend nuke disk location tracking to feedback. (#33660) var/team_gid = 1 var/list/team_ids = list() @@ -63,6 +80,27 @@ antag_info["objectives"] += list(list("objective_type"=O.type,"text"=O.explanation_text,"result"=result)) SSblackbox.record_feedback("associative", "antagonists", 1, antag_info) +<<<<<<< HEAD +======= +/datum/controller/subsystem/ticker/proc/record_nuke_disk_location() + var/obj/item/disk/nuclear/N = locate() in GLOB.poi_list + if(N) + var/list/data = list() + var/turf/T = get_turf(N) + if(T) + data["x"] = T.x + data["y"] = T.y + data["z"] = T.z + var/atom/outer = get_atom_on_turf(N,/mob/living) + if(outer != N) + if(isliving(outer)) + var/mob/living/L = outer + data["holder"] = L.real_name + else + data["holder"] = outer.name + + SSblackbox.record_feedback("associative", "roundend_nukedisk", 1 , data) +>>>>>>> d863eb4... Adds roundend nuke disk location tracking to feedback. (#33660) /datum/controller/subsystem/ticker/proc/gather_newscaster() var/json_file = file("[GLOB.log_directory]/newscaster.json") From dda430131aedded13fefa0fe838242e288f53f5c Mon Sep 17 00:00:00 2001 From: LetterJay Date: Sat, 30 Dec 2017 13:28:58 -0600 Subject: [PATCH 2/3] Update roundend.dm --- code/__HELPERS/roundend.dm | 81 +++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 45 deletions(-) diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 7d95a30cb3..7bb5fa4e93 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -8,42 +8,6 @@ /datum/controller/subsystem/ticker/proc/gather_roundend_feedback() //Survivor numbers var/clients = GLOB.player_list.len - var/surviving_humans = 0 - var/surviving_total = 0 - var/ghosts = 0 - var/escaped_humans = 0 - var/escaped_total = 0 - - for(var/mob/M in GLOB.player_list) - if(ishuman(M)) - if(!M.stat) - surviving_humans++ - if(M.z == ZLEVEL_CENTCOM) - escaped_humans++ - if(!M.stat) - surviving_total++ - if(M.z == ZLEVEL_CENTCOM) - escaped_total++ - - if(isobserver(M)) - ghosts++ - - if(clients) - SSblackbox.record_feedback("nested tally", "round_end_stats", clients, list("clients")) - if(ghosts) - SSblackbox.record_feedback("nested tally", "round_end_stats", ghosts, list("ghosts")) - if(surviving_humans) - SSblackbox.record_feedback("nested tally", "round_end_stats", surviving_humans, list("survivors", "human")) - if(surviving_total) - SSblackbox.record_feedback("nested tally", "round_end_stats", surviving_total, list("survivors", "total")) - if(escaped_humans) - SSblackbox.record_feedback("nested tally", "round_end_stats", escaped_humans, list("escapees", "human")) - if(escaped_total) - SSblackbox.record_feedback("nested tally", "round_end_stats", escaped_total, list("escapees", "total")) - - gather_antag_success_rate() - -/datum/controller/subsystem/ticker/proc/gather_antag_success_rate() var/popcount = count_survivors() SSblackbox.record_feedback("nested tally", "round_end_stats", clients, list("clients")) SSblackbox.record_feedback("nested tally", "round_end_stats", popcount[POPCOUNT_GHOSTS], list("ghosts")) @@ -85,7 +49,6 @@ antag_info["objectives"] += list(list("objective_type"=O.type,"text"=O.explanation_text,"result"=result)) SSblackbox.record_feedback("associative", "antagonists", 1, antag_info) - /datum/controller/subsystem/ticker/proc/record_nuke_disk_location() var/obj/item/disk/nuclear/N = locate() in GLOB.poi_list if(N) @@ -105,17 +68,45 @@ SSblackbox.record_feedback("associative", "roundend_nukedisk", 1 , data) +/datum/controller/subsystem/ticker/proc/gather_newscaster() + var/json_file = file("[GLOB.log_directory]/newscaster.json") + var/list/file_data = list() + var/pos = 1 + for(var/V in GLOB.news_network.network_channels) + var/datum/newscaster/feed_channel/channel = V + if(!istype(channel)) + stack_trace("Non-channel in newscaster channel list") + continue + file_data["[pos]"] = list("channel name" = "[channel.channel_name]", "author" = "[channel.author]", "censored" = channel.censored ? 1 : 0, "author censored" = channel.authorCensor ? 1 : 0, "messages" = list()) + for(var/M in channel.messages) + var/datum/newscaster/feed_message/message = M + if(!istype(message)) + stack_trace("Non-message in newscaster channel messages list") + continue + var/list/comment_data = list() + for(var/C in message.comments) + var/datum/newscaster/feed_comment/comment = C + if(!istype(comment)) + stack_trace("Non-message in newscaster message comments list") + continue + comment_data += list(list("author" = "[comment.author]", "time stamp" = "[comment.time_stamp]", "body" = "[comment.body]")) + file_data["[pos]"]["messages"] += list(list("author" = "[message.author]", "time stamp" = "[message.time_stamp]", "censored" = message.bodyCensor ? 1 : 0, "author censored" = message.authorCensor ? 1 : 0, "photo file" = "[message.photo_file]", "photo caption" = "[message.caption]", "body" = "[message.body]", "comments" = comment_data)) + pos++ + if(GLOB.news_network.wanted_issue.active) + file_data["wanted"] = list("author" = "[GLOB.news_network.wanted_issue.scannedUser]", "criminal" = "[GLOB.news_network.wanted_issue.criminal]", "description" = "[GLOB.news_network.wanted_issue.body]", "photo file" = "[GLOB.news_network.wanted_issue.photo_file]") + WRITE_FILE(json_file, json_encode(file_data)) + /datum/controller/subsystem/ticker/proc/declare_completion() set waitfor = FALSE - to_chat(world, "


The round has ended.") + to_chat(world, "


The round has ended.") if(LAZYLEN(GLOB.round_end_notifiees)) send2irc("Notice", "[GLOB.round_end_notifiees.Join(", ")] the round has ended.") - /*for(var/client/C in GLOB.clients) + for(var/client/C in GLOB.clients) if(!C.credits) C.RollCredits() - C.playtitlemusic(40)*/ + C.playtitlemusic(40) display_report() @@ -136,7 +127,7 @@ send2irc("Server", "Round just ended.") - if(CONFIG_GET(string/cross_server_address)) + if(length(CONFIG_GET(keyed_string_list/cross_server))) send_news_report() CHECK_TICK @@ -240,7 +231,7 @@ num_human_escapees++ if(shuttle_areas[get_area(Player)]) num_shuttle_escapees++ - + .[POPCOUNT_SURVIVORS] = num_survivors .[POPCOUNT_ESCAPEES] = num_escapees .[POPCOUNT_SHUTTLE_ESCAPEES] = num_shuttle_escapees @@ -252,7 +243,7 @@ var/list/parts = list() var/station_evacuated = EMERGENCY_ESCAPED_OR_ENDGAMED var/popcount = count_survivors() - + //Round statistics report var/datum/station_state/end_state = new /datum/station_state() end_state.count() @@ -404,7 +395,7 @@ currrent_category = A.roundend_category previous_category = A result += A.roundend_report() - result += "
" + result += "

" if(all_antagonists.len) var/datum/antagonist/last = all_antagonists[all_antagonists.len] @@ -451,7 +442,7 @@ text += " survived" if(fleecheck) var/turf/T = get_turf(ply.current) - if(!T || !(T.z in GLOB.station_z_levels)) + if(!T || !is_station_level(T.z)) text += " while fleeing the station" if(ply.current.real_name != ply.name) text += " as [ply.current.real_name]" From ea3652c30e0346f2f7e08c8bff2ccfcc50938307 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 1 Jan 2018 11:07:40 -0600 Subject: [PATCH 3/3] fuk --- code/__HELPERS/roundend.dm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 0ba19e795e..d7a51663a5 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -103,10 +103,10 @@ if(LAZYLEN(GLOB.round_end_notifiees)) send2irc("Notice", "[GLOB.round_end_notifiees.Join(", ")] the round has ended.") - for(var/client/C in GLOB.clients) + /*for(var/client/C in GLOB.clients) if(!C.credits) C.RollCredits() - C.playtitlemusic(40) + C.playtitlemusic(40)*/ display_report() @@ -434,10 +434,7 @@ /proc/printplayer(datum/mind/ply, fleecheck) - var/jobtext = "" - if(ply.assigned_role) - jobtext = " the [ply.assigned_role]" - var/text = "[ply.key] was [ply.name][jobtext] and" + var/text = "[ply.key] was [ply.name] the [ply.assigned_role] and" if(ply.current) if(ply.current.stat == DEAD) text += " died" @@ -445,7 +442,7 @@ text += " survived" if(fleecheck) var/turf/T = get_turf(ply.current) - if(!T || !is_station_level(T.z)) + if(!T || !(T.z in GLOB.station_z_levels)) text += " while fleeing the station" if(ply.current.real_name != ply.name) text += " as [ply.current.real_name]"