null pointer when creatgame( ) from zone extension

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Post Reply
moranil
Posts: 10
Joined: 15 May 2011, 14:32
Location: India

null pointer when creatgame( ) from zone extension

Post 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?
----------------------------
Jai Ho!
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

Please read the ISFSExtension.init() method Javadoc.
Paolo Bax
The SmartFoxServer Team
Post Reply