Page 1 of 1

HandleInternalRequest to room extension HOW ?

Posted: 17 Jul 2011, 19:30
by kotbegemot
Hello

If my as1 extension is linked to Zone i can call handleInternalRequest for this extension:
var targetExtension = zone.getExtension("myExtension")
var responce = targetExtension.handleInternalRequest("Hello");
(And i cant find zone method getExtension() in docs ..)

But is extension is linked only to room how can i call handleInternalRequest for this extension ?

Posted: 17 Jul 2011, 19:33
by rjgtav
Hi. Yes the getExtension method isnt in the ass docs, as they're deprecated. You should use the java docs for these methods.
To get an extension that is attached to a room, you simply do:

room.getExtension("extension name");

This method is available for both zone and room. The rest is the same.

Posted: 17 Jul 2011, 19:41
by kotbegemot
I try:

var zone = _server.getCurrentZone();
var room = zone.getRoom(fromRoom);
var targetExtension = room.getExtension("miniGameShariki");

But its throw error: cant find function getExtension.

Posted: 17 Jul 2011, 19:49
by rjgtav
You're right... strange... I'll see if i find a way...

Posted: 17 Jul 2011, 19:51
by kotbegemot
Thaks for try to help

Posted: 17 Jul 2011, 19:55
by rjgtav
So after some search, and as i already suspected, you need to use the ExtensionManager.

Check this topic, as it is about the same issue:

http://forums.smartfoxserver.com/viewto ... textension

Posted: 18 Jul 2011, 11:25
by kotbegemot
http://forums.smartfoxserver.com/viewto ... textension


PostPosted: Wed Apr 30, 2008 10:35 am Reply with quote

Joined: 04 Aug 2006
Posts: 42


NP! It would probably be a good idea to update the docs with the AS code for talking between rooms and zones as I'm sure this feature will be used extensively.

Best

Guys now 2011 year :)