I am afraid that this does not seem to work, and I cannot find any alternative way of doing this that does not seem extraordinarily complicated. Also, it is not clear how to make this work equally in Visual Studio as with GCC. Have you (or anyone else) any ideas?

For MSVC, isn't that why revision.jse exists to create revision.h ? I expect you need to rewrite that for git instead of svnversion... (and figure out how to get a whatever a .jse is to convert to decimal...)

I did not notice that you posted when I edited my post so here it is again:

Quote

It has worked here:

No changes done except for my suggestion, but that's on Linux and with Standard code. For MSVC the makefile has no effect. Also git has to be accessible from the shell, if you open cmd and can't call git you need to add the executable to the variables.

Edit:For MSVC you need to change svnversion to git rev-parse --short HEAD in revision.jse

And what do you suppose the output of atol("cf5a61b") might be? How about a big fat zero.The window title treats REVISION as a string, no problem. The listing server version check treats it as int32 parsed from the string with atol() - hex not allowed.

And what do you suppose the output of atol("cf5a61b") might be? How about a big fat zero.The window title treats REVISION as a string, no problem. The listing server version check treats it as int32 parsed from the string with atol() - hex not allowed.

Do you think that the problem is only on the listing server? That simutrans itself is treating the revision as string, and only the listing server is trying to convert it to a number?

Thank you all for that. However, I think that I am still missing important contextual information necessary to understand how to make this work, especially in Visual Studio.

I have replaced the atol commands connected to REVISION with strtol commands, which I understand work with strings representing hexadecimal values. However, I still cannot find any way of causing the revision number to be inserted into Visual Studio (and for REVISION to be defined there). I have modified the .jse file as follows:

and I have included it in the "Resource files" section, but I have no idea how to tell Visual Studio to do anything with it. Google searches tell me little more than .jse is some sort of Javascript file.

I did try to use the "revision from file", but that only defined revision as "Unversioned directory" (and appeared to have no logic for doing anything else, which made that seem rather pointless; indeed, I notice that the whole REVISION_FROM_FILE preprocessor directive and related code has now been excised from Standard).

I still do not understand why REVISION was not defined even in the Linux builds, however.

Any assistance would be much appreciated. Thank you all again for your help so far.

Is the git executable on your path? From the GIT working directory where you invoke make, just run the git rev-parse manually, and you should see the printout.Did you put WITH_REVISION=1 in config.default?And no other definitions of REVISION sneaking in?

The context is that REVISION is a preprocessor directive. With make this can be done with a line in the makefile, on Visual Studio there's no way, so Simutrans uses a hack where it calls a JavaScript that creates a header file that includes this preprocessor directive.

In both cases it will set REVISION with the output of running the command "git rev-parse --short HEAD", which means both will simply run the git executable.

TurfIt has already pointed that the JS is not included in Experimental vcxproj, you just need to add that xml part and VS and the JS will do the rest.

As git is called you need to have a .git directory inside the working tree and git must also be installed and set on your PATH so you can call it globally. On Linux this should be trivial as installing git from any repository already installs it on the main bin dir. On Windows you'll need to include the path to the git executable into PATH. If you are using the GitHub desktop UI you need to navigate to %LocalAppData%\GitHub\PortableGit_random#\cmd then you can add this folder to you PATH.

Thank you both very much - this now seems to work in Visual Studio. I have yet to have time to test it in Linux - I will report back in due course on that.

Edit: This also seems to work - in principle at least - in Linux: thank you again both for your help.

However, I am not able to make it work properly in Linux due to two other issues, one of which is extremely baffling. The way that I have had the server set up is that I simply created a directory for the game, pulled from Github, compiled Simutrans, did the same for the pakset in a suitable subirectory, and ran it from there.

This simple arrangement works well enough in itself, but I need to alter simuconf.tab from the one on Github. This means that, now, whenever I pull from Github, it merges into a new commit and the commit number on the server is therefore not the same as for the release.

I had hoped to get around this by using the separate directories that I had set up for the nightly build to build the executable, and instead of having the actual executable in the running directory, just have a symbolic link to the executable in the nightly build directory. This would then be at the default commit number and thus should not cause problems with merging. I have used a similar system successfully for the paksets: the pakset used by the Bridgewater-Brunel server is now the identical one to that offered as the nightly download, just symbolically linked to the relevant directory.

However, I have had a bizarre problem in building the server executable from the nightly directory: it refuses to build a command line version even when explicitly instructed to do so in the configuration file. I created a new copy of config.default called config.server, and created a /server subdirectory in the ~/build directory. When I run env CFG=server make -j5, it indeed builds a separate copy of simutrans-experimental in the /server subdirectory, but, when I try to run it with no options, it complains of there being no GUI themes, indicating that this is a graphical build. When I try to run a version built as a command line build, it complains instead about a modal dialogue unless it is given command line switches indicating the pakset and a saved game to load.

# The following useful conditional compilation flags exist## Needed to compile:# USE_C: no assembler for copying (required for not using GCC on x86)# SIM_BIG_ENDIAN: MUST be set for PPC/Motorola byte order! (old mac, amiga)# NO_INTPTR_T: must be set if intptr_t is not available## Changing appearance:# USE_SOFTPOINTER: emulate mouse pointer (set automatically in Makefile)## Useful for debugging:# DEBUG_ROUTES: show routing calculation information in minimap# SHOW_FORE_GRUND: show which objects are drawn as foreground# DEBUG_FLUSH_BUFFER: show the dirty areas on the screen# USE_VALGRIND_MEMCHECK: make valgrind-memcheck aware of the memory allocation stuff in dataobj/freelist# SYSLOG: send debug output to syslog## Following flags alter game engine (and are off for standard builds)# OTTD_LIKE: Enables half height tiles and crossconnects all industries# AUTOMATIC_BRIDGES and AUTOMATIC_TUNNELS: will be built also for player# AUTOJOIN_PUBLIC: stations next to a public stop will be joined to it# USE_DIFFERENT_WIND: different airplane approach directions over the map# DESTINATION_CITYCARS: Citycars can have a destination (enabled automatically - cannot be disabled)## In order to use the flags, add a line like this: (-Dxxx)# FLAGS = -DUSE_C

The command "CFG=server make -j5" with your config allows me to build a working command line version on Linux.

I can also confirm the reporting of the correct build hash.

That is very curious. Have you (or anyone else) any idea why it does not seem to work for me? Could I be missing something obvious?

Edit: I tried copying the exact same config.default that I used to build the server version into the nightly directory and naming it as config.server. The only change made was to the output directory of the executable. Even after running "make clean", the executable produced is still one that complains at having no GUI themes when launched instead of complaining about a "modal dialogue" as a non-GUI build would.

I am afraid that it is entirely beyond my comprehension how this could be happening.

If you give me an account there, I'll move the data, and start new instance. Then just change the DNS for server.exp.simutrans.com

I'll create the account and send you login information. Does it interact with apache in any way? Because I haven't played with the apache setup yet, but I will if I need to. I do hope it's not a pain to move.

However I have used http://server.exp.simutrans.com/ as a place to publish compiled executables and paksets for use with the server games running on the same server. Also I used it to store screenshots and saves for bug hunting. But I can put that stuff elsewhere.

I am afraid that I do not have a logo with the Extended text; it was not I who made the old "Experimental" logo.

Is the old listing server address already set to redirect to the new one? If so, the new listing server is not working, as the Bridgewater-Brunel server would be announcing every 15 minutes or so, and would have been redirected by the old server to the new one.

The file ending with Path Text has the fonts converted to paths so you don't need the fonts installed on your system, that's the option one should use on the web. The other file requires the fonts, in case you wish to edit the texts, which are: