Hot redeploy extensions, Not working :(
Posted: 19 Jul 2013, 20:15
I read from the docs I can hot redeploy extensions.
After investigation, it appears an object of mine that held a value before now is null.
In my main extension I have this :
And each client sends a message to the server once a second they they read values from that GameRoom object.
While debugging, I trace out this each request :
Normally I see this :
Which means my hash map knows about my game room.... however, immediately after I hot re-deploy the extension it traces out :
The only way in my code to actually remove anything from the hash map is from a "removeGameRoom" method but I have traces in there any that method definitely doesn't get called.
Am I missing something? Maybe I assumed players could keep playing their games while I hot deployed the extension.... and maybe you can't.
Any help would be greatly appreciated!
Whenever I copy a new version of the extension over the old one I can see that the new extension gets loaded... however, I immediately start seeing errors in the logs.SmartFoxServer 2X provides Extensions hot-redeploy which can be very useful during the development phases. When this feature is turned on (see the Custom configuration paragraph above), the server will monitor your Extension folders and reload your code when a jar file is modified.
All you need to do is configure your Java IDE to build or copy the jar file directly under the Extension folder in your SmartFoxServer path, and you will have a one-click deploy system.
After investigation, it appears an object of mine that held a value before now is null.
In my main extension I have this :
Code: Select all
private ConcurrentHashMap<Integer,GameRoom> gameRooms = new ConcurrentHashMap<Integer,GameRoom>();While debugging, I trace out this each request :
Code: Select all
System.out.println("GameRooms : "+this.gameRooms);Code: Select all
GameRooms :{2=GameRoom@62073b74}Code: Select all
12:39:33,060 INFO [Thread-4] managers.SFSExtensionManager - Reloading extension: { Ext: MPBTGTD, Type: JAVA, Lev: ZONE, { Zone: MPBTGTD }, {} }
GameRooms :{}Am I missing something? Maybe I assumed players could keep playing their games while I hot deployed the extension.... and maybe you can't.
Any help would be greatly appreciated!