The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Topic started by: AP on December 15, 2017, 07:15:49 PM

Title: [Confirmed not a] Bug: server player passwords lost on /reload from save
Post by: AP on December 15, 2017, 07:15:49 PM
It has been found on the Canterbury-Whitstable simutrans-ex server that when the server crashes and the game has to be restarted from a save, all the player passwords are stripped out.

This would seem to have risk for abuse in competitive online games.

I'm sure Asaphxiix who runs that server can offer more details.

Moderator note: The title of this post has been changed to reflect the fact that this issue has been confirmed not to be a bug. The amended text is in square brackets.
Title: Re: Bug: server player passwords lost on /reload from save
Post by: DrSuperGood on December 15, 2017, 08:46:00 PM
They are written to a separate file on the server. Maybe because the server is crashing it never writes the file.
Title: Re: Bug: server player passwords lost on /reload from save
Post by: asaphxiix on December 15, 2017, 11:57:43 PM
Hello,

When the server crashes, I am forced to manually load the last save game from the documents\simutrans\ on my windows server, I move the most recent file to the documents\simutrans\save\ folder and rename, then start the game using the renamed save.

Since the save I am loading is considered a local game, all passwords are reset. I think this is a good feature, as it allows a player to load a local version of any online game and enjoy doing whatever they want there. But there should also be a way to preserve the passwords on the local save, somehow, unless there is one already, which I have been shamefully missing.
Title: Re: Bug: server player passwords lost on /reload from save
Post by: TurfIt on December 16, 2017, 12:56:33 AM
Assuming the latest save isn't corrupt, since you're moving it, simply don't move it. There's no need to specify a savefile when starting the server; If the latest save is left where it belongs, it'll be used.
Title: Re: Bug: server player passwords lost on /reload from save
Post by: DrSuperGood on December 16, 2017, 01:08:40 AM
QuoteBut there should also be a way to preserve the passwords on the local save, somehow, unless there is one already, which I have been shamefully missing.
Passwords are preserved in their own separate file. Hence if one loads a save in single player there is no password support as no password file is used.

For example when I was testing a standard multiplayer server it used the following files.
server13353-network.sve -> The game save.
server13353-pwdhash.sve -> The password hash file.

Deleting the password hash file will reset all company passwords. Unless the game does something really stupid, it should also be possible to move one password hash file from one save to another.
Title: Re: [Confirmed not a] Bug: server player passwords lost on /reload from save
Post by: jamespetts on December 16, 2017, 01:28:19 AM
Splendid, thank you for confirming this.

Applying a new moderation policy intended to make it easier to keep track of which things remain outstanding bugs that need fixing, I have modified the title of this post to make clear when reading the post headings that this is not, in fact, a bug.
Title: Re: [Confirmed not a] Bug: server player passwords lost on /reload from save
Post by: asaphxiix on December 16, 2017, 01:45:22 AM
Hello,

I have now been able to work around this problem by not specifying the save game name in the command line flags. This will cause the server to load the previous game, and I shall review in the coming days whether this somehow causes worsening of activity loss on server crash (i.e. could a less recent save be loaded after crash, as a result of this new method?).

This will be updated in the proper game communications.
Title: Re: [Confirmed not a] Bug: server player passwords lost on /reload from save
Post by: jamespetts on December 16, 2017, 02:25:59 AM
Quote from: asaphxiix on December 16, 2017, 01:45:22 AM
Hello,

I have now been able to work around this problem by not specifying the save game name in the command line flags. This will cause the server to load the previous game, and I shall review in the coming days whether this somehow causes worsening of activity loss on server crash (i.e. could a less recent save be loaded after crash, as a result of this new method?).

This will be updated in the proper game communications.

The new method that you describe is the method that I use, and I recommend it. I am not aware of any way in which, in normal use, this will result in loading an earlier saved game.