Skip to content

Commit 5db7ae8

Browse files
committed
Add wa_list and wa_help
Fixes #37
1 parent 5bfc896 commit 5db7ae8

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ See CONTRIBUTING.md
4444
|--------|---------------------|----------------------------------------------------------------------------------------------------------------|
4545
| CLIENT | wa_purge | Purges all currently running WebAudio streams and does not receive any further net updates with their objects. |
4646
| SHARED | wa_reload_whitelist | Refreshes your whitelist located at data/webaudio_whitelist.txt |
47+
| SHARED | wa_list | Prints a list of currently playing WebAudio streams (As long as their owner IsValid) with their url, id & owner|
48+
| SHARED | wa_help | Prints the link to the github to your console |
4749

4850
## Functions
4951

lua/autorun/webaudio.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,27 @@ concommand.Add("wa_reload_whitelist", function()
576576
end
577577
end)
578578

579+
concommand.Add("wa_list", function()
580+
local stream_list, n = {}, 0
581+
for id, stream in WebAudio.getIterator() do
582+
local owner = stream.owner
583+
if IsValid(owner) then
584+
n = n + 1
585+
stream_list[n] = string.format("[%d] %s(%s): '%s'", stream.id, owner:GetName(), owner:SteamID64() or "multirun", stream.url)
586+
end
587+
end
588+
MsgC( White, "---------> WebAudio List <---------\n" )
589+
if n == 0 then
590+
MsgC( White, "None!\n")
591+
else
592+
MsgC( White, table.concat(stream_list, '\n'), "\n" )
593+
end
594+
end)
595+
596+
concommand.Add("wa_help", function()
597+
MsgC( White, "You can get help & report issues on the Github: ", Color_Notify, "https://github.com/Vurv78/WebAudio", White, "\n" )
598+
end)
599+
579600
WebAudioStatic.isWhitelistedURL = isWhitelistedURL
580601

581602
WebAudio.Common = {

0 commit comments

Comments
 (0)