Page 1 of 1

submitting game results to web CGI

Posted: 17 Apr 2014, 04:33
by zgames
what would be a good way to go about sending information to a website during and after a game? things like units used, damage done, and who one to a script to be placed in a database.
would a LUA script work, or is that something that would need to be coded into the engine it's self?

Re: submitting game results to web CGI

Posted: 17 Apr 2014, 04:59
by SinbadEV
There are people who can explain better than me but the short answer is it can be done in Lua.

http://springrts.com/wiki/Lua_Socket

Re: submitting game results to web CGI

Posted: 17 Apr 2014, 06:54
by Funkencool
I believe most games already do this to some extant with some help from the lobbies. I don't know much about it but I think lua collects stats and saves them, then the lobby/autohost will send those to the server. Pretty much the same way the replays are handled.

Re: submitting game results to web CGI

Posted: 17 Apr 2014, 06:57
by knorke
What is currently done is to have the data in the replay and have the webpage read it from there.
That is how awards currently work:
http://replays.springrts.com/replay/e42 ... 497174d8b/
(click "Show Winners" to see, at bottom)
is discussed here a bit:
http://springrts.com/phpbb/viewtopic.ph ... 20#p555473

Re: submitting game results to web CGI

Posted: 17 Apr 2014, 15:07
by zgames
Funkencool wrote:I believe most games already do this to some extant with some help from the lobbies. I don't know much about it but I think lua collects stats and saves them, then the lobby/autohost will send those to the server. Pretty much the same way the replays are handled.
I know for sure ZK is compatible since it has a persistent game that runs based on the results. it's proprietary and mostly on their own server though.(at least,from what I heard from the chat)

I could handle logging and stuff myself, probably with PHP or something but actually getting the data there is a new topic for me

Re: submitting game results to web CGI

Posted: 17 Apr 2014, 16:13
by Anarchid
it's proprietary and mostly on their own server though.(at least,from what I heard from the chat)
That entire stuff is GPL2, feel free to browse here.

Mostly it works via autohost.

Re: submitting game results to web CGI

Posted: 17 Apr 2014, 16:31
by zgames
Anarchid wrote:
it's proprietary and mostly on their own server though.(at least,from what I heard from the chat)
That entire stuff is GPL2, feel free to browse here.

Mostly it works via autohost.
I mean the game that's based on the results. the engine it's self I could delve in if I had sufficient time to read it.

Re: submitting game results to web CGI

Posted: 17 Apr 2014, 17:13
by Anarchid
Do you mean PlanetWars? No, none of that stuff is proprietary.

Note i'm not talking about engine (spring), but about zk code (planetwars, springie, etc).

The link above doesn't point to a spring github repo, it's a link to zk googlecode repo.

Re: submitting game results to web CGI

Posted: 17 Apr 2014, 17:18
by zgames
Anarchid wrote:Do you mean PlanetWars? No, none of that stuff is proprietary.

Note i'm not talking about engine (spring), but about zk code (planetwars, springie, etc).

The link above doesn't point to a spring github repo, it's a link to zk googlecode repo.
oh! it must have been the way I worded my question then. they probably thought I meant the machine or something. *facepalm*

Re: submitting game results to web CGI

Posted: 19 Apr 2014, 11:08
by Google_Frog
The ZK system also sends information to the game. Players make commands loadouts on a website and then choose one ingame. It also sends awards gained at the end of the game to be counted on the site.

This is mostly done by the bots which host the battles. They communicate with the website and are able to set modoptions and have data sent to them via chat messages from lua. To use this method you will need a server to run the autohosts.

I don't have experience with Lua Socket but it looks like it should do what you want and with less infrastructure required.

Re: submitting game results to web CGI

Posted: 20 Apr 2014, 00:18
by zgames
it would be cool to have a streamlined version of that,with automation. I'd have to be able to get Spring to quickly communicate with the outside world, as no play wants to wait 5 minutes to get a list of persistent buildings, which map should be selected,etc just because a blocking socket is used :)