HandleInternalRequest to room extension HOW ?

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

Moderators: Lapo, Bax

Post Reply
kotbegemot
Posts: 82
Joined: 21 Nov 2010, 05:05
Location: Saint-Petersburg

HandleInternalRequest to room extension HOW ?

Post 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 ?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post 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.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
kotbegemot
Posts: 82
Joined: 21 Nov 2010, 05:05
Location: Saint-Petersburg

Post 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.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post by rjgtav »

You're right... strange... I'll see if i find a way...
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
kotbegemot
Posts: 82
Joined: 21 Nov 2010, 05:05
Location: Saint-Petersburg

Post by kotbegemot »

Thaks for try to help
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post 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
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
kotbegemot
Posts: 82
Joined: 21 Nov 2010, 05:05
Location: Saint-Petersburg

Post 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 :)
Post Reply