Page 1 of 1

getParentExtension() problem

Posted: 27 Dec 2010, 21:25
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?

Posted: 28 Dec 2010, 06:26
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.