getParentExtension() problem

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
gates
Posts: 15
Joined: 15 Dec 2010, 19:48

getParentExtension() problem

Post by gates »

ClassName t = (ClassName)getParentExtension();

t.sendGameTimer();

this returns an error

Code: Select all

trollers.ExtensionController     -
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.lang.NullPointerException
Message: *** Null ***
Description: Error while handling client request in extension: { Ext: Tombola, T
ype: JAVA, Lev: ZONE, { Zone: ZoneName}, {} }
Extension Cmd: ready
+--- --- ---+
Stack Trace:
+--- --- ---+
GameCommandRequests.handleClientRequest(GameCommandRequests.java:30)
com.smartfoxserver.v2.extensions.SFSExtension.handleClientRequest(SFSExtension.j

and when i request this

t.getGameTimer();

the above also returns a null pointer exception;

what should i do?
tchen
Posts: 191
Joined: 11 Dec 2010, 14:14

Post by tchen »

checklist:
1) GameCommandRequests extends BaseClientRequestHandler
2) your zone/room extension uses addRequestHandler(...) to add GameCommandRequests.class
3) You're NOT trying to override handleClientRequest on the extension itself.
Post Reply