Intercommunication between zone extension

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

LeMageFou
Posts: 18
Joined: 19 Aug 2011, 15:51

Intercommunication between zone extension

Postby LeMageFou » 20 Jan 2012, 15:17

Hi.

In the documentation, I didn't manage to find a way to make communications between two zone extensions. I know it was possible in the 1.6.X version but is it still possible with SmartFox2X?
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Postby A51Integrated » 20 Jan 2012, 17:29

Yes. In SFS2X, there is a "__lib__" folder inside the extension folder. This is a special directory that would allow you to place a jar file that can be referenced by multiple extensions from different zones.

More info is here: http://docs2x.smartfoxserver.com/Advanc ... extensions
A51 Integrated
http://a51integrated.com / +1 416-703-2300
LeMageFou
Posts: 18
Joined: 19 Aug 2011, 15:51

Postby LeMageFou » 20 Jan 2012, 18:26

It's not what I'm trying to do, but thanks. :)

I found a function by browsing the API : handleInternalMessage (String cmd, Object param)
I guess this is the way to send data between two running zone extensions.
User avatar
Lapo
Site Admin
Posts: 21286
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 23 Jan 2012, 12:22

No, in general under 2X we discourage this practice as much as possible.
Under SFS1.x it was possible in order to group different sets of Rooms under several Zones.
In SFS2X this is no more a problem with Room Groups so each Zone should be insulated from the others.
Additionally each Zone runs its own Extension classloader so there is another level of separation.

In any case the communication is still possible via the handleInternalMessage(String cmdName, Object params) method.
Let's say that this is for power users only :) If you are experienced with Java, multithreading and classloaders you can definitely take advantage of it... otherwise I would suggest to think another strategy.

good luck
Lapo
--
gotoAndPlay()
...addicted to flash games
LeMageFou
Posts: 18
Joined: 19 Aug 2011, 15:51

Postby LeMageFou » 24 Jan 2012, 17:19

Lapo wrote:No, in general under 2X we discourage this practice as much as possible.
Under SFS1.x it was possible in order to group different sets of Rooms under several Zones.
In SFS2X this is no more a problem with Room Groups so each Zone should be insulated from the others.
Additionally each Zone runs its own Extension classloader so there is another level of separation.

In any case the communication is still possible via the handleInternalMessage(String cmdName, Object params) method.
Let's say that this is for power users only :) If you are experienced with Java, multithreading and classloaders you can definitely take advantage of it... otherwise I would suggest to think another strategy.

good luck


I can't think about another strategy right now because there is no way to connect to the RedBox with a Unity webplayer client.
My case is a bit special. When a user client connected in my server, depending of the room and his privileges, he can or can't stream his voice. So I need to have 2 zones :
- 1 for the world data, managing client autorizations, joining rooms, etc ...
- and the second one for the voice synchronized by the first one

I don't want to use a single AS3 script for the whole application. The goal is in fact the reverse; suppress all needs and interactions with Flash.
Currently, there is no C# API to use with RedBox and this is my problem. :(
User avatar
Lapo
Site Admin
Posts: 21286
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 24 Jan 2012, 18:52

I see... so how does your application work? Do you embed both a Unity webplayer and Flash Player in the same page? And run 2 connections?
Lapo

--

gotoAndPlay()

...addicted to flash games
LeMageFou
Posts: 18
Joined: 19 Aug 2011, 15:51

Postby LeMageFou » 25 Jan 2012, 10:52

Yes unfortunately this is how the application currently works. The world zone extension is also use to synchronize the voice zone extension (login, joining room, authorizations, etc ...). There is also some communication between Flash and Unity. For example, you can mute your microphone directly in the 3D world by pressing a button, the application will send a request via Javascript to the Flash to stop the publication of the live cast.


With the next release of Unity (3.5), we can capture video and micro. But now I need 2 things to remove all Flash dependencies :
- a true C# API for SpeeX (voice compression)
- a true C# API to connect with RedBox and send the compressed voice data
Having only one player will greatly improve performances and portability (ie iOS tablets).

Return to “SFS2X Questions”

Who is online

Users browsing this forum: DavinVicy, DerikFent, JerodSa and 14 guests