Page 1 of 1

A means of telling a client to connect to a different server

Posted: Sat Apr 20, 2019 8:19 pm
by dewiniaid
Today's FactorioMMO stress test got me thinking on ways to handle truly massive scale multiplayer games with some degree of performance.

One thought would be to have people split across multiple games with some form of sharing resources and chat between them. Some of this can already be done with existing tools -- namely, ClusterIO (though I don't think it yet has a facility to sync chat).

One missing piece of the puzzle is a means of instructing a client to connect to a different server. Something like:

Code: Select all

LuaPlayer::connect_to_server(host, [password, [port]])
Mods could use this in a variety of ways:

* Having a 'lobby' map that automatically (or manually) dispatches players to one of a set of multiplayer servers.
* Moving players to said lobby map before restarting a server
* A scenario that has only one resource per map (other than minimal starting resources) and requires building infrastructure on all maps to have a usable factory.

Presumably, this should fail if the player in question is not actually connected at the time/etc. It should also (probably) fail if the player in question is the server host.

Re: A means of telling a client to connect to a different server

Posted: Sat Apr 20, 2019 9:58 pm
by Danielv123
For reference, clusterio does support cross server chat. But a better way to move players between servers would be HUGE. We can already do it with items, combinator signals, power, trains, images, basically everything imaginable. Except players.
We have deviced a few workarounds to this problem, most of which aren't feasible because of clunkiness
* Watchdog process on users machines using --connect flag
* RCE vulnerabilities to force close factorio and use --connect flag (very unstable, always gets patched) (thanks <3)
* Dynamic reverse proxy in front of server - Most promising so far, not overly invasive, requires people to connect with IP and custom ports or to flood the MM server
I really do hope we can get this in the game.

Re: A means of telling a client to connect to a different server

Posted: Sat Apr 20, 2019 10:43 pm
by mrudat
Could you not:

Code: Select all

error("please connect to " .. other_server)
Then have, say Autohotkey, or something close and relaunch factirio?

Edit: fix tyop

Re: A means of telling a client to connect to a different server

Posted: Sat Apr 20, 2019 10:52 pm
by Danielv123
mrudat - that is pretty much the same as the 3 solutions I listed, so not ideal. We don't want people to download untrusted potentially vulnerable software from us - we want this to be part of the base game.

It is also important to note that one of the big problem with all the proposed workarounds is the unneccesary relaunch of the game. For people with weaker computers or HDDs this can easily take a minute or two which is unacceptable for seamless play.

Re: A means of telling a client to connect to a different server

Posted: Fri Jul 05, 2019 9:04 am
by psihius
With how Clusterio is going these days and plans we have for it, as Danielv123 already said - we are going to find a way and some people in the team already have a MitM working POC and one way or the other we will end up doing it, but all those methods are, well, questionable (and we definitely will need to keep those implementations to ourselves to prevent abuse).

So we would really prefer some proper implementation where we can properly ask a user if he wants to switch a server. Idk, if you really want to restrict it - link this ability to accounts as a flag, so only users you verified and trust can do that and so you can disable it at any time of it gets abused. That way you can limit the exposure and feel more or less safe, but that's does require quite a bit of additional development compared to just adding that to the modding API.

Re: A means of telling a client to connect to a different server

Posted: Fri Jul 05, 2019 9:46 am
by Godmave

Re: A means of telling a client to connect to a different server

Posted: Fri Jul 05, 2019 11:48 am
by eradicator
A method that asks me if i want to connect? Maybe.
A method that allows any malicious mod to force me to connect to whatever server they want? You can't be serious...

Re: A means of telling a client to connect to a different server

Posted: Fri Jul 05, 2019 12:07 pm
by Godmave
What is the worst case scenario after getting FORCED to reconnect to another factorio-server?

Re: A means of telling a client to connect to a different server

Posted: Fri Jul 05, 2019 12:15 pm
by psihius
eradicator wrote:
Fri Jul 05, 2019 11:48 am
A method that asks me if i want to connect? Maybe.
A method that allows any malicious mod to force me to connect to whatever server they want? You can't be serious...
Well, no one is asking for a forced server connect - always ask. Also, give the player the ability to just block those so you are never asked if you don't want to.
You could also add "remember the answer for this server" so that if you play something like a specific event - you can hop between those servers easily (maybe even without asking after you give permission to do that when asked), but always asked everywhere else.

I mean, add a setting "Allow mods to suggest connecting to other servers: Yes/No" and set it to "No" by default.

Re: A means of telling a client to connect to a different server

Posted: Fri Jul 05, 2019 12:16 pm
by psihius
Godmave wrote:
Fri Jul 05, 2019 12:07 pm
What is the worst case scenario after getting FORCED to reconnect to another factorio-server?
Well, I can think of one - someone setting up an infinite loop between two servers forcing you to kill your client cause you might not be able to press Esc in time if they do it in "on_player_joined" event.

Re: A means of telling a client to connect to a different server

Posted: Fri Jul 05, 2019 12:33 pm
by Godmave
psihius wrote:
Fri Jul 05, 2019 12:16 pm
Well, I can think of one - someone setting up an infinite loop between two servers forcing you to kill your client cause you might not be able to press Esc in time if they do it in "on_player_joined" event.
Alt-F4 ;)

Re: A means of telling a client to connect to a different server

Posted: Fri Jul 05, 2019 12:35 pm
by psihius
Godmave wrote:
Fri Jul 05, 2019 12:33 pm
psihius wrote:
Fri Jul 05, 2019 12:16 pm
Well, I can think of one - someone setting up an infinite loop between two servers forcing you to kill your client cause you might not be able to press Esc in time if they do it in "on_player_joined" event.
Alt-F4 ;)
True, but not the correct solution ;) :D

Re: A means of telling a client to connect to a different server

Posted: Mon Jul 08, 2019 4:50 pm
by Rseding91
Ok, I've added it for the next version of 0.17.
Capture.PNG
Capture.PNG (24.45 KiB) Viewed 5010 times

Re: A means of telling a client to connect to a different server

Posted: Mon Jul 08, 2019 6:07 pm
by psihius
Yay, all hail Rseding! :)

Re: A means of telling a client to connect to a different server

Posted: Tue Jul 09, 2019 4:45 pm
by Jon8RFC
Rseding91 wrote:
Mon Jul 08, 2019 4:50 pm
Ok, I've added it for the next version of 0.17.
Stuff like this is what makes the Factorio team great, and also makes the game great and give it a long-lasting life because it can have all sorts of new ways to play. This is one of those games which, when the project is abandoned, I really hope gets passed on as open-source.