Send Var to room

Post here all your questions related with beta SmartFoxServer API, such as Shockwave, Ajax ...

Moderators: Lapo, Bax

dfr0st
Posts: 3
Joined: 03 May 2011, 08:41
Location: Netherlands

Send Var to room

Postby dfr0st » 28 Nov 2012, 20:19

Is there a way to puch a var to a room.

We want to show the song that is now plaing on the radio.
Now a have script that checks a certain webpage if a new song is being played.
We do that every 5 seconds. But the webpage that we check offerd that they
can also push it us when a new song is started.

So can we push a var into a room bij a http request:

Something like:
http://127.0.0.1:8080/?room=1&songid=45563
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Send Var to room

Postby rjgtav » 28 Nov 2012, 21:12

Hi,

I'm not very familiar with this kind of behaviours, but I think that the best option is to use a server-side extension, with a Java-based Push Notification API, which monitors those webpages and then updates the rooms.
If you don't want to dig into Java Extensions, you can also use Java Objects on ActionScript Extensions, as explained here.
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.
dfr0st
Posts: 3
Joined: 03 May 2011, 08:41
Location: Netherlands

Re: Send Var to room

Postby dfr0st » 08 May 2013, 10:22

Funny, 1,5 year later, different project still the same question. Is there a simple way to push vars to the SFS.

Now we want that users can send a textmessage, ik don't want to check a URL every X second's. When a text is received
the service provider can send it to an url like:
http://sfs.com/?number=423423423&text=that is so cool

Is there a way on the SFS side to realize this?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Send Var to room

Postby rjgtav » 12 May 2013, 22:39

Hello again, sorry for the delay on the response.

SFS comes with the Jetty Webserver, which I think you can create a Servlet to listen to those requests, and then dispatch a signal to SFS.
You can find some posts regarding servlet interaction with SFS here:
viewtopic.php?f=1&t=4513&p=18839&hilit=servlet#p18839
viewtopic.php?f=1&t=4237&p=17774&hilit=servlet#p17774
viewtopic.php?f=1&t=1949&p=7903&hilit=servlet#p7903

Hope this helps
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.

Return to “Other Client API”

Who is online

Users browsing this forum: No registered users and 2 guests