How to use php with sfs2X?

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

Moderators: Lapo, Bax

liverol
Posts: 31
Joined: 15 Jul 2009, 23:49

How to use php with sfs2X?

Postby liverol » 14 Dec 2012, 06:54

I want to use php/webpage to show the server status,like zone users number,health or something like that,how i can get this data using php/webpage??
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Re: How to use php with sfs2X?

Postby ThomasLund » 15 Dec 2012, 17:21

You can code a small servlet / jsp page / extension to show data

Cant remember if there is anything in the docs about this. Try to take a look in the main forums, as this isnt a Unity question really
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to use php with sfs2X?

Postby Lapo » 18 Dec 2012, 08:42

PHP is not supported by SFS2X.

There are four ways to accomplish what you ask:
1) Use the internal SFS2X webserver which runs regular Java and Python servlets. We have an example of a Python servlet under the {SFS2X}/www/example/ folder.

2) Add a small Extension on the server side that stores the current amount of users in a database table every 1 minute. Then you can read that value from any other webpage (even using PHP) and publish it.

3) Create a small Flash widget that directly access the server and retrieves the value via an Extension call, and embed it in your page

4) Same as above but use the HTML5 API.
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 77 guests