Confusion about SendXtMessage and OnExtensionResponse

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

digiplayer
Posts: 7
Joined: 10 Apr 2009, 16:48

Confusion about SendXtMessage and OnExtensionResponse

Postby digiplayer » 13 Apr 2009, 21:12

I have created two extentions in java one is to verify user creditials and the other is to send and recieve user information.

I think i am confused because the extentions are not operating they way i expected. In the login extention i handle everything in the handleInternalEvent method and I send the responce which works perfect. I can parse the responce and load the level.

In user info extention I handle everything in the handleRequest method which recieves the message does its work and then sends a responce to the client, but the client does not receive it.

What is stranger to me still is the fact that when is send the message to the user info extention using SendXtMessage every script that has registers callback methods recieve a responce message but only for internal events like login, join room and so on. And I cannot receive a responce from the userinfo extension when sending a message. Can anyone shed some light on this.
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 14 Apr 2009, 08:25

Hi,
first one small note: it's not necessary to use 2 extension for the login and the other requests.
I would recommend to use one single extension and then maybe have multiple classes handling each request separately, as the Object Oriented paradigm would suggest.

Take a look at the last section ("Request Dispatching") in our Java Cookbook -> http://www.smartfoxserver.com/docs/docP ... okBook.htm

In user info extention I handle everything in the handleRequest method which recieves the message does its work and then sends a responce to the client, but the client does not receive it.

This is very strange.
Turn on the debugging flag of the SmartFoxClient API and watch the debugging info in the Flash IDE. You should definitely see a response object coming back.

If not, you should at least get an error in the server console/logs
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 20 guests