Disable Multiplayer

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 per se, 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.

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?

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

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?

Uhh, give me a moment to look at the html folder and I will give you better instructions.

Alright. :smiley:

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’?

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:



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;


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()



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;


So… Where do I copy this into, like where does it start and end?

sigh well the line 179 is where the AddServer function starts, jsut copy over the lines 179 and 180.



179: function AddServer( type, id, ping, name, desc, map, players, maxplayers, botplayers, pass, lastplayed, address, gamemode, workshopid )
180: {


That is what it will look like before you paste over it

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 :smiley:

EDITEDIT: The Legacy Browser… It still shows servers.

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]

We can not overwrite the legacy browser as that is steam, we may be able to remove it from the menu however.

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?

[strike]



RunGameUIcommand('OpenServerBrowser')


That may work, try that[/strike]
There is no command to do that.

gamemenucommand openserverbrowser