Extension Not Being Called?

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

Moderators: Lapo, Bax

Post Reply
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Extension Not Being Called?

Post by coolboy714cp »

As the title says, I'm having a problem with my extension not being called. On the client, it is saying it sends an extension message, but the server does nothing after that.

Code: Select all

function handleRequest(cmd, params, user, fromRoom) {
	
	var dbase = _server.getDatabaseManager();
	
	if (cmd == "register") {
		
		var response = {};
		var error = "";
		
		var username = params.username;
		var password = params.password;
		var email = params.email;
		trace("Vars");
That's all the coding up to the first trace statement, which isn't being called.

On the client I have this output when I try to call the extension:
[Sending]: <msg t='xt'><body action='xtReq' r='-1'><![CDATA[<dataObj><var n='name' t='s'>registerExt</var><var n='cmd' t='s'>register</var></dataObj>]]></body></msg>
The extension has been started, as I can see from the server when it starts:
[registerExt.as]: Internal event receieved: serverReady
Does anyone know what the problem is?

Thanks for the help in advance.
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Post by coolboy714cp »

Also, this is the code I'm using to call the extension:

Code: Select all

function rSend() {
	var exObj = {};
	exObj.username = "TEST";
	exObj.password = "PASS";
	exObj.email = "HI@HI.COM";
	_root.sfs.sendXtMessage("registerExt", "register", exObj);
}
That's the function. I then put an on (release) { handler on a button to call the rSend function.
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Post by coolboy714cp »

Does anyone know what the problem is?

Also, here is a quick update:

In the beginning of the extension I added a trace to see if it was being called at all; the trace did not execute for some reason.
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

1. Verify that registerExt is the extension name/id as defined inside that zone.
2. Setting <DebugIncomingMessages> to true will allow you to see/log all incoming messages from clients to the server.
Smartfox's forum is my daily newspaper.
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Post by coolboy714cp »

Sorry for this wasted post, but I found my error. The error seems to be that I was not joined in a room, as I forgot to call the autoJoin() command in the coding. It works fine now though. :)
Post Reply