• ply:ConCommand("connect XYZ") blocked?
    19 replies, posted
Are there any workaround to allow forcing people to connect to another server? I think there must be since don't gamemodes like GTower depend on it?
Run LocalPlayer():ConCommand("connect xyz") on the client instead.
On client: [lua] gui.OpenURL("steam://connect/127.0.0.1:27015") [/lua]
[QUOTE=Mitsudigi;38751424]On client: [lua] gui.OpenURL("steam://connect/127.0.0.1:27015") [/lua][/QUOTE] garry filtered the steam protocol
[QUOTE=Banana Lord.;38751432]garry filtered the steam protocol[/QUOTE] How recently? I am pretty sure this was just working.. Does it not work to do RunConsoleCommand('connect',.. now either?
well gui.OpenURL was removed until a few updates ago and he said he replaced it with a filtered version
Nevermind, RunConsoleCommand seems to still work. Why block one and not the other?
[QUOTE=Mitsudigi;38752135]So what I've done as a work around for now is gui.OpenURL a hosted PHP with a simple "Continue Connecting" link and "steam://connect/ip:port" as the href. This does not work with the Derma HTML control. I am satisfied with this for now however it would be nice to be able to open a Steam game info panel for server IPs of our choice if we can't just simply force connect them. Here is a simple PHP script: [url]http://pastebin.com/3Lkb1U6R[/url] To use, link to the PHP with your desired IP in the URL: [url]http://yoursite.com/connect.php?ip=127.0.0.1:27015[/url] The link on the page will connect players to the specified server.[/QUOTE] You could use a meta refresh tag instead requiring user input
Why not set the location header in PHP?
[QUOTE=Matt W;38752242]You could use a meta refresh tag instead requiring user input[/QUOTE] You're right, nice call. I am pretty sure that RunConsoleCommand works fine for now until Garry decides to block that as well.
the SendLua LocalPlayer():ConCommand works fine.
So for serverside which is likely what you were intending, ply:SendLua([[RunConsoleCommand('connect', '127.0.0.1:27015')]])
[QUOTE=-XTC-;38754873]So for serverside which is likely what you were intending, ply:SendLua([[RunConsoleCommand('connect', '127.0.0.1:27015')]])[/QUOTE] SendLua in inefficient and should be replaced with a usermessage or net broadcast
[QUOTE=Banana Lord.;38754931]SendLua in inefficient and should be replaced with a usermessage or net broadcast[/QUOTE] Sure, but it still works :). It's not like we're trying to do something sophisticated here when you can just make this work with one line. ply:SendLua("LocalPlayer():ConCommand('connect blahblah:27015')")
[QUOTE=Banana Lord.;38754931]SendLua in inefficient and should be replaced with a usermessage or net broadcast[/QUOTE] Contrary to your beliefs, SendLua is more efficient than using a usermessage/net message. And considering all you're doing is sending him to a different server.. uhh.. yeah.
I wouldn't say more efficient but it is indeed a lot easier. It's a shame that it still has the 255 bytes limit. Maybe Garry could increase the limit using net messages or something.
[QUOTE=danielga;38756647]I wouldn't say more efficient but it is indeed a lot easier. It's a shame that it still has the 255 bytes limit. Maybe Garry could increase the limit using net messages or something.[/QUOTE] iirc they use different systems
[QUOTE=Banana Lord.;38757418]iirc they use different systems[/QUOTE] SendLua uses usermessages.
[QUOTE=Map in a box;38758286]SendLua uses usermessages.[/QUOTE] Oh sorry I was thinking of net and usermessages for some reason, my bad
Anyways the SendLua should work fine as intended. No need to argue about which one is better. It works. End of story.
Sorry, you need to Log In to post a reply to this thread.