From c37bd6912f8a78074817c021b02c8f50a55399cd Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Wed, 7 Nov 2018 16:15:05 -0800 Subject: [PATCH] Update playsound.dm --- code/modules/admin/verbs/playsound.dm | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 97cc991523..a89250dcc1 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -144,6 +144,42 @@ message_admins("[key_name_admin(src)] set the round end sound to [S]") SSblackbox.record_feedback("tally", "admin_verb", 1, "Set Round End Sound") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +/client/proc/play_web_sound_manual() + set category = "Fun" + set name = "Manual Play Internet Sound" + if(!check_rights(R_SOUNDS)) + return + + var/web_sound_input = input("Enter youtube-dl fetched content URL (supported sites only, leave blank to stop playing)", "Send youtube-dl media link") as text|null + if(!istext(web_sound_input)) + return + web_sound_input = trim(web_sound_input) + if(!length(web_sound_input)) + log_admin("[key_name(src)] stopped web sound") + message_admins("[key_name(src)] stopped web sound") + for(var/m in player_list) + var/mob/M = m + var/client/C = M.client + if((C.prefs.toggles & SOUND_MIDI) && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded) + C.chatOutput.stopMusic() + return + var/freq = input(usr, "What frequency would you like the sound to play at?",, 1) as null|num + if(!freq) + return + if(web_sound_input && !findtext(web_sound_input, is_http_protocol)) + to_chat(src, "BLOCKED: Content URL not using http(s) protocol") + to_chat(src, "The media provider returned a content URL that isn't using the HTTP or HTTPS protocol") + return + + SSblackbox.record_feedback("nested tally", "played_url_manual", 1, list("[ckey]", "[web_sound_input]")) + log_admin("[key_name(src)] manually played web sound: [web_sound_input]") + message_admins("[key_name(src)] manually played web sound: HREF") + for(var/m in GLOB.player_list) + var/mob/M = m + var/client/C = M.client + if((C.prefs.toggles & SOUND_MIDI) && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded) + C.chatOutput.sendMusic(web_sound_url, pitch) + /client/proc/stop_sounds() set category = "Debug" set name = "Stop All Playing Sounds"