From: Adam B. <ab...@o2...> - 2011-01-22 00:02:58
|
OK. I identified the error. The problem is with NDC. You use it to store game id or whatever you use then to query a map for GameManager. This structure is per-thread. If you load game after running application it is initialized in the AWT events thread (while acting on load game event) and so it later works well in other events. However if you load the game using command line argument NDC is initialized from the main thread and in events thread (used by File | Save) there is no knowledge about the id. By the way it seems like a mighty abuse of the object... I will try to fix that... Adam Badura -----Oryginalna wiadomość----- From: Adam Badura Sent: Friday, January 21, 2011 11:59 PM To: Development list for Rails: an 18xx game Subject: Re: [Rails-devel] Development Environment I will have a look into those lists. I already added (locally on my machine) code responsible for setting save directory if a game is opened from command line argument. This was not done (the path was only set if the application was run without command line argument and the game was opened from within the application) and was kind of annoying (to me at least). This occurs in current released version and most likely also in trunk (as the code is not executed) - however that cannot be verified well until Save works. And regarding the Save the problem again occurs only if the game is opened by giving its path as command line argument. I already traced it to problems with NPC.peek() returning an empty string rather then "01" in Save action code which casues failure to finde GameManager instance. Strange as it seems from my debuging that NPC.peek() ought to return "01" as it was pushed there. Now I'm at looking into log4j to see what this actually does and how should be used. If I will manage to do anything good I will open a different thread with more details (as it is somewhat off-topic here). Adam Badura -----Oryginalna wiadomość----- From: Erik Vos Sent: Friday, January 21, 2011 11:51 PM To: 'Development list for Rails: an 18xx game' Subject: Re: [Rails-devel] Development Environment > Do you have any pending tasks? Yes: implement all games not yet done so far :-) But for a starter you might want to take a look into the Feature Requests and/or Bug Reports in Sourceforge. > It seems there is a bug. If a game is opened by giving it as > an argument "File | Save" results in NullPointerException for > GameManager.getInstance(). File|Save in Rails seems to work for everyone else. But you can only save a game after opening it. However, you seem to do it the other way around...? If you really have found a bug - what about fixing it? Erik. ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Rails-devel mailing list Rai...@li... https://lists.sourceforge.net/lists/listinfo/rails-devel ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Rails-devel mailing list Rai...@li... https://lists.sourceforge.net/lists/listinfo/rails-devel |