• Disable Multiplayer
    20 replies, posted
Hello, my younger brother loves to play gmod, but he cannot play online, I have rented a private server for him and his friends but I only want him to be able to connect to that server and my other servers ONLY! Is there/can somebody make something like this that only allows certain servers to be connected to. Thanks in advance.
I doubt you'll get much sympathy for your brother at a place like this and for a game like this. As for what you're asking for, just redo the main menu's html so that "multiplayer" connects directly to this server instead of opening a server list. It won't keep him from other servers [I]per se[/I], but it'll make it harder for him to find them.
Adding on to what KingofBeast said, you can find all the said browser files in the html folder.
[QUOTE=KingofBeast;45362912]I doubt you'll get much sympathy for your brother at a place like this and for a game like this. As for what you're asking for, just redo the main menu's html so that "multiplayer" connects directly to this server instead of opening a server list. It won't keep him from other servers [I]per se[/I], but it'll make it harder for him to find them.[/QUOTE] So, the only way he can connect to another server is via console (He doesn't know anything about this). He is running Mac, any idea where the files are locaed? EDIT: Where can I find the "html folder" on my own computer?
[QUOTE=psewolf;45363129]So, the only way he can connect to another server is via console (He doesn't know anything about this). He is running Mac, any idea where the files are locaed? EDIT: Where can I find the "html folder" on my own computer?[/QUOTE] It will be within the garrysmod/garrysmod, to get there, go to your steam root(May be C:/Program Files/Steam) Navigate into steamapps/common and there you go, there is garrysmod/garrysmod
[QUOTE=MadkillerMax;45363159]It will be within the garrysmod/garrysmod, to get there, go to your steam root(May be C:/Program Files/Steam) Navigate into steamapps/common and there you go, there is garrysmod/garrysmod[/QUOTE] So, I found it. What will I need to edit exactly, I want the server list removed and only show specific servers, so maybe just the favorites tab and I can add favorites before removing all other tabs?
[QUOTE=psewolf;45363234]So, I found it. What will I need to edit exactly, I want the server list removed and only show specific servers, so maybe just the favorites tab and I can add favorites before removing all other tabs?[/QUOTE] Uhh, give me a moment to look at the html folder and I will give you better instructions.
[QUOTE=MadkillerMax;45363267]Uhh, give me a moment to look at the html folder and I will give you better instructions.[/QUOTE] Alright. :D
And my previous post didn't seem to go through, browse to js/menu and open control.Servers.js within there is a function called AddServer with the parameter address, check that address against a table of addresses you create. Edit: So, before that function can do anything, if the address is not in the table, do a return;
Ok, I am very new to this, would you make a pastebin of an example with this IP: 74.91.126.124 Also, once that is complete, how will I add more IPs'?
[QUOTE=psewolf;45363343]Ok, I am very new to this, would you make a pastebin of an example with this IP: 74.91.126.124 Also, once that is complete, how will I add more IPs'?[/QUOTE] well, seeing as how there is only the address parameter, you will need the port too, ex: 74.91.126.124:27015 Now, my JavaScript skills are rusty, so if I am correct, this should do: [code] var servers = ["74.91.126.124:27015", "74.91.126.124:27016"]; function AddServer( type, id, ping, name, desc, map, players, maxplayers, botplayers, pass, lastplayed, address, gamemode, workshopid ) { var found = $.inArray(address, servers) > -1; if (!found) return; [/code] To add more IP's, follow the 2 fake IP's I have entered [editline]11th July 2014[/editline] That will only work with jQuery and not sure if the menu has it, trying to find another way for #.inArray() [code] var servers = ["74.91.126.124:27015", "74.91.126.124:27016"]; function AddServer( type, id, ping, name, desc, map, players, maxplayers, botplayers, pass, lastplayed, address, gamemode, workshopid ) { var found = (servers.indexOf(address) > -1); if (!found) return; [/code]
[QUOTE=MadkillerMax;45363383]well, seeing as how there is only the address parameter, you will need the port too, ex: 74.91.126.124:27015 Now, my JavaScript skills are rusty, so if I am correct, this should do: [code] var servers = ["74.91.126.124:27015", "74.91.126.124:27016"]; function AddServer( type, id, ping, name, desc, map, players, maxplayers, botplayers, pass, lastplayed, address, gamemode, workshopid ) { var found = $.inArray(address, servers) > -1; if (!found) return; [/code] To add more IP's, follow the 2 fake IP's I have entered [editline]11th July 2014[/editline] That will only work with jQuery and not sure if the menu has it, trying to find another way for #.inArray() [code] var servers = ["74.91.126.124:27015", "74.91.126.124:27016"]; function AddServer( type, id, ping, name, desc, map, players, maxplayers, botplayers, pass, lastplayed, address, gamemode, workshopid ) { var found = (servers.indexOf(address) > -1); if (!found) return; [/code][/QUOTE] So... Where do I copy this into, like where does it start and end?
[QUOTE=psewolf;45363406]So... Where do I copy this into, like where does it start and end?[/QUOTE] *sigh* well the line 179 is where the AddServer function starts, jsut copy over the lines 179 and 180. [code] 179: function AddServer( type, id, ping, name, desc, map, players, maxplayers, botplayers, pass, lastplayed, address, gamemode, workshopid ) 180: { [/code] That is what it will look like before you paste over it
[QUOTE=MadkillerMax;45363413]*sigh* well the line 179 is where the AddServer function starts, jsut copy over the lines 179 and 180. [code] 179: function AddServer( type, id, ping, name, desc, map, players, maxplayers, botplayers, pass, lastplayed, address, gamemode, workshopid ) 180: { [/code] That is what it will look like before you paste over it[/QUOTE] Nothing shows up in the server list, that IP that I gave you is real so It should show up right? EDIT: It shows up under the Favorites Tab. I guess thats all I needed. Thanks :D EDITEDIT: The Legacy Browser... It still shows servers.
[QUOTE=psewolf;45363435]Nothing shows up in the server list, that IP that I gave you is real so It should show up right? EDIT: It shows up under the Favorites Tab.[/QUOTE] depends on what port it is on and what address gives us, I haven't had to edit, but a guesstimation would say it has the port included. Quick overlook agrees that address has the port, not sure what what cause this to trip up currently, please give me a moment. [editline]11th July 2014[/editline] [QUOTE=psewolf;45363435]Nothing shows up in the server list, that IP that I gave you is real so It should show up right? EDIT: It shows up under the Favorites Tab. I guess thats all I needed. Thanks :D EDITEDIT: The Legacy Browser... It still shows servers.[/QUOTE] We can not overwrite the legacy browser as that is steam, we may be able to remove it from the menu however.
[QUOTE=MadkillerMax;45363439]depends on what port it is on and what address gives us, I haven't had to edit, but a guesstimation would say it has the port included. Quick overlook agrees that address has the port, not sure what what cause this to trip up currently, please give me a moment.[/QUOTE] Ok, that is fine. How can this be done?
if we go in html/template and edit the file servers.html, we can delete line 18 and that will remove the legacy browser button it would seem.
Awesome, that did it! Any idea of a command that opens the legacy browser for when I need to add a server to his favorites?
[QUOTE=psewolf;45363491]Awesome, that did it! Any idea of a command that opens the legacy browser for when I need to add a server to his favorites?[/QUOTE] [strike] [code] RunGameUIcommand('OpenServerBrowser') [/code] That may work, try that[/strike] There is no command to do that.
gamemenucommand openserverbrowser
Awesome! Thanks for your help Max!
Sorry, you need to Log In to post a reply to this thread.