• Can you make your server a port to another?
    7 replies, posted
Hello! I have a question, that i dont know how to answer myself (atleast not found one yet), that can you make your server, a port to another? i have 2 servers up, other located in finland and other in france. And i would like that when people are joining to the other server, they would join to another one. Like as a port. This is because i have found out that garrys mod server list shows the finnish server better to finnish people (maybe because of connection speed?) So what im searching for is that when people try to join either of them, they would end up on the same one server. Thank you and happy first of may!
you would need a domain to link to the other server, which has the domain. or not even a domain, you just have to link the ip so people join that ip, but it would only be possible if they finished loading the other server, so they would love 2 times..everytime
Actually, yes. place this into "addons/redirect/lua/autorun/client/cl_redirect_init.lua" function RedirectToAddress(address)     local ply = LocalPlayer()     if not IsValid(ply) then return end     LocalPlayer():ConCommand("connect " .. address) end timer.Simple(1, function()     local player_meta_table = FindMetaTable("Player")     timer.Create("redirect_upon_concommand_defined", 0.1, 0, function()         if isfunction(player_meta_table.ConCommand) then             RedirectToAddress("ip_address_here")         end     end) end) I have tried RunConsoleCommand btw, but it kept stating the address was invalid even though it was valid. Anyways, it's tested and all you have to change is the "ip_address_here" string to your main server. Remember to not put anything but this into the "dummy server" to avoid unnecessary load times.
Thank you for amazing help! I am having this error with the code though :/ [ERROR] addons/redirect/lua/autorun/client/cl_redirect_init.lua:2: '=' expected near 'IsValid'   1. unknown - addons/redirect/lua/autorun/client/cl_redirect_init.lua:0 this is my script function RedirectToAddress(address)local ply = LocalPlayer()     ifnot IsValid(ply) thenreturnend     ply:ConCommand("connect " .. address) end timer.Simple(1, function()local player_meta_table = FindMetaTable("Player")     timer.Create("redirect_upon_concommand_defined", 0.1, 0, function()if isfunction(player_meta_table.ConCommand) then             RedirectToAddress("5.196.156.48:27015")         endend) end)
ye I see what happened, probably the shitty code view. Here
working like a charm. thank you, Its a shame i cant get the playercount to the server though.
Shhh... Don't even think about redirect servers.
after many google searches i found out that some people have gotten their servers blacklisted because of some poofing playercounts with redirection server type of thingies (?) But its just frustrating as i had a finnish server host little while ago, the server show's great for finnish playerbase and the playercounts were high. but now as i have changed the server provider for better one but it locates in france, the server doesnt really pop up in server browser anymore. If there would be a way to make france server to think its located more near finland and it would pop up again for finnish playerbase, it would be amazing.
Sorry, you need to Log In to post a reply to this thread.