Not saying they do, just that it's a natural thing. When a game ends, you display stats for all players who played, even those who are no longer there. Asss doesn't support this at all, even with its persistence system, because there is no way to retreive persistence data for a player who isn't connected. Even if there was, the stats moduel still needs to maintain a list of those players who played but have left, so it know who to retreive data for.
I'm still thinking about how I am going to handle this, but it's definitely not an immediate thing.
i88gerbils - Mon Mar 13, 2006 7:54 pm
Post subject:
Hmm.. Smong originally made game persistent data for race.
Smong - Tue Mar 14, 2006 7:04 pm
Post subject:
Ekted since a lot of people will want they kind of stats you described, why don't you see if you can modify asss to enumerate all players in a given interval? If you use interval game it is only supposed to hold records for players that actually have stats, ie: entered the arena during that game period. I suspect all the code you need will be in the dbtool source since it should be able to do that.
i88gerbils if you are referring to my hi-octane race module, that used a txt file (looking at the code again it's a good example how not to make a module, fx: if (strcmp(arena->name, "hio")) return; ). I don't think any of my other race modules saved anything.
i88gerbils - Tue Mar 14, 2006 7:21 pm
Post subject:
No I'm talking about the pdata struct. This added players who entered, but did not remove them when they left. That way when you ran generatestats() it would loop through the record of all players. Though it continue'd out of the loop when it found players marked as "not playing", which could easily be changed for what Mr. Ekted wants (the code snippet below).
if (p->arena != arena) continue;
if (p->p_ship == SHIP_SPEC) continue;
if (p->status != S_PLAYING || (!d->playing)) continue;
if (!d->playing) continue;
|
for instance i was going to use something similar for (as)wz stats such as :
struct {
u8 kills, deaths, tk, fl, steals; /* possibly flagtime, etc ... */
} pdata;
|
Smong - Tue Mar 14, 2006 7:43 pm
Post subject:
I think you misunderstood that bit of code. The d->playing was for players in the arena but not participating in the race (afk, finished race, etc).
I see 'pdata' as an asss convention for per player data. PPDATA is a macro in player.h:
pdata *d = PPDATA(p, pdkey);
The data only exists for as long as the player is in the arena. (It gets zero'd when they enter a new arena).
Anyway, there's nothing stopping you keeping a per arena LinkedList of data for each player that entered. Thinking about that now it would be easier to code than to mess around with the berkely db stuff.
i88gerbils - Tue Mar 14, 2006 7:50 pm
Post subject:
Hmm.. yeah. I had forgotten about pdata as player data zonewide and thought it only arenawide. I suck.
Mr Ekted - Tue Mar 14, 2006 9:05 pm
Post subject:
Grel suggested that I make a module to implement generic player data for games, so that others could use it as well. We'll see what happens when I get to that.
i88gerbils - Wed Mar 15, 2006 3:25 pm
Post subject:
I think it's time to split this thread into the productive part.