The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Simutrans-Extended bug reports => Topic started by: Matthew on June 06, 2021, 03:52:59 PM

Title: Client and server report different hash numbers when the Git hash starts with 0
Post by: Matthew on June 06, 2021, 03:52:59 PM
Steps to reproduce

1. Wait for a Git commit where the hash begins with 0 (zero), e.g. the present #06772e6 (https://github.com/jamespetts/simutrans-extended/commit/06772e61bc26d962ab38e695882fcea47602187a).
2. Download the Linux client from Bridgewater-Brunel and try to connect to that server.

Expected behaviour

Both server and client report their version using the seven-digit commit hash.

Observed behaviour

The Linux client reports its version using the seven-digit commit hash:
(https://i.imgur.com/eMEtSmY.png)

But the server reports its version with the leading zero omitted:

(https://i.imgur.com/g8XzCsQ.png)

This prevents players joining using the in-game interface.

Workaround

Start the client from a terminal using the parameter -load net:bridgewater-brunel.me.uk in order to override the version check.

Background info

Here (https://forum.simutrans.com/index.php/topic,20592.msg193303.html#msg193303) are some notes I made about a different bug in the commit hash code last year. It might be irrelevant or out of date now.
Title: Re: Client and server report different hash numbers when the Git hash starts with 0
Post by: jamespetts on June 06, 2021, 05:55:27 PM
Thank you for the report - this is a very odd one, especially as the problem appears to occur when the server and client are both running Linux. I do not believe that I wrote the hash truncating code myself (although I cannot remember much about it now), so I am not sure why it would produce different results on the server to those that it produces on the client.
Title: Re: Client and server report different hash numbers when the Git hash starts with 0
Post by: RESTRICTED ACCOUNT on June 06, 2021, 06:18:52 PM
I think the display itself will be fixed in this patch, but I'm not sure if it's affecting the mismatch check.
Because get_game_engine_revision() doesn't change. It just changes the UI display.