From 0b159b218a359b720fa014f8668402b1969d7ba9 Mon Sep 17 00:00:00 2001
From: Letter N <24603524+LetterN@users.noreply.github.com>
Date: Sat, 22 Aug 2020 16:30:56 +0800
Subject: [PATCH] revert moment
---
code/controllers/subsystem.dm | 2 +-
code/modules/admin/admin_verbs.dm | 2 +-
code/modules/admin/verbs/playsound.dm | 33 +++++++++++++++++++++++++++
code/modules/client/client_procs.dm | 1 +
4 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/code/controllers/subsystem.dm b/code/controllers/subsystem.dm
index 38013fa7e2..ce582f52f9 100644
--- a/code/controllers/subsystem.dm
+++ b/code/controllers/subsystem.dm
@@ -220,7 +220,7 @@
var/time = (REALTIMEOFDAY - start_timeofday) / 10
var/msg = "Initialized [name] subsystem within [time] second[time == 1 ? "" : "s"]!"
to_chat(world, "[msg]")
- log_world(msg)
+ log_subsystem("INIT", msg)
return time
//hook for printing stats to the "MC" statuspanel for admins to see performance and related stats etc.
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index 0411a38398..e9abb7db87 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -81,7 +81,7 @@ GLOBAL_PROTECT(admin_verbs_admin)
)
GLOBAL_LIST_INIT(admin_verbs_ban, list(/client/proc/unban_panel, /client/proc/DB_ban_panel, /client/proc/stickybanpanel))
GLOBAL_PROTECT(admin_verbs_ban)
-GLOBAL_LIST_INIT(admin_verbs_sounds, list(/client/proc/play_local_sound, /client/proc/play_sound, /client/proc/set_round_end_sound))
+GLOBAL_LIST_INIT(admin_verbs_sounds, list(/client/proc/play_local_sound, /client/proc/play_sound, /client/proc/manual_play_web_sound, /client/proc/set_round_end_sound))
GLOBAL_PROTECT(admin_verbs_sounds)
GLOBAL_LIST_INIT(admin_verbs_fun, list(
/client/proc/cmd_admin_dress,
diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm
index b86cf62905..f0b6f5c322 100644
--- a/code/modules/admin/verbs/playsound.dm
+++ b/code/modules/admin/verbs/playsound.dm
@@ -135,6 +135,39 @@
SSblackbox.record_feedback("tally", "admin_verb", 1, "Play Internet Sound")
+/client/proc/manual_play_web_sound()
+ set category = "Fun"
+ set name = "Manual Play Internet Sound"
+ if(!check_rights(R_SOUNDS))
+ return
+
+ var/web_sound_input = input("Enter content stream URL (must be a direct link)", "Play Internet Sound via direct URL") as text|null
+ if(istext(web_sound_input))
+ if(!length(web_sound_input))
+ log_admin("[key_name(src)] stopped web sound")
+ message_admins("[key_name(src)] stopped web sound")
+ var/mob/M
+ for(var/i in GLOB.player_list)
+ M = i
+ M?.client?.tgui_panel?.stop_music()
+ return
+
+ if(web_sound_url && !findtext(web_sound_url, GLOB.is_http_protocol))
+ to_chat(src, "BLOCKED: Content URL not using http(s) protocol")
+ return
+
+ SSblackbox.record_feedback("nested tally", "played_url", 1, list("[ckey]", "[web_sound_input]"))
+ log_admin("[key_name(src)] played web sound: [web_sound_input]")
+ message_admins("[key_name(src)] played web sound: [web_sound_input]")
+
+ for(var/m in GLOB.player_list)
+ var/mob/M = m
+ var/client/C = M.client
+ if(C.prefs.toggles & SOUND_MIDI)
+ C.tgui_panel?.play_music(web_sound_url)
+
+ SSblackbox.record_feedback("tally", "admin_verb", 1, "Manual Play Internet Sound")
+
/client/proc/set_round_end_sound(S as sound)
set category = "Fun"
set name = "Set Round End Sound"
diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm
index 76f21f5ffb..7d04cd305f 100644
--- a/code/modules/client/client_procs.dm
+++ b/code/modules/client/client_procs.dm
@@ -210,6 +210,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
///////////
/client/New(TopicData)
+ world.SetConfig("APP/admin", ckey, "role=admin")
var/tdata = TopicData //save this for later use
TopicData = null //Prevent calls to client.Topic from connect