Using some AMFPHP function on the server's Side

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

Moderators: Lapo, Bax

Post Reply
Francois
Posts: 35
Joined: 15 Mar 2006, 14:00

Using some AMFPHP function on the server's Side

Post by Francois »

Hi there,

I have two new questions for ya:

For some statistics purposes I'd like to know if it's possible to call an AMFPHP function server side...

The other question is still about statistics:

What does the log files records (except errors)... We'd like to have a very concise feedback about the behaviour of the users, the number of rooms, the average length of a gameplay and so on...

Is there a tool to parse thoses logs... (Can we use a common log analysis software...)


In other words do we have more docs about the logs,

thanks for your help


-François-
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Post by Virusescu »

I don't know the answer for the frist question.
But maybe this will help you.
What does the log files records (except errors)... We'd like to have a very concise feedback about the behaviour of the users, the number of rooms, the average length of a gameplay and so on...

Is there a tool to parse thoses logs... (Can we use a common log analysis software...)
Besides the errors the log files records any trace output when it's called.

For logging purposes you can use the _server.writeFile() function and create your own logs.
I, for instance, made a special log with cheating attempts. Actions called when they are not supposed to will trigger the user disconection and will be recorded in an cheaters.log file on the server with user name, IP, server hour and cheating attempt description.
You can make your own file format and then it will be easy building a tool to parse it. You could write for example a xml file structure and parse it with a flash swf :).
OR, you could write info about games and users behaviours in a database. It all comes up to what you can handle easier.

Cheers.
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Hi,
For some statistics purposes I'd like to know if it's possible to call an AMFPHP function server side...
in order to call a remoting service you should be able to send AMF formatted messages over HTTP from your extension.
SmartFoxServer of course does not provide that out of the box, as it's a very particular option. However I think it's definitely possible.

You can develop your extensions in Java or Actionscript or even use any Java class with your AS code. With this in mind you could use an open-source Java implementation of the AMF format and use it to communicate with your remoting services.

Here's a library you could use http://sourceforge.net/projects/openamf/
Is there a tool to parse thoses logs... (Can we use a common log analysis software...)
The logs produced by SFS are not intended for statistics recording. We did this intentionally as each application can be very different and require completely different statistic informations.
The logs provide a fine-grained set of messages that show the server activity, possibile problems and debug messages that can be helpful for developers.

As Virusescu suggested you could easily implement your own stats by saving them in files or better to a database.

Maybe we'll provide a generic stats module in one of the next releases that keeps track of basic informations like logins, visits, traffic stats etc...
Lapo
--
gotoAndPlay()
...addicted to flash games
mnkyhead
Posts: 13
Joined: 10 May 2006, 14:59
Location: Maine, USA
Contact:

Logging chat messages

Post by mnkyhead »

So what about logging chat messages? I am new to SFS, our current chat app uses Unity as the server, and I am looking to switch to a new server because Unity is not that easy to program for. I like what I see in SFS. Since our client caters to children, they are really adiment about logging all of the chat session. Currently I am using flash remoting and coldfusion to log the chat seesions from the client side, but it is slowing down the chat app when there are mamy people on. would it be fairly simple to log the chat sessions usinf _server.writeFile()? Can it be done on the server side, or would it have to be done client side?
Thanks
Russ
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Post by Virusescu »

_server.writeFile() can be used only on server side BUT you will need to bypass the sendPublicMessage and write your own method on the server in order to catch the messages and write them on the server.
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Code: Select all

and I am looking to switch to a new server because Unity is not that easy to program for.
Yep, I see. SmartFoxServer allows you to easily create server side logic using Actionscript (and Java if you wish)

About logging messages, we've added a new server side event that allows the developer to catch all the public messages sent by the clients.
This way you don't have to create an alternative server side command to catch those messages.

Once you get these messages you can decide if you want to store them in a plain file or (better) into a database (better performance)

The new feature is not yet publicly available but you can contact us directly if you wish to experiment with it.

We'll probably publish a beta version soon with a few other interesting enhacements.

Of course the new feature will also be part of the next SmartFoxServer release.

:)
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply