Fix game loading issues
Naval trade simulation in the north and baltic sea during 1250 - 1500
Status: Alpha
Brought to you by:
hotzst
There are two known issues and more might be hidden:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at ch.sahits.game.openpatrician.model.product.AmountablePrice.remove(AmountablePrice.java:88)
at ch.sahits.game.openpatrician.model.impl.WareHolding.move(WareHolding.java:102)
at ch.sahits.game.openpatrician.model.city.impl.City.move(City.java:448)
at ch.sahits.game.openpatrician.clientserverinterface.service.CityProductionAndConsumptionService.consumeWares(CityProductionAndConsumptionService.java:99)
at ch.sahits.game.openpatrician.engine.land.city.CityEngine.consumeWares(CityEngine.java:166)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$48(GtkApplication.java:139)
at java.lang.Thread.run(Thread.java:748)
It seems like the jxThreadExecutor is not initialized on the object when unserializing.
java.lang.NullPointerException: null
at ch.sahits.game.openpatrician.engine.player.ProductionConsumptionKnowledge.updateKnowledge(ProductionConsumptionKnowledge.java:80) ~[classes/:?]
at ch.sahits.game.openpatrician.engine.AIPlayerEngine.handleTradeStrategyStart(AIPlayerEngine.java:233) ~[classes/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-18.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-18.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [guava-18.0.jar:?]
at com.google.common.eventbus.AsyncEventBus.access$001(AsyncEventBus.java:34) [guava-18.0.jar:?]
at com.google.common.eventbus.AsyncEventBus$1.run(AsyncEventBus.java:117) [guava-18.0.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
Production knoledge and consumption are not initialized. This might be similar to the one above.
Prototypes are not stored as such, even though they are marked as storable protoypes:
There are several prototypes missing, i.e. City, AIPlayer, HumanPlayer, ...
[r4425]: Defer real type from object instead of annotation, Introduce new collection type annotation wor WeakReferenceList matrix, make RandomNameLoader serializable. This fixes the big issues (so far)
Related
Commit: [r4425]
[r4426] solved most of the exceptions when loading. The second exception still remains. The event bus is only triggered when the restoring is finished. Further more there are a huge amount of warnings from the pathing, after the graph is initialized:
Related
Commit: [r4426]
The beans on ProductionConsumptionKnowledge are never rewired after loading.
Maybe it would be simpler to store prototype beans that need serialization at creation time in a WeakReference list.
[r4427] Cache serializable prototype beans
Related
Commit: [r4427]