From: Erik V. <eri...@xs...> - 2011-07-06 14:38:10
|
Scott, To test Autosave/load you can run several Rails copies in parallel by specifying a different local user name for each process, with the command-line argument -Dlocal.player.name=<nameOfPlayer> If you want to keep the logs separate, you should add something like -Dlog4j.configuration=<path>/<nameOfPlayer>.properties For each player, you start with loading the same initial saved file, and then go to File|Autosave/load immediately. A popup is displayed, in which you must select "On". You can also change the polling interval to your liking (default 30 sec.). Press "OK". At the start of a game, let the first player do this first. Pressing "OK" automatically creates an initial saved file, which then must be loaded by the other players. Still, all players must use the menu and select "On". I copy the description below from an earlier email. I'll see if I can put this in the wiki. Please note, that this whole thing is still experimental. Several improvements are already foreseen, and it is known to break down on complex activities like the 1856 CGR formation or the 18EU Final Minor Exchange Round. So better try it with some simpler games first. Erik <Copied from an old post> 1. Autosave/load is activated by checking a menu option. Steps 2 and 3 apply only if this option has been activated. 2. Every time that an active player loses the turn, the following is done: 2a. A saved file is written to the default location (the first time the usual popup will ask for it) and with the usual filename: <prefix>_<timestamp>_<player>.rails. 2b. The name of this file is written into another (new) file, named <prefix>.last_rails. 2c. Rails goes into polling mode. (Ideally, all actions should be prohibited except Quit and perhaps some more). 3. In polling mode, Rails regularly reads the .last_rails file to check if the filename has changed. The interval is configurable (default 30 secs?). If a new filename is found: 3a. This file is read and processed in the same way as Reload does it. 3b. Rails checks if the player has got the turn. If so, polling mode is suspended, and normal operation resumes. Otherwise, polling mode continues. 4. When Rails is restarted for an ongoing game, the last saved file must be loaded manually. Autosave/load can only be activated after that. If the local player does not have the turn, Rails will enter polling mode at that point. Notes: 1. Normally, each game should use a separate directory. In theory it should be possible to run multiple games in one directory, if each game is given a unique <prefix> at the *first* save action, but this is not recommended. 2. Repeated reloading during polling mode ensures that actions by other players show up with a reasonable delay. 3. It does not matter if a saved file is missed because the interval is longer than the time between two saves by other players. Each saved file contains the whole game history. Van: Scott Petersen [mailto:sc...@re...] Verzonden: woensdag 6 juli 2011 15:50 Aan: Development list for Rails: an 18xx game Onderwerp: Re: [Rails-devel] Refactored loading code On Wed, Jul 6, 2011 at 4:04 AM, Erik Vos <eri...@xs...> wrote: But, as I have not got any feedback yet on this new feature, its further development doesn't have a high priority for me right now. Erik, I never figured out how Autosave/load is supposed to work. What steps would I do to test it? I assume I could have two instances of Rails running on the same machine to try it. |