From: Stefan F. <ste...@we...> - 2010-07-21 19:24:31
|
Phil: the problem is fixed now in SVN. Your file did not work on the current development version, as there is a change already, which excludes non-active players from the auction. I removed the additional pass of your save file (see attachment). It should now work under development at least. For 1.3 there is no fix possible. Stefan Details of the problem: The bug is similar to the reload bug of the infinite last train: The token was laid in a station in Berlin, which did not exist at the start of the game and thus the action was not intialized correctly. This brings up another general rule for the reload mechanism: Items, which do not exist at the beginning of the game, should not be intialized at the deserialization (readObject), but at the time of the first access. (This mechanism was introduced by Erik in buyTrain). I know wonder, which elements of Rails might not be created from the beginning and which actions might be effected. I looked into some potential candidates, but there might be still some other. Known objects with potential problems: * City (stations which are not available at the start of the game) * Train (available at infinite quantities) Known objects without problems: * Tile (only one tile created, regardless of quantity) * BonusTokens (only one token created per token class, regardless of quantity) Effected classes: City: * LayBaseTokens: No problem, stations are reference by integer ids only * StartCompany: Fixed now * LayTile: No problem, relaidbasetokens is coded by a String, which is parsed after access only Train: * Buy Train (the train bought is fixed, but the exchange train could be effected) * Discard Train (the discarded train could be effected) -> Both cases are currently unlikely, as the train category with infinite supply is usually the best, but this might change in the future, especially trains not triggering phase changes might be in infinite supply On Tuesday 20 July 2010 18:39:11 Phil Davies wrote: > Save file 18EU_20100720_1336_Chris.rails > > Load up and start KBS at 100, base city Berlin. Processes this action > totally fine. > > Now save the game, and reload it (or just load > 18EU_20100720_1602_Bug.rails). Load error. > > I traced the execution of the startCompany action and it gets > processed and logged with the correct selectedHomeCity. The > selectedHomeCity gets written to the executedActions log happily as > well. Yet for some reason when you reload the game, the > selectedHomeCity object for that action is a null value. It looks > like the ObjectOutputStream is, for some reason, failing to write the > selectedHomeCity object to the save file, causing the reload to fail. > > Any thoughts?? > > You will have to load this on 1.3 by the way, I can't load this file > at all against the current head revision of the code. > > Phil |