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

Post Reply
dewiniaid
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Tue Mar 07, 2017 8:50 pm
Contact:

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

Post by dewiniaid » Sat Apr 20, 2019 8:19 pm

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.

Danielv123
Inserter
Inserter
Posts: 44
Joined: Sun Jan 03, 2016 10:28 am
Contact:

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

Post by Danielv123 » Sat Apr 20, 2019 9:58 pm

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.

User avatar
mrudat
Fast Inserter
Fast Inserter
Posts: 152
Joined: Fri Feb 16, 2018 5:21 am
Contact:

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

Post by mrudat » Sat Apr 20, 2019 10:43 pm

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

Danielv123
Inserter
Inserter
Posts: 44
Joined: Sun Jan 03, 2016 10:28 am
Contact:

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

Post by Danielv123 » Sat Apr 20, 2019 10:52 pm

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.

psihius
Fast Inserter
Fast Inserter
Posts: 189
Joined: Mon Dec 15, 2014 12:47 am
Contact:

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

Post by psihius » Fri Jul 05, 2019 9:04 am

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.

User avatar
Godmave
Long Handed Inserter
Long Handed Inserter
Posts: 87
Joined: Tue Nov 15, 2016 3:52 pm
Contact:

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

Post by Godmave » Fri Jul 05, 2019 9:46 am


User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 3741
Joined: Tue Jul 12, 2016 9:03 am
Contact:

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

Post by eradicator » 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...
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
Godmave
Long Handed Inserter
Long Handed Inserter
Posts: 87
Joined: Tue Nov 15, 2016 3:52 pm
Contact:

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

Post by Godmave » Fri Jul 05, 2019 12:07 pm

What is the worst case scenario after getting FORCED to reconnect to another factorio-server?

psihius
Fast Inserter
Fast Inserter
Posts: 189
Joined: Mon Dec 15, 2014 12:47 am
Contact:

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

Post by psihius » Fri Jul 05, 2019 12:15 pm

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.
Last edited by psihius on Fri Jul 05, 2019 12:21 pm, edited 1 time in total.

psihius
Fast Inserter
Fast Inserter
Posts: 189
Joined: Mon Dec 15, 2014 12:47 am
Contact:

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

Post by psihius » Fri Jul 05, 2019 12:16 pm

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.

User avatar
Godmave
Long Handed Inserter
Long Handed Inserter
Posts: 87
Joined: Tue Nov 15, 2016 3:52 pm
Contact:

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

Post by Godmave » 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 ;)

psihius
Fast Inserter
Fast Inserter
Posts: 189
Joined: Mon Dec 15, 2014 12:47 am
Contact:

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

Post by psihius » Fri Jul 05, 2019 12:35 pm

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

Rseding91
Factorio Staff
Factorio Staff
Posts: 9978
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 » Mon Jul 08, 2019 4:50 pm

Ok, I've added it for the next version of 0.17.
Capture.PNG
Capture.PNG (24.45 KiB) Viewed 713 times
If you want to get ahold of me I'm almost always on Discord.

psihius
Fast Inserter
Fast Inserter
Posts: 189
Joined: Mon Dec 15, 2014 12:47 am
Contact:

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

Post by psihius » Mon Jul 08, 2019 6:07 pm

Yay, all hail Rseding! :)

User avatar
Jon8RFC
Filter Inserter
Filter Inserter
Posts: 476
Joined: Tue May 10, 2016 3:39 pm
Contact:

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

Post by Jon8RFC » Tue Jul 09, 2019 4:45 pm

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.
Image

Post Reply

Return to “Implemented mod requests”

Who is online

Users browsing this forum: No registered users