Jump to content

server stats sttings


PVI_Eagle

Recommended Posts

Hi,

 

using Lua you can get a lot of player info/stats from the server.lua and events.lua files in the /Scripts/net/ folder. Take a look at the readme.txt in that folder, it explains the functions you can use to do so. This is probably easier than editing export.lua, because you always get the ID of a player who is responsible for a certain event.

Link to comment
Share on other sites

Hi Eagle,

 

afaik there is no tutorial on how to use the networking scripts, there are only tutorials for export.lua (see the Dev's journal and the wiki). Obviously, the prerequisite is that you know the basics of the Lua programming language, if you do not have that you need to start learning it first. After you mastered the basics you can edit the event handlers in those /net scripts to gather/store the required stats and, assuming that you want to display them on a website, send them to your webserver in regular intervals (e.g. after each mission), which needs to run a script (for example written in PHP) to process the data. This script will probably store the data in a file/database, which is read by another script that viewers of your stats page invoke. To send data via HTTP/POST you can use the LuaSocket (http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/) library. See the parts of the ServMan mod that downloads a masterbanlist from a remote webserver, it gives you an example of how to set up LuaSocket.

 

HTH

Acedy


Edited by Acedy
Link to comment
Share on other sites

  • 2 weeks later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...