From aeefeb6c53a32ef8053a15d420b92bd707c0fa4e Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Wed, 12 May 2021 03:33:41 -0700 Subject: [PATCH 01/16] woo --- code/datums/world_topic.dm | 95 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 946090c571..f5ea4257aa 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -207,3 +207,98 @@ if(!key_valid) GLOB.topic_status_cache = . + + +/datum/world_topic/jsonstatus + keyword = "jsonstatus" + +/datum/world_topic/jsonstatus/Run(list/input, addr) + . = list() + .["Gamemode"] = GLOB.master_mode + .["Round ID"] = GLOB.round_id + .["Players"] = GLOB.clients.len + var/list/adm = get_admin_counts() + var/list/presentmins = adm["present"] + var/list/afkmins = adm["afk"] + .["Admins"] = presentmins.len + afkmins.len //equivalent to the info gotten from adminwho + .["Security Level"] = "[NUM2SECLEVEL(GLOB.security_level)]" + .["Round Duration"] = WORLDTIME2TEXT + .["Time Dilation (Avg)"] = SStime_track.time_dilation_avg + return json_encode(.) + +/datum/world_topic/jsonplayers + keyword = "jsonplayers" + +/datum/world_topic/jsonplayers/Run(list/input, addr) + . = list() + for(var/client/C in GLOB.clients) + . += C.key + return json_encode(.) + +/datum/world_topic/jsonmanifest + keyword = "jsonmanifest" + +/datum/world_topic/jsonmanifest/Run(list/input, addr) + var/list/command = list() + var/list/security = list() + var/list/engineering = list() + var/list/medical = list() + var/list/science = list() + var/list/cargo = list() + var/list/civilian = list() + var/list/silicons = list() + var/list/misc = list() + for(var/datum/data/record/R in data_core.general) + var/name = R.fields["name"] + var/rank = R.fields["rank"] + var/real_rank = rank // make_list_rank(R.fields["real_rank"]) + if(real_rank in GLOB.command_positions) + command[name] = rank + else if(real_rank in GLOB.security_positions) + security[name] = rank + else if(real_rank in GLOB.engineering_positions) + engineering[name] = rank + else if(real_rank in GLOB.medical_positions) + medical[name] = rank + else if(real_rank in GLOB.science_positions) + science[name] = rank + else if(real_rank in GLOB.cargo_positions) + cargo[name] = rank + else if(real_rank in GLOB.civilian_positions) + civilian[name] = rank + else + misc[name] = rank + + // Synthetics don't have actual records, so we will pull them from here. + for(var/mob/living/silicon/ai/ai in GLOB.mob_list) + silicons[ai.name] = "Artificial Intelligence" + + for(var/mob/living/silicon/robot/robot in GLOB.mob_list) + // No combat/syndicate cyborgs, no drones, and no AI shells. + if(!robot.scrambledcodes && !robot.shell && !(robot.module && robot.module.hide_on_manifest)) + silicons[robot.name] = "[robot.modtype] [robot.braintype]" + . = list() + .["Command"] = command + .["Security"] = security + .["Engineering"] = engineering + .["Medical"] = medical + .["Science"] = science + .["Cargo"] = cargo + .["Civilian"] = civilian + .["Silicons"] = silicons + .["Misc"] = misc + return json_encode(.) + +/datum/world_topic/jsonrevision + keyword = "jsonrevision" + +/datum/world_topic/jsonrevision/Run(list/input, addr) + . = list() + var/datum/getrev/revdata = GLOB.revdata + .["branch"] = "master" + .["data"] = revdata.date + .["dd_version"] = world.byond_build + .["dm_version"] = DM_BUILD + .["gameid"] = GLOB.round_id + .["revision"] = revdata.commit + return json_encode(.) From 3fb84eb1d829aa0c4a0b380cf0d166c7dc73fdc5 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Wed, 12 May 2021 03:35:02 -0700 Subject: [PATCH 02/16] fix --- code/datums/world_topic.dm | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index f5ea4257aa..b40e3b244e 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -222,7 +222,7 @@ var/list/afkmins = adm["afk"] .["Admins"] = presentmins.len + afkmins.len //equivalent to the info gotten from adminwho .["Security Level"] = "[NUM2SECLEVEL(GLOB.security_level)]" - .["Round Duration"] = WORLDTIME2TEXT + .["Round Duration"] = WORLDTIME2TEXT("hh:mm:ss") .["Time Dilation (Avg)"] = SStime_track.time_dilation_avg return json_encode(.) @@ -246,9 +246,8 @@ var/list/science = list() var/list/cargo = list() var/list/civilian = list() - var/list/silicons = list() var/list/misc = list() - for(var/datum/data/record/R in data_core.general) + for(var/datum/data/record/R in GLOB.data_core.general) var/name = R.fields["name"] var/rank = R.fields["rank"] var/real_rank = rank // make_list_rank(R.fields["real_rank"]) @@ -262,21 +261,13 @@ medical[name] = rank else if(real_rank in GLOB.science_positions) science[name] = rank - else if(real_rank in GLOB.cargo_positions) + else if(real_rank in GLOB.supply_positions) cargo[name] = rank else if(real_rank in GLOB.civilian_positions) civilian[name] = rank else misc[name] = rank - // Synthetics don't have actual records, so we will pull them from here. - for(var/mob/living/silicon/ai/ai in GLOB.mob_list) - silicons[ai.name] = "Artificial Intelligence" - - for(var/mob/living/silicon/robot/robot in GLOB.mob_list) - // No combat/syndicate cyborgs, no drones, and no AI shells. - if(!robot.scrambledcodes && !robot.shell && !(robot.module && robot.module.hide_on_manifest)) - silicons[robot.name] = "[robot.modtype] [robot.braintype]" . = list() .["Command"] = command .["Security"] = security @@ -285,7 +276,6 @@ .["Science"] = science .["Cargo"] = cargo .["Civilian"] = civilian - .["Silicons"] = silicons .["Misc"] = misc return json_encode(.) From 482be2ee0d8b9ad971aeac22173f6c36c99ee052 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Wed, 12 May 2021 16:37:13 -0700 Subject: [PATCH 03/16] okay --- code/datums/world_topic.dm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index b40e3b244e..7380db05ad 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -214,16 +214,16 @@ /datum/world_topic/jsonstatus/Run(list/input, addr) . = list() - .["Gamemode"] = GLOB.master_mode - .["Round ID"] = GLOB.round_id - .["Players"] = GLOB.clients.len + .["mode"] = GLOB.master_mode + .["round_id"] = GLOB.round_id + .["players"] = GLOB.clients.len var/list/adm = get_admin_counts() var/list/presentmins = adm["present"] var/list/afkmins = adm["afk"] - .["Admins"] = presentmins.len + afkmins.len //equivalent to the info gotten from adminwho - .["Security Level"] = "[NUM2SECLEVEL(GLOB.security_level)]" - .["Round Duration"] = WORLDTIME2TEXT("hh:mm:ss") - .["Time Dilation (Avg)"] = SStime_track.time_dilation_avg + .["admins"] = presentmins.len + afkmins.len //equivalent to the info gotten from adminwho + .["security_level"] = "[NUM2SECLEVEL(GLOB.security_level)]" + .["round_duration"] = WORLDTIME2TEXT("hh:mm:ss") + .["map"] = SSmapping.config.map_name return json_encode(.) /datum/world_topic/jsonplayers @@ -285,10 +285,11 @@ /datum/world_topic/jsonrevision/Run(list/input, addr) . = list() var/datum/getrev/revdata = GLOB.revdata - .["branch"] = "master" .["data"] = revdata.date .["dd_version"] = world.byond_build + .["dd_build"] = world.byond_version .["dm_version"] = DM_BUILD + .["dm_build"] = DM_VERSION .["gameid"] = GLOB.round_id .["revision"] = revdata.commit return json_encode(.) From 0b9d021d9b44fd1574411eccc212d3f138030f96 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Wed, 12 May 2021 16:51:28 -0700 Subject: [PATCH 04/16] woo --- code/datums/world_topic.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 7380db05ad..5bc8db94f2 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -279,10 +279,10 @@ .["Misc"] = misc return json_encode(.) -/datum/world_topic/jsonrevision - keyword = "jsonrevision" +/datum/world_topic/revision + keyword = "revision" -/datum/world_topic/jsonrevision/Run(list/input, addr) +/datum/world_topic/revision/Run(list/input, addr) . = list() var/datum/getrev/revdata = GLOB.revdata .["data"] = revdata.date @@ -292,4 +292,4 @@ .["dm_build"] = DM_VERSION .["gameid"] = GLOB.round_id .["revision"] = revdata.commit - return json_encode(.) + return list2params(.) From 6237928c4b4f439812c521c4800b43f06cb3d9df Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Wed, 12 May 2021 16:55:21 -0700 Subject: [PATCH 05/16] woo --- code/datums/world_topic.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 5bc8db94f2..eda3089905 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -285,7 +285,7 @@ /datum/world_topic/revision/Run(list/input, addr) . = list() var/datum/getrev/revdata = GLOB.revdata - .["data"] = revdata.date + .["date"] = revdata.date .["dd_version"] = world.byond_build .["dd_build"] = world.byond_version .["dm_version"] = DM_BUILD From 2a3a45573fd7262accd4f7d6ccbaa91eee7e6d5c Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Wed, 12 May 2021 16:58:17 -0700 Subject: [PATCH 06/16] woo --- code/datums/world_topic.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index eda3089905..e82543371c 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -169,7 +169,7 @@ .["vote"] = CONFIG_GET(flag/allow_vote_mode) .["ai"] = CONFIG_GET(flag/allow_ai) .["host"] = world.host ? world.host : null - .["round_id"] = GLOB.round_id + .["round_id"] = "[GLOB.round_id]" .["players"] = GLOB.clients.len .["revision"] = GLOB.revdata.commit .["revision_date"] = GLOB.revdata.date @@ -290,6 +290,6 @@ .["dd_build"] = world.byond_version .["dm_version"] = DM_BUILD .["dm_build"] = DM_VERSION - .["gameid"] = GLOB.round_id + .["gameid"] = "[GLOB.round_id]"" .["revision"] = revdata.commit return list2params(.) From 59f160be577fd3a8aa65a70346d81a14f002b838 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Wed, 12 May 2021 16:59:48 -0700 Subject: [PATCH 07/16] woo --- code/datums/world_topic.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index e82543371c..02abbdd8e9 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -169,7 +169,7 @@ .["vote"] = CONFIG_GET(flag/allow_vote_mode) .["ai"] = CONFIG_GET(flag/allow_ai) .["host"] = world.host ? world.host : null - .["round_id"] = "[GLOB.round_id]" + .["round_id"] = GLOB.round_id .["players"] = GLOB.clients.len .["revision"] = GLOB.revdata.commit .["revision_date"] = GLOB.revdata.date @@ -215,7 +215,7 @@ /datum/world_topic/jsonstatus/Run(list/input, addr) . = list() .["mode"] = GLOB.master_mode - .["round_id"] = GLOB.round_id + .["round_id"] = "[GLOB.round_id]" .["players"] = GLOB.clients.len var/list/adm = get_admin_counts() var/list/presentmins = adm["present"] @@ -290,6 +290,6 @@ .["dd_build"] = world.byond_version .["dm_version"] = DM_BUILD .["dm_build"] = DM_VERSION - .["gameid"] = "[GLOB.round_id]"" + .["gameid"] = "[GLOB.round_id]" .["revision"] = revdata.commit return list2params(.) From 8e2921f3c041f9eca69735769d3a681bfb358bff Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Wed, 12 May 2021 17:36:01 -0700 Subject: [PATCH 08/16] woo --- code/datums/world_topic.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 02abbdd8e9..da8e323b09 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -285,7 +285,7 @@ /datum/world_topic/revision/Run(list/input, addr) . = list() var/datum/getrev/revdata = GLOB.revdata - .["date"] = revdata.date + .["date"] = copytext(revdata.date, 1, 11) .["dd_version"] = world.byond_build .["dd_build"] = world.byond_version .["dm_version"] = DM_BUILD From 55ee9a00b4249cedf61cd0b8fb7d237e7acb5b55 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Wed, 12 May 2021 18:24:26 -0700 Subject: [PATCH 09/16] woo yeah woo yeah --- code/datums/world_topic.dm | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index da8e323b09..1fff4cc026 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -279,17 +279,23 @@ .["Misc"] = misc return json_encode(.) -/datum/world_topic/revision - keyword = "revision" +/datum/world_topic/jsonrevision/Run(list/input, addr) + var/datum/getrev/revdata = GLOB.revdata + var/list/data = list( + "date" = copytext(revdata.date, 1, 11), + "dd_version" = world.byond_version, + "dd_build" = world.byond_build, + "dm_version" = DM_VERSION, + "dm_build" = DM_BUILD, + "revision" = revdata.commit, + "testmerge_base_url" = "[CONFIG_GET(string/githuburl)]/pull/" + ) + if (revdata.testmerge.len) + for (var/datum/tgs_revision_information/test_merge/TM in revdata.testmerge) + data["testmerges"] += list(list( + "id" = TM.number, + "desc" = TM.title, + "author" = TM.author + )) -/datum/world_topic/revision/Run(list/input, addr) - . = list() - var/datum/getrev/revdata = GLOB.revdata - .["date"] = copytext(revdata.date, 1, 11) - .["dd_version"] = world.byond_build - .["dd_build"] = world.byond_version - .["dm_version"] = DM_BUILD - .["dm_build"] = DM_VERSION - .["gameid"] = "[GLOB.round_id]" - .["revision"] = revdata.commit - return list2params(.) + return json_encode(data) From 8ff0685f0df7f93959ec4ecc676a94f8ceeaeb21 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Sat, 15 May 2021 18:28:00 -0700 Subject: [PATCH 10/16] Update world_topic.dm --- code/datums/world_topic.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 1fff4cc026..c349bc6504 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -232,6 +232,9 @@ /datum/world_topic/jsonplayers/Run(list/input, addr) . = list() for(var/client/C in GLOB.clients) + if(C.holder?.fakekey) + . += C.holder.fakekey + continue . += C.key return json_encode(.) From f802890153d88496ef0ff738c89582b98ede9171 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Sun, 16 May 2021 22:17:50 -0700 Subject: [PATCH 11/16] Update world_topic.dm --- code/datums/world_topic.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index c349bc6504..fb0c4e0cd3 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -207,14 +207,12 @@ if(!key_valid) GLOB.topic_status_cache = . - - /datum/world_topic/jsonstatus keyword = "jsonstatus" /datum/world_topic/jsonstatus/Run(list/input, addr) . = list() - .["mode"] = GLOB.master_mode + .["mode"] = "hidden" // GLOB.master_mode - woops we don't want people to know if there's secret/extended :) .["round_id"] = "[GLOB.round_id]" .["players"] = GLOB.clients.len var/list/adm = get_admin_counts() From f07d832cad3aa6521787e1d9e68689e9b0bbe61e Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Fri, 21 May 2021 18:20:28 -0700 Subject: [PATCH 12/16] Update world_topic.dm --- code/datums/world_topic.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index fb0c4e0cd3..1f40f7d726 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -280,6 +280,9 @@ .["Misc"] = misc return json_encode(.) +/datum/world_topic/jsonrevision + keyword = "jsonrevision" + /datum/world_topic/jsonrevision/Run(list/input, addr) var/datum/getrev/revdata = GLOB.revdata var/list/data = list( From 0dd24d9de9a59d4ef344d758d5cb7035b4a40be7 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Fri, 21 May 2021 19:35:46 -0700 Subject: [PATCH 13/16] Update world_topic.dm --- code/datums/world_topic.dm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 1f40f7d726..1edb73d338 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -252,9 +252,7 @@ var/name = R.fields["name"] var/rank = R.fields["rank"] var/real_rank = rank // make_list_rank(R.fields["real_rank"]) - if(real_rank in GLOB.command_positions) - command[name] = rank - else if(real_rank in GLOB.security_positions) + if(real_rank in GLOB.security_positions) security[name] = rank else if(real_rank in GLOB.engineering_positions) engineering[name] = rank @@ -268,6 +266,9 @@ civilian[name] = rank else misc[name] = rank + // mixed departments, /datum/department when + if(real_rank in GLOB.command_positions) + command[name] = rank . = list() .["Command"] = command From 71db9298a1bb3d2862c9b3bf5d0b997c622b88ee Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Fri, 28 May 2021 18:21:46 -0700 Subject: [PATCH 14/16] Update world_topic.dm --- code/datums/world_topic.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 1edb73d338..de3b887a09 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -293,6 +293,7 @@ "dm_version" = DM_VERSION, "dm_build" = DM_BUILD, "revision" = revdata.commit, + "round_id" = "[GLOB.round_id]" "testmerge_base_url" = "[CONFIG_GET(string/githuburl)]/pull/" ) if (revdata.testmerge.len) From 656d0545cd4731c384b591f695079da7ee1ff77d Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Tue, 1 Jun 2021 01:32:54 -0700 Subject: [PATCH 15/16] Update world_topic.dm --- code/datums/world_topic.dm | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index de3b887a09..434c0c9b59 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -285,23 +285,23 @@ keyword = "jsonrevision" /datum/world_topic/jsonrevision/Run(list/input, addr) - var/datum/getrev/revdata = GLOB.revdata - var/list/data = list( - "date" = copytext(revdata.date, 1, 11), - "dd_version" = world.byond_version, - "dd_build" = world.byond_build, - "dm_version" = DM_VERSION, - "dm_build" = DM_BUILD, - "revision" = revdata.commit, + var/datum/getrev/revdata = GLOB.revdata + var/list/data = list( + "date" = copytext(revdata.date, 1, 11), + "dd_version" = world.byond_version, + "dd_build" = world.byond_build, + "dm_version" = DM_VERSION, + "dm_build" = DM_BUILD, + "revision" = revdata.commit, "round_id" = "[GLOB.round_id]" - "testmerge_base_url" = "[CONFIG_GET(string/githuburl)]/pull/" - ) - if (revdata.testmerge.len) - for (var/datum/tgs_revision_information/test_merge/TM in revdata.testmerge) - data["testmerges"] += list(list( - "id" = TM.number, - "desc" = TM.title, - "author" = TM.author - )) + "testmerge_base_url" = "[CONFIG_GET(string/githuburl)]/pull/" + ) + if (revdata.testmerge.len) + for (var/datum/tgs_revision_information/test_merge/TM in revdata.testmerge) + data["testmerges"] += list(list( + "id" = TM.number, + "desc" = TM.title, + "author" = TM.author + )) - return json_encode(data) + return json_encode(data) From 0d206742fa083f7ff841975871241e95ce0bf063 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Tue, 1 Jun 2021 21:35:49 -0700 Subject: [PATCH 16/16] Update world_topic.dm --- code/datums/world_topic.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 434c0c9b59..6b8d1c9ce5 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -293,7 +293,7 @@ "dm_version" = DM_VERSION, "dm_build" = DM_BUILD, "revision" = revdata.commit, - "round_id" = "[GLOB.round_id]" + "round_id" = "[GLOB.round_id]", "testmerge_base_url" = "[CONFIG_GET(string/githuburl)]/pull/" ) if (revdata.testmerge.len)