Rails icon indicating copy to clipboard operation
Rails copied to clipboard

Notification settings not saved

Open beginetienne opened this issue 5 years ago • 3 comments

The notification configuration is not saved when I hit the save button. I had to manually update the profiles in %appdir%\rails\profiles to make them work.

image

Example profile: C:\Users\Etienne\AppData\Roaming\rails\profiles\EtienneA.rails_profile

#Automatically generated, do not edit #Thu Sep 17 09:47:55 EDT 2020 log.directory=C:\Users\Etienne\Desktop\log\ font.ui.scale=1.0 save.auto.enabled=yes save.archive.keep_count=5 profile.parent=pbem save.directory=C:\Users\Etienne\Desktop\save local.player.name=EtienneA map.displayCurrentRoutes=yes save.recovery.active=yes gridPanel.tableBorders=enabled save.auto.interval=3 notify.discord.webhook=https://discordapp.com/api/webhooks/720004884778319975/NwaTbMo__Ngs8KLF55HGtk_UEad4_2IQVjcqEv26VxVcSt1LPeJeh5lVi-WuWFzMl8a6 notify.discord.user_mapping=EtienneA:517444304176939028,EtienneB:517444304176939028 notify.message=Player ${previous} has played. Your turn ${current}! Game: ${game} Round: ${round}

Above is also a "good" example for the notify.message value. I had to read notify/Discord.java to find out what the substitution pattern is. Also for reference, the notify.discord.user_mapping value is [playername]:[discord],[playername]:[discord],...,[playername]:[discord]. I recommend using the discord ID in place of [discord], which seems to work every time!

Also, an incomplete notify.discord.user_mapping value (with missing players) seems to prevent the game from moving forward.

I have also noticed that the notification settings are pulled from the save game file. Is there a way to change that once the game has started ?

beginetienne avatar Sep 17 '20 14:09 beginetienne

Note that I have used the master branch to run these tests with 18scan. It would be great if a new build could be posted on sourceforge. Thanks.

beginetienne avatar Sep 17 '20 14:09 beginetienne

Options that have to be saved, because these can vary per game, should not be configuration options but game options, settable in the Option tab at game start.

Insofar these items consist of a fixed and a variable part, I would suggest to use both option types, whereby the (variable) game option string is appended to the (fixed) config option part, allowing either one to be null or empty.

erik-vos avatar Sep 20 '20 21:09 erik-vos

Two somewhat unrelated remarks:

  1. I notice that many game options appear in all games; these are in fact generic. Shouldn't we add a generic GameOptions.xml in the resources/data directory to cover these items?

  2. For Steam over Holland I have added a new GameOption type="hidden" to enable saving values that must persist but should not appear in the startup Options tab. I'm using this to save the seed (date/time in milliseconds) of the random generator that I have added to GameManager. In SOH it is used for the random selection of the in-game privates. This facility will appear in a forthcoming PR that includes SOH.

erik-vos avatar Sep 20 '20 21:09 erik-vos