Commit Graph

74 Commits

Author SHA1 Message Date
Grocel
d4716dc4dd Added better URL logging with less spam. Fixed Lua error. 2024-12-06 23:08:44 +01:00
Grocel
47990e1939 Fixed "3DStreamRadio_UrlIsAllowed" hook not being called.
Co-Authored-By: SligWolf <17761396+SligWolf@users.noreply.github.com>
2024-11-23 18:38:46 +01:00
Grocel
08a75b5510 Added serverside logging for stream URLs, added hook 3DStreamRadio_UrlIsAllowed. 2024-11-19 00:22:51 +01:00
Grocel
4b03ffec85 Fix for #23 and other stuff.
- Fixed draw distance not working properly (#23)
- Removed broken community playlists. GG-Radio has been taken offline.
- Fixed Noise-fm playlist
- Fixed stream title output
2024-09-06 23:46:25 +02:00
Grocel
172add7ed5 Fixed a bug with -disablehttp, moved shipped playlist to data_static, added BBC to playlists, removed DW playlist 2024-07-31 23:34:05 +02:00
Grocel
aec2918fd8 Fixed error lua/streamradio_core/network.lua:673: attempt to index local 'entTable' (a nil value) 2024-06-11 19:14:34 +02:00
Grocel
fcb96c3ffc Fixed performance issues on quieter-behind tracers 2024-02-17 15:25:19 +01:00
Grocel
9f84e26fdd Recompiled radio models. Removed an unneeded function.
Co-Authored-By: Wolf <17761396+sligwolf@users.noreply.github.com>
2024-01-07 20:22:15 +01:00
Grocel
8ffd79a393 Improved error handling and fixed broken loading 2024-01-04 23:43:19 +01:00
Grocel
be5afd0802 Fixed extrem slow loading time on some clients
- This was done by replacing `file.Exists(luafile, "LUA")` with a custom implementation. See: https://github.com/Facepunch/garrysmod-issues/issues/5674
2023-12-31 22:27:06 +01:00
Grocel
cca3c64aa8 Improved load times on some cases and updated wirelink support
- Removed `collectgarbage( "collect" )` calls to improve load times on some cases.
- Updated Wirelink detection to upcomming Wiremod changes.
2023-12-30 04:25:31 +01:00
Grocel
296ed5cd7b Fixed fonts being duplicated and removed math.randomseed calls 2023-11-24 23:25:09 +01:00
Grocel
1e4e1856ae Fixed songs loops and allow URLs from admin radios
- Fixed songs ending with "sound stopped" on song switch
- Radios owned by admins will allow all URLs as admins are a trusted sources of media. ConVar: `sv_streamradio_url_whitelist_trust_admin_radios 0/1`, Enabled by default.
2023-11-14 01:40:07 +01:00
Grocel
f46b5c1e55 Fixed Lua Errors, clean up and added a GUI skin
- Fixed Lua errors:
  - `lua/streamradio_core/tool.lua:480: attempt to call method 'GetMode' (a nil value)`
  - `lua/entities/base_streamradio.lua:486: attempt to index upvalue 'LIBUtil' (a nil value)`
- Fixed global scope pollution
- Some code clean up and new glualint config
- Added a new GUI skin preset called "Stream Original"
2023-11-09 03:52:37 +01:00
Grocel
7959186671 Updated help texts, changed whitelist logic
- Updated help and description texts to reflect the latest changes. Spelling and grammar fixes.
- Added info buttons and new options to admin panel
- Updated help links in whitelisting errors
- CFC Whitelist and built-in whitelist logic are completely separated now
- Added ConVar `sv_streamradio_url_whitelist_enable_on_cfcwhitelist`. Built-in whitelist is disabled by default if CFC Whitelist is installed to improve radio usability. Use added ConVar to change this behavior. It's safe to change.
2023-10-30 00:40:04 +01:00
Grocel
190039d575 Fixes Lua error in VR and playback error screen 2023-10-26 19:50:18 +02:00
Grocel
d902a7569c Fixes to "stopsounds" and better whitelisting code
- Fixed "stopsounds" concommand not working on radios.
- Added GUI cases and controls to resume radios stopped by "stopsounds".
- Added context menu options for resuming radios stopped by "stopsounds".
- Improved Dropbox support with CFC HTTP Whitelist.
- Improved URL checks for addon's whitelist.
- Improved URL checks for CFC HTTP Whitelist.
- Improved rendering performance of GUIs a bit..
- Refactored auto converters for URLs and removed dead YouTube code.
- Added max age of files (7 days) to the cache system. Older cache files are deleted.
- Moved the file cache location to "cache-sv" and "cache-cl" for server/client. The old cache directory is wiped.
2023-10-26 03:48:57 +02:00
Grocel
57cb64a349 Added Stream URL whitelisting, optimized netcode
- Added Stream URL whitelisting:
  - It is on by default, even for existing installs.
  - Can be changed in admin panel or via console `sv_streamradio_url_whitelist_enable 1/0`. Although, it is not recommended to turn it off.
  - Clients will ask the server if a URL is good. If it isn't, any attempt to play from it will result in error 1000 (`STREAM_ERROR_URL_NOT_WHITELISTED`). This will prevent radio abuse such as IP graping and other malicious intends. You can ask an admin to have it whitelisted on the server.
  - Whitelists is based on the installed playlist.
  - Added several ways for admins to quickly add new whitelist entries to so-called quick-whitelists. Quick-whitelists are playlist files too.
  - Removed `sv_streamradio_allow_customurls`, as it has been replaced with the new whitelisting.
  - Added integration for CFC HTTP Whitelist to this addon's whitelist. If CFC whitelists an URL, the addon will whitelist it for your client too (but not necessarily for others).

- Improved info texts a bit.
- Optimized networking to have less entity.__index calls.
- Added better URL and path sanitation.
- Fixed potential race conditions when loading files or streams.
2023-10-23 18:17:06 +02:00
Grocel
423b6e6f2b Fixed E2 wirelinks not working (#20) 2023-10-13 22:41:31 +02:00
Grocel
6fa5098743 Fixed offline Stream URLs with spaces being broken.
- Added extra error code for drive letter paths ("C:/..."). These never worked and shouldn't be used. This will help users to learn how to use relative paths.
- Added more information about relative paths to the Stream URL description in the spawner tool.
- Removed crash fix in an debug output, as it it has been fixed on engine level. Requires latest game version.
2023-09-10 20:04:09 +02:00
Grocel
aa7c08c274 Fixed playback getting stuck at the end of some songs. 2023-09-10 17:36:41 +02:00
somefoolouthere
ffa6de6c2e
Show "flac" and "webm" files when browsing sound files 2023-09-07 20:50:46 -04:00
Grocel
63a85a33b9 Fixed radio not playing on spawn. Crash fix.
- Fixed radio not playing from toolgun on spawn.
- Fixed a crash when the radio is being looked at in developer 1 on some streams. This was caused by a debugoverlay.EntityTextAtPosition() call.
- Improved Stream URL text fields. They are multi line now to improve UX with long URLs. You can still put only one URL it it, though.
- Put the Toolgun Stream URL description into a collapsible box.
- Sanitized Stream URLs to prevent abuse with malformed URLs.
- Limited Stream URLs to 480 chars (GMod networking limit). This also prevents abuse.
- Radios owned by admins are no longer affected by "sv_streamradio_allow_customurls 1". So admins can always spawn radios with customs URLs.
- Changes to "sv_streamradio_allow_customurls" will affect all spawned radios immediately. Including automatically stopping/resuming streams with "illegal" URLs.
- Added multiple Wire Inputs and Outputs for Display and switching tracks.
2023-08-12 02:35:11 +02:00
Grocel
e291000b56 Fixed #15, improved Tool UI, added Admin Setting.
- Moved playlist logic away from GUI to entity (fixes #15).
- Improved Toolgun UI, added description and examples for the "Stream URL" field.
- Improved property options UI and added Play/Pause, Stop, and Next/Previous track options.
- Added admin settings panel.
- Added more Wire Outputs.
- Fixed more potential memory leaks.
- Minor playlist fixes.
2023-08-10 05:30:01 +02:00
Grocel
3b203bab81 No more song restart and a new loading screen
- Fixed the radio restarting the song when a new player approaches it.
- Fixed dupe load up being wonky sometimes.
- Fixed networking being wonky sometimes. It should no longer getting stuck on some servers.
- Added a new loading screen. It is used when the GUI loads up.
- Added an option to reset the GUI in case it went stuck.
- Changed the noise sound to start up later, so no more static noise between songs.
- Local and caches songs are played immediately now.
- Fixed a ton of race conditions in GUI.
- Long songs (longer than 1.5 hours) can not longer be cached.
- Fixed potential memory leaks.
2023-07-29 04:05:18 +02:00
Grocel
921a58fcbe More optimizations, error/bug fixes and clean up.
- Fixed addon not loading on some servers. Fixed error spam.
- A lot of minor optimizations and some code clean up
- Reduced networking footprint of lists and GUI skins.
- Better error handling. If the addon won't load, it will tell you why in a graceful way. This fixes error spams.
- The addon loads on servers with version 230628 or later now. This also fixes error spams.
- Some hardening against abuse. All network caches are limited now, so they no longer fill up until out of memory. Caches are cleared on overflow and on map cleanup event.
2023-07-25 05:36:29 +02:00
Grocel
24fa680369 Fixed Radio being broken if cfc_cl_http_whitelist was installed. 2023-07-20 17:45:16 +02:00
Grocel
eabc71f73e Anti-Abuse / security changes, bugfixes, better UX and better performance.
UX:
- Moved error buttons to the side to make more space for the error message.
- Added entity options (C-Menu > Right click) for the radio.
- Added clientside only options to the entity options and entity property editor for volume and muting. (Not affected by Prop Protection)
- Added a clientside only way to look up the error state and the URL on GUI less radios (e.g. speakers). (Not affected by Prop Protection)
- Added a better explanation for "error 20".
- Added more error codes for future updates.
- Added mute option (not clientside!) to the toolgun and added seperator lines to its UI.

Performance / Networking:
- Networking is now delayed to ease on the server performance.
- The GUI is loaded with a delay to avoid freezes on radio spawns.
- The GUI is actually deleted when disabled instead of just being hidden.
- Fixed freezes when entering/leaving a room full of radios.
- The radio being randomly broken/desynced (empty or white screen) on spawn is a way less likely to happen. If it does disabling/enabling the GUI can fix it.

Anti-Abuse / Security:
- Radios from other players can be muted via the addon settings. Does not support buddies.
- Individual radios can be muted on the clientside, even if Prop Protection would block access otherwise.
- Individual radios can have their volume changed the clientside, even if Prop Protection would block access otherwise.
- Added support to the cfc_cl_http_whitelist addon. It is a security addon that whitelist and monitors HTTP and streaming requests. The Radio has a decicated error state for blocked URLs and content now.
- Clientside GM_BASS3 loading can be disabled by the server. (sv_streamradio_bass3_allow_client 0)

ConVars:
- Changed the CVar default of sv_streamradio_rebuildplaylists_community_auto to 2. Pre-existing installs are not affected.
- Added sv_streamradio_bass3_enable: When set to 1, it uses GM_BASS3 on the server if installed. Default: 1
- Added sv_streamradio_bass3_allow_client: Allows connected clients to use GM_BASS3 when set to 1. Overrides cl_streamradio_bass3_enable. Default: 1
- Added cl_streamradio_bass3_enable: When set to 1, it uses GM_BASS3 if installed and allowed on the server. Default: 1

GM_BASS3:
- If installed GM_BASS3 is lazy loaded now. It only loads if it is actually needed by an radio. GM_BASS3 is not supported on x86-64 branches.
2023-07-19 22:58:41 +02:00
Grocel
d40c39aa23 Fixed dropbox support not working for some users. 2023-06-24 00:27:51 +02:00
Grocel
356ff23788 Moved networking back to NW2
- This should fix the playlist not loading for some users.
- Fixed radio entities being miscounted on the client side for some users.
- Moved bigrig.fm to new URL. It still might not work as it is currently down.
2023-06-12 18:57:44 +02:00
Grocel
56bcb1ffc0 Fixed a bad calls to PlayerUse hook causing lua errors with many addons
- Added a cache to prop protection +USE checks avoid call spams. The cache expires after 3 seconds.
- Fixed some edge cases with attempting to use a radio blocked by prop protection.
- Fixed display freezing or menus disappearing when they aren't supposed too.

Thanks for reporting this issue on Steam:
- [DSTM] hesitantv4mpire
- BEan
2023-06-09 02:14:49 +02:00
Grocel
e950f54a01 New Features, Better Networking, Faster Performance
- Added option for cursor in VR. It was requested by user Peekofwar on Steam.
- Added button for switching playback mode (no loop, song loop, playlist loop). Fixes #12
- Added option for the playback mode to the Toolgun.
- Added/Changed Wiremod ports represent the playback mode.
- Added support (including the GUI) for the Wiremod User entity. It can be used in contraptions to trigger use operations (+use) as like as play would do on other entities.
- Changed playlist icons to a new custom one.

- Moved networking from NW2Vars to NWVars, because NW2 is actually a buggy unfinished mess.
- Fixed multiple cases of networking being unreliable casing the radio being wonky in multiplayer. It should be much more robust now.
- Reduced networking overhead, by utilizing string tables for repeated strings.

- Improved overall performance.
- Fixed huge FPS drops when seeking songs. This happened also when the radio synchronizes between players or other radios (master / slave setup).
- The GUI is no longer re-rendered every frame when radio playback is paused or stopped. It still has too when it play backs a song, though.

- Fixed several UI / UX bugs, causing hiccups, stucked playback and other wonky behaviors.
- Replaced hacky hashing algorithms (for networking). Because the game actually ships with decent official ones now, we no longer have to abuse util.CRC()
2023-06-08 04:34:26 +02:00
Grocel
fcbd0f532a Code cleanup, respecting native Lua syntax more 2023-05-15 01:46:36 +02:00
Grocel
8eb3c20e22 - Fixed Lua-Error: lua/streamradio_core/client/cl_vgui.lua:22: attempt to index field 'Stream' (a nil value) 2023-03-07 21:04:20 +01:00
Grocel
22423c5fac Fixed custom URL blocking causing, added more requested playlists
- Might fix some Error 20 cases.
- Added Playlists: GalNET.ru, Nightwave Plaza, NonStopPlay
2023-01-18 21:56:20 +01:00
Grocel
0be55dce7c Playlist, model and tool panel update.
- Added support for 3 radio models from 2 addons.
- Fixed broken community playlists. Added "WCCK dead" and "Deutsche Welle" playlists. Removed Radiorecords.ru playlist, because this station is no longer compatible with this addon.
- Added a Button to the tool and settings panels to switch between those more easily
- Updated model selector note on the tool panel
2022-12-29 13:51:58 +01:00
Grocel
80c8d3ec14 Fixed the error in playlist editor during folder delete and fixes #10. 2022-11-27 22:09:19 +01:00
Grocel
83b9ad570d Fixed memory leak in networking
- Updated neturl.lua
- Minor adjustment to tool and settings UI.
2022-10-06 04:15:19 +02:00
Grocel
8e0d9b4313 Updated NetURL library and added VRMod Panel Button 2021-10-10 16:23:37 +02:00
Grocel
1488816214 Fixed the cache being broken
- Also increased cache sizes.
2021-10-10 05:13:49 +02:00
Grocel
083522a541 Improved Dropbox support
- The radio auto-converts input Drobbox URLs to their internal download URL on input.
- Added limited support for media that can not be played back in "noblock" mode. This media can not be played in sync and it can not be seeked in.
2021-10-10 03:54:43 +02:00
Grocel
cf35aea771 Fixed the server join content download being disabled. 2021-05-13 14:37:00 +02:00
Grocel
9312da629a Updated YouTube infos 2021-05-13 13:00:23 +02:00
Grocel
9106888fb7 Updated Playlist Editor and playlists. Removed YouTube support. Added SHOUTcast support
- Fixed the Playlist Editor creating files with broken files names on bad input
- Files or folders with bad names are no longer shown
- Added a text mode to the Playlist Editor (Issue #2)
- Added console logging to write operations of the Playlist Editor (Issue #8)
- Removed YouTube support, because it was broken. Playing YouTube will yield an error message
- Updated playlists and removed brokens ones
- Added a SHOUTcast browser as a virtual playlist filesystem. Not every stream works on the radio, though.
- Many bugfixes
- Minor performance optimizations
2021-05-13 01:12:25 +02:00
Grocel
3dab3dd440 minor update
- Cleaned up some playlists
  - Updated radiorecord-ru.pls and falloutfm1.pls
  - Fixed classical-weta.pls
  - Added blackmesa remixes YouTupe example
- Removed broken YouTupe converter interrfaces (they were dead/disabled for like a year already)
- Fixed URL-Checker shows error help even with valid input on right click.
2020-08-06 21:20:51 +02:00
Grocel
aba452ef1d Removed debugging leftovers 2020-06-27 23:36:05 +02:00
Grocel
e9b480a690 Some fixes
- Fixed the addon crashing the game on loadup when gm_bass3 is installed on unsupported game branches
- Fixed the between radio synchronization are not synchronizing the play timestamp sometimes
2020-06-27 23:16:07 +02:00
Grocel
51581bfe59 Changed version check to be more friendly to the idiot (chromium) branch 2020-06-27 21:26:37 +02:00
Grocel
26d30cffca Fixed the between radio synchronization being called a WAY to often, causing it to stutter. 2020-06-25 18:09:50 +02:00
Grocel
c66636deec Fixed radios seeking indefinitely on low tickrate servers. Improved performance of aim/control tracers. Updated VR-Code to latest VRMod API. 2020-06-20 18:39:38 +02:00