Raised This Month: $32 Target: $400
 8% 

[CSGO] [INC] WebFix (V1.02, 18/12/2017)


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
Byte
Senior Member
Join Date: Jun 2010
Location: 📦 CCSPlayer
Old 11-04-2017 , 08:34   [CSGO] [INC] WebFix (V1.02, 18/12/2017)
#1

Note: Please use VGUI URL Cache Buster by nosoop instead: https://forums.alliedmods.net/showthread.php?p=2557960
It solves the issue at the core (VGUIMenu usermessages) and has good CSGO support + width/height support.





WebFix (V1.02)
Include for CSGO allowing proper usage of MOTD's without caching first URL visited.

By Byte

🔹 Description 🔹
WebFix Include for CSGO allowing proper usage of MOTD's without caching first URL visited.
Fixes issue introduced in June 2017 CSGO/Steam updates.
This has been tested extensively with multiple plugins adapted to use WebFix and seems to work in all instances.

🔹 Why use this over other solutions? 🔹
  • Most simple solution
  • No need to sign up for other third party services
  • No ads or hidden code
  • Doesn't require any dependencies (no SteamWorks, doesn't use POSTs)
  • You can optionally self host the 1 required html file so you know your data isn't being sent to third parties/misused

🔹 Warning 🔹
You can't run any other plugins that use ShowMOTDPanel or ShowVGUIPanel (in non-hidden mode) because they will break the WebFix solution.
If you using such plugins, you will need to patch them so they use the stocks below instead.

🔹 Instructions 🔹
  1. Copy webfix_redirecturl.txt to /addons/sourcemod/configs/ on your gameserver
  2. (OPTIONAL) Upload redirect.html to your webserver and edit webfix_redirecturl.txt so it contains the URL to your self hosted redirect.html.
  3. Use the include file webfix.inc in your plugins or use third party plugins which do

🔹 webfix.inc Stocks 🔹
PHP Code:

/**
 * Open a URL on a client using WebFix
 *
 * @param client            Client which MOTD window will be opened on.
 * @param title            Window title.
 * @param url            URL to open. Must be prefixed with http:// or https:// protocols.
 * @param hidden            Should window be opened in hidden mode (in the background).
 * @param width            Width (in pixels) of window for non-hidden mode. 0 (default) uses clients full screen width.
 * @param height            Height (in pixels) of window for non-hidden mode. 0 (default) uses clients full screen height.
 * @return                true if successful, false if error encountered.
 */
stock bool WebFix_OpenUrl(int client, const char[] title, const char[] urlbool hidden falseint width 0int height 0);

/**
 * Open a URL on all clients using WebFix
 *
 * @param title            Window title.
 * @param url            URL to open. Must be prefixed with http:// or https:// protocols.
 * @param hidden            Should window be opened in hidden mode (in the background).
 * @param width            Width (in pixels) of window for non-hidden mode. 0 (default) uses clients full screen width.
 * @param height            Height (in pixels) of window for non-hidden mode. 0 (default) uses clients full screen height.
 * @return                true if all successful, false if any errors encountered.
 */
stock bool WebFix_OpenUrlAll(const char[] title, const char[] urlbool hidden falseint width 0int height 0); 
🔹 Acknowledgements 🔹
Full credits for the method which prevents URL caching goes to boomix.
I just wrote the stocks.

🔹 Changelog 🔹
Code:
1.02 Remove WebFix_SetRedirectUrl and add rawgit default redirect url
1.01 Rewrite redirect script to use only Javascript removing PHP dependency (thanks Impact123). Encode URLs to preserve user provided parameters.
1.00 Initial release
🔹 Downloads 🔹

Github Repo:

Source | Releases

AlliedModders Mirror (DL: 124):
Attached Files
File Type: zip WebFix_V1.02.zip (16.7 KB, 327 views)
__________________
STEAM: /id/invexbyte | Github: Mo Beigi | Discord: Byte#0017
Community: Invex Gaming | My Plugins: Click Me!


Last edited by Byte; 12-30-2017 at 04:13.
Byte is offline
Ejziponken
AlliedModders Donor
Join Date: Apr 2008
Old 11-04-2017 , 12:28   Re: [CSGO] [INC] WebFix (V1.01, 04/11/2017)
#2

Works like a charm!

Been waiting for a clean version without ads and other crap and something you can host yourself!
Ejziponken is offline
Byte
Senior Member
Join Date: Jun 2010
Location: 📦 CCSPlayer
Old 11-04-2017 , 12:46   Re: [CSGO] [INC] WebFix (V1.01, 04/11/2017)
#3

Quick web shortcuts plugin I wrote that uses WebFix:
https://forums.alliedmods.net/showthread.php?p=2558460

Also note you can't use any plugins that uses 'ShowMOTDPanel' or ShowVGUIPanel (in non-hidden mode) without potentially breaking this fix. For any plugins you use that use these API functions, you have to patch them so they work.
__________________
STEAM: /id/invexbyte | Github: Mo Beigi | Discord: Byte#0017
Community: Invex Gaming | My Plugins: Click Me!

Byte is offline
nomy
Senior Member
Join Date: Dec 2009
Location: United Kingdom
Old 11-04-2017 , 23:43   Re: [CSGO] [INC] WebFix (V1.01, 04/11/2017)
#4

Works flawless! Thank You!
nomy is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 11-05-2017 , 07:45   Re: [CSGO] [INC] WebFix (V1.01, 04/11/2017)
#5

for webfix_rediecturl.txt we should use https://www.example.com/webfix/redirect.html right? since the file inside the web folder is called redirect.html

also by using this will it break the plugins used by compaies like motdgd, vpgg, pinion etc.?
__________________
8guawong is offline
Byte
Senior Member
Join Date: Jun 2010
Location: 📦 CCSPlayer
Old 11-05-2017 , 09:45   Re: [CSGO] [INC] WebFix (V1.01, 04/11/2017)
#6

Quote:
Originally Posted by 8guawong View Post
for webfix_rediecturl.txt we should use https://www.example.com/webfix/redirect.html right? since the file inside the web folder is called redirect.html

also by using this will it break the plugins used by compaies like motdgd, vpgg, pinion etc.?
Yeah it should be a .html file.
I forgot to update the placeholder url.
Don't leave it as https://www.example.com/webfix/redirect.html though, you have to upload it somewhere.

And how do those ad plugins work?
I'm not sure how they work but if they use 'ShowMOTDPanel' or ShowVGUIPanel (in non-hidden mode) then yeah they need to be patched. Should be a simple 1 line replace though.
__________________
STEAM: /id/invexbyte | Github: Mo Beigi | Discord: Byte#0017
Community: Invex Gaming | My Plugins: Click Me!

Byte is offline
Byte
Senior Member
Join Date: Jun 2010
Location: 📦 CCSPlayer
Old 12-17-2017 , 09:56   Re: [CSGO] [INC] WebFix (V1.02, 18/12/2017)
#7

Updated to V1.02
  • Removed 'WebFix_SetRedirectUrl' as it didn't make sense for plugins to set their own URLs as multiple plugins doing this would break the fix. So config is the only way to set the redirect.html url now.
  • Added a working default redirect.html with those who don't have a webhost or don't want to use their own. Its using rawgit and should have decent ping to most locations worldwide. (Link: https://cdn.rawgit.com/InvexByte/Web.../redirect.html)

__________________
STEAM: /id/invexbyte | Github: Mo Beigi | Discord: Byte#0017
Community: Invex Gaming | My Plugins: Click Me!


Last edited by Byte; 12-17-2017 at 12:31.
Byte is offline
paul181516
Junior Member
Join Date: Aug 2017
Location: Colombia
Old 12-22-2017 , 17:16   Re: [CSGO] [INC] WebFix (V1.02, 18/12/2017)
#8

There is anyway to hide "close", x, symbol?
paul181516 is offline
Send a message via MSN to paul181516 Send a message via Skype™ to paul181516
Byte
Senior Member
Join Date: Jun 2010
Location: 📦 CCSPlayer
Old 12-22-2017 , 17:40   Re: [CSGO] [INC] WebFix (V1.02, 18/12/2017)
#9

Quote:
Originally Posted by paul181516 View Post
There is anyway to hide "close", x, symbol?
No I don't think there is an option for that.
No way to block the user from closing the browser client side.
__________________
STEAM: /id/invexbyte | Github: Mo Beigi | Discord: Byte#0017
Community: Invex Gaming | My Plugins: Click Me!

Byte is offline
Byte
Senior Member
Join Date: Jun 2010
Location: 📦 CCSPlayer
Old 12-30-2017 , 17:38   Re: [CSGO] [INC] WebFix (V1.02, 18/12/2017)
#10

Hey everyone, you shouldn't use WebFix any longer.
WebFix worked on an individual plugin basis and only with the new stocks.

The best solution is to simply hook the VGUIMenu usermessage and implement the same fix method Boomix discovered.

The VGUI URL Cache Buster by nosoop does this:
https://forums.alliedmods.net/showthread.php?p=2557960

Its been tested for CSGO and has now has stocks to support width/height.
Use that instead!

Quote:
Originally Posted by paul181516 View Post
There is anyway to hide "close", x, symbol?
Also its possible to detect them closing the window if that is what you are interested in.
You can also make the height super long where the 'x' is off screen, not sure why you would want to do that.
__________________
STEAM: /id/invexbyte | Github: Mo Beigi | Discord: Byte#0017
Community: Invex Gaming | My Plugins: Click Me!

Byte is offline
Closed Thread


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 01:06.


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