News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

Patch: save password hashes in separate file

Started by Dwachs, February 20, 2012, 08:59:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dwachs

Now, player password hashes are not sent anymore over network, that means, they are not saved in the server12355-network.sve files. Hence, passwords are not restored if the server is restarted after a crash. This patch addresses this issue: It stores the password hashes in a different file, which is eventually reloaded to restore them.
Parsley, sage, rosemary, and maggikraut.

prissi

Maybe one should rather consider to append the password to the sve file, but just not transmit this appendix. Thus the password would stick together with sve (and would not get easily lost) but still would be local.

That way one could still play games with locally locked players and still not transfer password when not needed. Just when no appendix after the end of file with password is there, not passwords are set.

Ashley

I agree with Prissi, the passwords are local to a particular savegame rather than to a particular server. Having them in a different file makes it a little bit less self-contained to manage servers.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

Dwachs

about appending passwords: needs to be checked, how this can work with the compression routines.

The passwords are only stored in a different file, if the server saves & sends & reloads savegame during a network session. If the server locally saves the game by ingame means (per gui) then the passwords are in the file.

The separate password file is automatically loaded if the server is restarted and loads the last sent network game.
Parsley, sage, rosemary, and maggikraut.

Ashley

Ah so if the server is told to load a new game via the -load flag, it won't use the cached passwords file and will create a new one, but when it auto-loads the server13353-network.sve file it does load the cached passwords file? That sounds workable to me.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

prissi

One could also append the password uncompressed; they are not that large ...

Dwachs

Imho, appending hashes to the savegame and not sending the whole file would require a lot of extra maintenance code:  commands to stop compression without closing file. Extra routines to read a savegame, where compression stops in the middle but some data is still to be read. Routines that safely can exit if the data ends 'unexpected' ie no hashes in the savegame for the client.

With the current patch, network servers can still work as they used to be. After restarting, passwords are restored. If savegame is saved by UI means then the passwords are in the file and present in-game after loading. If one wants to distribute a network savegame with passwords, then one has to save it explicitely at the server.

For offline games, nothing changes: passwords are in the file.
Parsley, sage, rosemary, and maggikraut.

prissi

Since Timothy runs the most server, he is best for deciding this, imho ...

Ashley

I think Dwachs' plan is fine. Once the savegames are provided for distribution when the game has been finished the passwords ought to be stripped anyway. Having the player slots password protected only makes sense while the netgame is in progress IMO.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

Dwachs

Parsley, sage, rosemary, and maggikraut.