room to room talk

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

Moderators: Lapo, Bax

u007
Posts: 18
Joined: 04 Sep 2009, 11:22

room to room talk

Postby u007 » 17 Nov 2009, 05:14

Hi,

Im currently having 2 different extension for a game.
1 main room lobby and zone is handled by a java extension ,
while 1 game room is handled by a as/js based extension.

What i need now is communication between the 2 extension.
I've think of using sending public message to the main room, and awaits for the zone extension to send back an public message to game room extension..
is it possible?
Anyone can shade some sample codes i can use?
thank you so much in advanced...
sritej
Posts: 27
Joined: 17 Jul 2009, 10:24
Location: Hyderabad
Contact:

Postby sritej » 17 Nov 2009, 08:37

Hello,

Code: Select all

I've think of using sending public message to the main room, and awaits for the zone extension to send back an public message to game room extension..
is it possible?


you can directly communicate with the zone level extension from the Game Room, but not vice versa, and the communication is same as that of you do with the room level extension from the Game Room. No need of sending any private messages.

If you talk about the chat between users in two different rooms, private message server better, as it needs only the user id, no need of any room id and all you need is the user id you want to chat with.

sritej.
u007
Posts: 18
Joined: 04 Sep 2009, 11:22

how?

Postby u007 » 17 Nov 2009, 12:15

Hi Sritej,

How do i do that?
I tried _server.getCurrentZone().myfunction(param)... it failed :(
i even tried _server.myfunction(param)... missing function 2...
sritej
Posts: 27
Joined: 17 Jul 2009, 10:24
Location: Hyderabad
Contact:

Postby sritej » 18 Nov 2009, 02:40

Hello

Code: Select all

I tried _server.getCurrentZone().myfunction(param)

Please follow the action script api if you use action script extension files.

http://www.smartfoxserver.com/docs/docP ... /index.htm

_server.getCurrentZone() Returns a zone object through which u cannaot make a call of your own function, rather only the functions from zone class can be called.

Use smartFoxObject.sendXtMessage() to send request to the extension that you are using either the room extension or the zone extension.

Use smartFoxObject.sendPrivateMessage(message, UserId) to send a private message to the user. These both methods can be used from the client side application.
u007
Posts: 18
Joined: 04 Sep 2009, 11:22

server to server

Postby u007 » 18 Nov 2009, 03:37

by the way, im looking for extension to extension communication.
not flash to extension.
That 1, i know.
sritej
Posts: 27
Joined: 17 Jul 2009, 10:24
Location: Hyderabad
Contact:

Postby sritej » 18 Nov 2009, 03:53

ok :D

please follow this post..

viewtopic.php?t=6151

you were mentioning about private messages.. so , happend to give these methods to you. any ways, extension to extesnion communication can be done like this also i guess, but with proper care..

Thank you
u007
Posts: 18
Joined: 04 Sep 2009, 11:22

no, not that way...

Postby u007 » 18 Nov 2009, 04:45

Thats initiating new instance of the sub classes to handle the request...
What i need is reusing existing classes and calling those function within the zone from the room extension...
u007
Posts: 18
Joined: 04 Sep 2009, 11:22

i found something :)

Postby u007 » 18 Nov 2009, 05:00

i found this in the doc:
http://www.smartfoxserver.com/docs/docP ... bility.htm

yes, thats probably what i needed :D
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 19 Nov 2009, 07:50

Yes, that document explains how to enable communication between extensions
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 13 guests