Hello,
I'm having a problem... a null is returned if I try to send a message from server to my client...look below:
//send("iPadCommand", answer, gameExt.getGameRoom().getUserList()); // THIS DOES NOT WORK
send("iPadCommand", answer, player); //this works
gameExt is my main extension parent. I got this from an example, and it just not work...
This command is inside a handleClientRequest with a class that extends a BaseClientRequestHandler, called in my main extension extended by SFSExtension.
EDIT: I found that getParentRoom() return always null... maybe a bug?
EDIT2: found the problem... but not exacly how to solve it: the getParentRoom() is valid only for Room-level extensions... my extension is in Zone, I thought it will inherit, but it was not (or dont know what)... so I put the following code in my getGameRoom method: return getParentZone().getRoomByName("Lobby"); and it worked...
Extension issue
Extension issue
Last edited by kaligus on 28 Mar 2012, 20:26, edited 2 times in total.
-
- Posts: 186
- Joined: 16 Oct 2011, 14:33
Re: Extension issue
hi,
please clarify this :
is gameExt a zone extension or a room extension?
if its a zone extension then getparentroom() will return null.
now for your solution, lets say its a zone extension. let the zone contain a room named "someroom". also lets say you want to send the message to the users in "someroom".
then do this in your handleclientrequest() :
gameExt .getParentZone().getRoomByName("someroom") instead of gameExt.getGameRoom().getUserList()
please clarify this :
is gameExt a zone extension or a room extension?
if its a zone extension then getparentroom() will return null.
now for your solution, lets say its a zone extension. let the zone contain a room named "someroom". also lets say you want to send the message to the users in "someroom".
then do this in your handleclientrequest() :
gameExt .getParentZone().getRoomByName("someroom") instead of gameExt.getGameRoom().getUserList()
Who is online
Users browsing this forum: DavidoosNaw and 60 guests