|
Atrinik Server 2.5
|
#include <global.h>Go to the source code of this file.
Functions | |
| void | statistics_init () |
| void | statistic_update (const char *type, object *op, sint64 i, const char *buf) |
| void | statistics_player_logout (player *pl) |
Variables | |
| static int | fd = -1 |
| static struct sockaddr_in | insock |
Handles player statistics.
Many statistics are currently cached in the player's structure as uint64 for performance reasons, as it's not very efficient to send a statistic update each time the player plays for another second, or casts a spell, or regenerates some health/mana/grace. Thus, such statistics are only updated in statistics_player_logout(), which is called when the player logs out.
Definition in file statistics.c.
| void statistic_update | ( | const char * | type, |
| object * | op, | ||
| sint64 | i, | ||
| const char * | buf | ||
| ) |
Update a particular statistic of a player.
| type | The statistic type - a string that will be recognized by the statistics server and stored appropriately. |
| op | The player. |
| i | Integer value to store. If 0, will not do any updating. |
| buf | Optional string buffer to send. |
Definition at line 76 of file statistics.c.
| void statistics_init | ( | ) |
Initialize statistics; sets up the datagram file descriptor, etc.
Definition at line 46 of file statistics.c.
| void statistics_player_logout | ( | player * | pl | ) |
Handle player logging out, in order to update cached statistics from the player's data structure.
| pl | The player. |
Definition at line 105 of file statistics.c.
int fd = -1 [static] |
File descriptor used for sending datagrams.
Definition at line 40 of file statistics.c.
struct sockaddr_in insock [static] |
Destination address.
Definition at line 42 of file statistics.c.
1.7.4