Raised This Month: $12 Target: $400
 3% 

[ANY] VGUI URL Cache Buster (3.1.4, 2018-05-19)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
nosoop
Veteran Member
Join Date: Aug 2014
Plugin ID:
5890
Plugin Version:
3.1.4
Plugin Category:
Technical/Development
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Workaround for opening MOTD panels in the same domain, and ShowMOTDPanel fixes for CS:GO
    Old 11-01-2017 , 16:12   [ANY] VGUI URL Cache Buster (3.1.4, 2018-05-19)
    Reply With Quote #1

    Version 3.1.4 has been released, with minor changes now that Steam opens same-domain pages again. See important notes here.

    Other important note: There is a known issue with the Steam Client beta (with the new chat interface) where opening new popup windows does not work on any game. No known fix at the moment.

    There is also currently no known solution for displaying MOTD panels on CS:GO post-Panorama.

    Description:
    Fixes various issues with plugins that create MOTD (web) panels.

    Previously, the behavior of Steam's webview was problematic. Calling ShowMOTDPanel (or variants) will show a previously viewed page if the last page viewed was on the same first-level domain. Those changes have caused issues with plugins like backpack.tf Price Check.

    This plugin hooks the VGUIMenu usermessage and manipulates it in one of two ways to attempt to force displaying the correct page:
    • The "delayed load": Another URL is opened, then the original URL is sent after a short delay.
    • The "proxy" page: The URL is rewritten so the user navigates to a static page; the desired page is then either loaded into an iframe element or opened in a new panel with window.open(). The information is communicated through the URL hash; no information is leaked to the web server and clients can cache the page.
    This hook method means no plugins need to be recompiled with various natives / dedicated function stock workarounds, and uninstallation is quick.

    As Steam currently does not have any issues with same-domain pages, those particular workarounds are currently unnecessary. The ability to hook these usermessages remain useful, however.

    The plugin also handles CS:GO-specific quirks in opening web pages; plugin authors can now use SourceMod's ShowMOTDPanel function to make pages that are visible to the user as a popup window in CS:GO.

    Other games can also attempt to use popups by sending a VGUI message with certain values configured while this plugin is present.

    This plugin should work in games that support ShowVGUIPanel / ShowMOTDPanel and don't have other unique quirks. CS:GO (protobufs) are also supported.

    ConVars:
    • vgui_workaround_delay_time: Amount of time that the "delayed load" takes. If you're having issues with loading pages, you may need to raise this value.
    • vgui_workaround_proxy_page: The URL to the static proxy page. You can host a copy yourself; it's available in the repository.
    Other configuration:
    You can configure which URL prefixes use which method. See the configs/vgui_cache_buster_urls.cfg file for more details.

    Dependencies:
    If the "proxy" method is used (whether by iframe or popup), this plugin is dependent on one static page made accessible via web hosting. The plugin ships with a default URL pointed to my personally hosted copy of the page (which you can modify as mentioned in the ConVars section above).

    No other plugin / extension dependencies.

    Things the plugin will clobber:
    VGUIMenu usermessages, obviously. Any plugins that use ShowMOTDPanel or ShowVGUIPanel with the info panel with a URL will be caught by this plugin and "fixed". Any plugins that run their own fixes may conflict with this plugin.

    Pages with restrictive X-Frame-Options headers will refuse to load with the "proxy" iframe method. This includes YouTube (non-embed), Google, and Steam Community pages. Any iframe-proxied pages that link to one of those pages will also fail.

    Hosting the proxy page over HTTPS will prevent connections through HTTP, even if the HTTP connection redirects.

    The default URL configuration is set up to use the delayed load for almost every page. However, if you have an internal site or pages that listen to hash changes (like a custom web audio setup), the iframe method will be faster and doesn't destroy and recreate a page.

    In CS:GO, MOTDs will automatically be enabled. Use a plugin such as MOTD Disable to hide the panel that displays on join if you'd like.

    There is a limitation of 255 bytes in a user message (for bitbuffers, at least).
    Because the proxy method URL encodes parameters, you may reach this limit for long URLs that previously didn't.

    Installation:
    1. Download the package.zip file from the releases page and copy the files into your SourceMod directory.
    2. Load the plugin. This will generate the configuration file located at cfg/sourcemod/plugin.vgui_cache_buster.cfg.
    3. Perform any desired configuration changes in the above file, as well as the URL configuration file.
      • Optionally: Upload the www/motd_proxy.html page to web hosting. You can set the vgui_workaround_proxy_page ConVar to your own hosted copy.
    4. You're done. Test any plugins that open up web panels to make sure that they work.
    For plugin developers:
    Just use ShowMOTDPanel as you would in every other game. If you use ShowVGUIPanel directly, there are additional KeyValues entries that you can pass in to modify the behavior of the MOTD display (see the stock file for details).

    Releases / Source Code
    __________________
    I do TF2, TF2 servers, and TF2 plugins.
    I don't do DMs over Discord -- PM me on the forums regarding inquiries.
    AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

    Last edited by nosoop; 08-09-2018 at 18:24. Reason: https stuff
    nosoop is offline
    hmmmmm
    Great Tester of Whatever
    Join Date: Mar 2017
    Location: ...
    Old 11-03-2017 , 04:42   Re: [TF2 (and others)] VGUI URL Cache Buster
    Reply With Quote #2

    Converted it to use protobuf so it works with games like CSGO

    EDIT: nosoop added CSGO support to plugin, so don't use this
    Attached Files
    File Type: sp Get Plugin or Get Source (vgui_cache_buster_proto.sp - 1461 views - 9.3 KB)

    Last edited by hmmmmm; 01-01-2018 at 04:43.
    hmmmmm is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 11-03-2017 , 11:36   Re: [TF2 (and others)] VGUI URL Cache Buster
    Reply With Quote #3

    Not sure about other games, but TF2 has the sv_motd_unload_on_dismissal server cvar already to deal with this problem.
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 11-03-2017 at 11:36.
    Powerlord is offline
    nosoop
    Veteran Member
    Join Date: Aug 2014
    Old 11-03-2017 , 18:55   Re: [TF2 (and others)] VGUI URL Cache Buster
    Reply With Quote #4

    Quote:
    Originally Posted by Powerlord View Post
    Not sure about other games, but TF2 has the sv_motd_unload_on_dismissal server cvar already to deal with this problem.
    Haven't seen it working by itself; I've had that cvar set on my server for a while now.

    I also tried it with injecting unload in the message, and while that unloads the first web panel, I can't seem to get a second one to show up.
    __________________
    I do TF2, TF2 servers, and TF2 plugins.
    I don't do DMs over Discord -- PM me on the forums regarding inquiries.
    AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
    nosoop is offline
    Stropy
    Senior Member
    Join Date: Feb 2016
    Old 11-04-2017 , 13:20   Re: [TF2 (and others)] VGUI URL Cache Buster
    Reply With Quote #5

    Oh my god, was waiting for this a long time, thank you! Will test it and report how it works asap.

    EDIT: Works like a charm, thanks again.

    Last edited by Stropy; 11-04-2017 at 16:20.
    Stropy is offline
    LiMaaa
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Behind You
    Old 11-08-2017 , 02:28   Re: [TF2 (and others)] VGUI URL Cache Buster
    Reply With Quote #6

    Thanks nosnoop, will give it a test!

    Quote:
    Originally Posted by Powerlord View Post
    Not sure about other games, but TF2 has the sv_motd_unload_on_dismissal server cvar already to deal with this problem.
    I do not believe this resolves the problem. I have had it set for as long as I can remember and still experience motd issues. If you do know how to utilize the cvar to solve these issues, please explain how?
    __________________
    >>> Hiring SourcePawn, Node.js, SteamAPI DEVS <<<
    Feel free to add me on steam or PM me on the forums.
    Endless Gamers Community
    http://endlessgamers.com

    Last edited by LiMaaa; 11-08-2017 at 02:29.
    LiMaaa is offline
    nosoop
    Veteran Member
    Join Date: Aug 2014
    Old 11-10-2017 , 08:18   Re: [ANY+CS:GO] VGUI URL Cache Buster
    Reply With Quote #7

    Glad to hear that it's working in TF2.
    I've pushed out an initial merged protobuf/bitbuf branch of the code. Should still work the same for most games; mostly intended to see if CS:GO works as I think it does (though it might screw with plugins that are already using workarounds for stuff).

    Beta release is available here. Make sure to check the CS:GO specific instructions if applicable.

    Existing users don't need to update unless they'd like to ensure there aren't any regressions in the update to support both message types. It also comes with a new vgui_workaround_debug_spew ConVar to output the URLs that a plugin is handling to the server console (though there's a commit for that from before the protobuf merge).
    __________________
    I do TF2, TF2 servers, and TF2 plugins.
    I don't do DMs over Discord -- PM me on the forums regarding inquiries.
    AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
    nosoop is offline
    mlov420
    Senior Member
    Join Date: May 2013
    Old 11-22-2017 , 16:56   Re: [ANY+CS:GO] VGUI URL Cache Buster
    Reply With Quote #8

    Meant to come here earlier and confirm but this works like a charm in CS:GO. I host the web part myself. Thanks a ton.
    mlov420 is offline
    nosoop
    Veteran Member
    Join Date: Aug 2014
    Old 12-30-2017 , 04:48   Re: [ANY+CS:GO] VGUI URL Cache Buster
    Reply With Quote #9

    3.0.0 has been released, with additional CS:GO changes proposed and tested by Byte.
    • RawGit is now used to host the HTML pages. You can still set the convar to mine or your own hosting, of course.
    • Added some new key/value options for ShowVGUIPanel to control CS:GO popup window sizes. See the new stock functions in the include file for reference.
    • The proxy hash format has changed — the rewritten URL now embeds multiple URL-encoded parameters instead of just the proxied URL. As a result, there is a new version of the proxy page.

    If you decide to upgrade, please make sure you've updated the proxy page URL (in particular, check the generated config); if you updated the contents of the page without changing the name, you may want to add a unique query string to the URL (?v=3 for example) to ensure your clients aren't using stale pages.

    The updated pages are backwards-compatible, so older versions of the plugin should continue to work fine.

    ----

    An emergency update for backwards compatibility has been pushed out as 3.0.1.
    It fixes an issue that referenced an undeclared variable which should've held a URL while in backwards-compatibility mode. Sorry if older plugins were using my hosted proxies and not seeing pages!
    __________________
    I do TF2, TF2 servers, and TF2 plugins.
    I don't do DMs over Discord -- PM me on the forums regarding inquiries.
    AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

    Last edited by nosoop; 01-01-2018 at 11:36.
    nosoop is offline
    8guawong
    AlliedModders Donor
    Join Date: Dec 2013
    Location: BlackMarke7
    Old 12-30-2017 , 04:54   Re: [ANY+CS:GO] VGUI URL Cache Buster
    Reply With Quote #10

    hello what is the advantage of using this over https://forums.alliedmods.net/showthread.php?p=2558460
    thanks

    game is csgo btw
    __________________

    Last edited by 8guawong; 12-30-2017 at 04:54.
    8guawong is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 15:57.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode