News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Passwords are not saved in multiplayer games

Started by Matthew, December 20, 2020, 03:51:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Matthew

Steps to reproduce

1. Run today's client (20-12-20, #f5c7274) with pak128.Britain-Ex
2. Connect to Bridgewater-Brunel
3. Switch to your player or create a new player
4. Open the Players Dialogue
5. Click on the green square and enter a new password for your player
6. Close the dialogue and then the client.
7. Restart the server [It may be possible to omit this step; I will update if possible]
8. Repeat steps 1-4
9. You will see a green square again

Expected outcome: You should see a red square next to your player indicating that a password is set
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

jamespetts

Thank you for your report. I am able to reproduce this in the following way: when I start a server locally and, on the server, set the password of a player to "Kittens", the player will appear locked when logging into the server as a client. However, typing any string (e.g. "aaa") will unlock this player, and it will not specifically check for the string "Kittens".

I have spent some time trying to look into this but have been severely hampered by knowing very little about how this code is intended to work in the context of an online game: I have struggled to find any deviation in the code that appears relevant either from previous versions of Extended or the current version of Standard, and I am unable to find the part of the code where the actual checking takes place so that I can follow the execution path.

Edit: I cannot reproduce this in single player games, so the issue is specific to games running in network mode.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

Further testing shows more complexity: the game appears to regard all players as incapable of password protection (by design, from Standard) if the public player is not password protected, so as to allow the public player to unlock any other player.
There seem to be some circumstances in which the public player's password is not properly saved, but I cannot reproduce those reliably enough to invesitgate this.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

There are some unincorporated commits in the test-failed branch that try to incorporate from the standard and cause a crash, which are related to player changes.
They may be involved in solving the problem.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

Quote from: Ranran on December 20, 2020, 05:12:59 PM
There are some unincorporated commits in the test-failed branch that try to incorporate from the standard and cause a crash, which are related to player changes.
They may be involved in solving the problem.

Thank you for letting me know - may I ask which commit(s) that I should be looking at?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

Quote from: Ranran on December 20, 2020, 05:22:35 PM
Three consecutive commits of r8973-r8975.

I am afraid that I cannot see any commit message that refers to these numbers - can you elaborate on to which commit(s) that you are referring?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

I have cherry picked the commits that seem most obviously relevant to player passwords. I have not had a chance to test this properly, since, as described above, the circumstances in which this is not working as intended are very specific and difficult to reproduce.

Can I check in what circumstances that the crash occurred?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

Quote from: jamespetts on December 20, 2020, 06:16:36 PMCan I check in what circumstances that the crash occurred?
I think that the game could not be started because the save could not be read correctly. I didn't know which commit was the cause at that point, so I left that branch with the intention of stopping and checking again.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

I have been looking at this again, but this is an extremely difficult problem to deal with.

First of all, the original problem is no longer present: if I start a local server, set a password for the public player, log in with a local client and try to unlock the public player, it does not work unless I enter the correct password.

However, as anyone who plays on the server will know, every night when the server is restarted, the passwords are now reset. It is extremely difficult for me to reproduce this as any attempt to start a server using the computer that I use for debugging and loading the automatically saved game results in the game freezing and becoming unresponsive; I think that this is the ZSTD related error discussed elsewhere.

I have added some debugging messages to the log files to give a warning if the password hash file cannot be loaded or saved, which might be able to assist in tracking down the problem, although I have no idea whether the problem relates to this.

This is a significant problem and any assistance in trying to solve this would be much appreciated. Can anyone point me to the code that might affect passwords being loaded by the server on startup and how this might have changed with the merge that introduced this set of issues? Thank you in advance.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

What may be relevant is that manual save no longer saves which the current player is. In other words, if you reload the save, it will resume with the default player instead of the player when you saved it.
Only in the case of auto save, it will be restarted by the player at the time of saving.
But this is the same behavior in standard. It is possible that something that should be saved is no longer saved or loaded (during manual save).
Was it an extended-specific feature to resume in the previous player when manually saved? Anyway, that feature is currently lost.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

I do not think that saving the current player was ever an Extended specific feature, so the saving of player identities and passwords should be the same as Standard.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

Passwords are saved in separate file: server13353-pwdhash.sve

jamespetts

Quote from: Vladki on January 12, 2021, 03:06:46 PM
Passwords are saved in separate file: server13353-pwdhash.sve

Yes, they always have been - but this seems not to be working properly now in that the passwords are not, in fact, being preserved after a restart.

I have set up a temporary script to lock the public player using nettool every minute so that at least the public player remains locked, but individual players will still need to re-lock their accounts every day until this has been solved.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Mariculous

Quote from: Vladki on January 12, 2021, 03:06:46 PMPasswords are saved in separate file: server13353-pwdhash.sve
That's true.
Also, passwords have always been reset when loading a savegame that was manually modified. For example, download the server save, tweak some options, upload it again, load it on the server
Maybe there's something wrong when writing the pwdhash, so the passwords get "out of sync" with the actual save?

Vladki

Passwords are (were) preserved only if uploaded the modified game as server13353-network.sve and started simutrans-server without specifying what it should load.

EDIT: Stephenson-siemens uses "zipped" save format, and passwords are retained over restarts. So it may be related to the new compression?

jamespetts

Quote from: Vladki on January 12, 2021, 04:55:14 PM
Passwords are (were) preserved only if uploaded the modified game as server13353-network.sve and started simutrans-server without specifying what it should load.

EDIT: Stephenson-siemens uses "zipped" save format, and passwords are retained over restarts. So it may be related to the new compression?

That is interesting. I know that I have ended up modifying the startup script so that server13353-network.sve is manually specified; I cannot recall exactly why now, but I do recall that I could not get the server working without doing this.

This suggests that there is some code somewhere that is intended to reset the passwords unless the game is loaded without specifying a saved game on the command line; if this is so, then perhaps someone will know where this code can be found so that it can be modified...?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

Since the password have the same name regardless of the game (only the port number changes), reloading a server with a specified savegame will reset the password as intended (because you do not want to have all locked on a new game ... ) So just restart without the savegame should work.

If the server hangs without specifying a savegame, then usually it wants to show some GUI interaction like the new world dialog. The log should indicate why. But since the other server can reload, I suspect rather a typo.

jamespetts

I believe that Ceeac's fixes allow me to remove the "-load server13353-network.sve" parameter from the startup script for restarting, so, hopefully, from to-morrow's nightly build onwards, player passwords should once again be saved.

I should be grateful if people could test and confirm to-morrow.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Matthew

#20
Player passwords are now saved again! I set my password two days ago and it is still active today.

Thank you James, Ranran, and possible ceeac for fixing this.

However, the Player List no longer shows a red colour to indicate that the password has been saved (unless this is theme-specific?). Now fixed, perhaps requires a client restart?
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

jamespetts

It is necessary to close and reopen the player list to see the changes. Thank you for confirming this.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.