• Getting steamid for loadingurl with php
    13 replies, posted
Hi, i got a finished loading screen but i cant get gmod to use the right url. I got this in my server.cfg and autoexec.cfg [CODE]"sv_loadingurl" "127.0.0.1/TurtleClawz/index.php?steamid=%s&mapname=%m"[/CODE] but when the server starts it uses only "127.0.0.1/TurtleClawz/index.php" as i can see by doing sv_loadingurl into srcds console, so my page never gets the steamid. I am using this to catch it. $communityid = $_GET['steamid']; Please help. [editline]17th February 2013[/editline] Well i did a workaround by running this lua: [CODE] function FixShit() game.ConsoleCommand("sv_loadingurl 127.0.0.1/loading/index.php?steamid=%s\n") end hook.Add( "Initialize", "fdfd", FixShit ) [/CODE] But this should get fixed, horrible bug.
If you're sending 127.0.0.1 (localhost) to the client as the loading page they aren't going to reach your server.
the sv_loadingurl must be the FULL address to the website (the same way your friends will view it through their browser). For example this is my sv_loadingurl: [code]sv_loadingurl "http://motd.liberumgamers.net/TTT/?steamid=%s&mapname=%m"[/code] Also this is how you calculate the SteamID because gmod gives you the community id: [php]$communityid = $_GET["steamid"]; $authserver = bcsub($communityid, '76561197960265728') & 1; $authid = (bcsub($communityid, '76561197960265728')-$authserver)/2; $steamid = "STEAM_0:$authserver:$authid";[/php] [editline]17th February 2013[/editline] Please post any further questions [url=http://facepunch.com/showthread.php?t=1152061]here[/url]
[QUOTE=CBastard;39621420]If you're sending 127.0.0.1 (localhost) to the client as the loading page they aren't going to reach your server.[/QUOTE] To go even more in depth - 127.0.0.1 / localhost always points to the computer that is trying to handle this function. The way sv_loadingurl works is just a web browser in the game which the server tells you to load. So if the URL isn't accessable outside the game, you won't be able to use it at all. Also remember the whole http:// or https:// thing
youre all useless >:C i dint ask about any of that, i was just asking for a workaround for a bug.
[code]sv_loadingurl "http://127.0.0.1/TurtleClawz/index.php?steamid=%s&mapname=%m"[/code] or [code]sv_loadingurl http://127.0.0.1/TurtleClawz/index.php?steamid=%s&mapname=%m[/code] ? Also, you don't have &mapname=%m in your LUA script... Why?
[QUOTE=Killervalon;39646384][code]sv_loadingurl "http://127.0.0.1/TurtleClawz/index.php?steamid=%s&mapname=%m"[/code] or [code]sv_loadingurl http://127.0.0.1/TurtleClawz/index.php?steamid=%s&mapname=%m[/code] ? Also, you don't have &mapname=%m in your LUA script... Why?[/QUOTE] it has to be the FULL address. This will not work with localhost! [quote]T[he sv_loadingurl must be the FULL address to the website (the same way your friends will view it through their browser). For example this is my sv_loadingurl:[/quote]
[QUOTE=Mega1mpact;39647901]it has to be the FULL address. This will not work with localhost![/QUOTE] He's just testing it LAN - his issue is that the GET variable's aren't being used when using sv_loadingurl in autoexec.cfg, only when he sets it via LUA. I don't know, I fucked it up in my head too - just realised.
Found it! Your loadingurl doesn't start with http://
Is that really the problem? Maybe i should have said this before, if i write the url into srcds it self manually without the http:// or anything you suggested i missed in there, it will still work no matter, so that is nowhere near the problem. Only if used from cfg files, the part after "?" will be cut off, meaning it is trully a bug in srcds.
is it in the server.cfg of in autoexec.cfg? [editline]20th February 2013[/editline] Have you tried putting it in quotes?
use lvh.me for testing locally.
[QUOTE=commander204;39662816]use lvh.me for testing locally.[/QUOTE] What is the advantage over 127.0.0.1 or localhost?
it's treated as a full domain, you can also use subdomains with it
Sorry, you need to Log In to post a reply to this thread.