Page 1 of 1

null pointer when creatgame( ) from zone extension

Posted: 13 Jul 2011, 11:55
by moranil
Hi all,

I am getting null pointer exception when creating game room in init() method of zone extension. however rooms are created and works fine if I handle exception

here is the trace

Code: Select all

java.lang.NullPointerException
        at com.smartfoxserver.bitswarm.io.Response.write(Response.java:74)
        at com.smartfoxserver.v2.api.response.SFSResponseApi.notifyRoomAdded(SFS
ResponseApi.java:110)
        at com.smartfoxserver.v2.api.SFSApi.createRoom(SFSApi.java:622)
        at com.smartfoxserver.v2.api.SFSGameApi.createGame(SFSGameApi.java:122)
        at com.smartfoxserver.v2.api.SFSGameApi.createGame(SFSGameApi.java:76)
        at extensions.ZoneExtension.init(ZoneExtension.java
:75)
        at com.smartfoxserver.v2.entities.managers.SFSExtensionManager.createExt
ension(SFSExtensionManager.java:304)
        at com.smartfoxserver.v2.entities.managers.SFSZoneManager.createZone(SFS
ZoneManager.java:427)
        at com.smartfoxserver.v2.entities.managers.SFSZoneManager.initializeZone
s(SFSZoneManager.java:240)
        at com.smartfoxserver.v2.SmartFoxServer.start(SmartFoxServer.java:214)
        at com.smartfoxserver.v2.Main.main(Main.java:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
        at com.exe4j.runtime.WinLauncher.main(Unknown Source)
        at com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)
it seems that smartfox is send notification about new room creation. Is there a way to disable notification for game room creation, or I should not create room in init method?

Posted: 14 Jul 2011, 09:36
by Bax
Please read the ISFSExtension.init() method Javadoc.