use Q4 clan name if it exists

git-svn-id: http://svn.code.sf.net/p/xqf/code/trunk@757 d2ac09be-c843-0410-8b1f-f8a84130e0ec
This commit is contained in:
Ludwig Nussel 2005-10-18 19:26:35 +00:00 committed by l-n
parent b6b40f4c62
commit 50e0503709
2 changed files with 31 additions and 1 deletions

View File

@ -1,3 +1,6 @@
Oct 18, 2005: <l-n@users.sourceforge.net>
- use Q4 clan name if it exists
Oct 17, 2005: <l-n@users.sourceforge.net>
- add x86_64 to statistics page
- fix Q4 master server protocol prefs

View File

@ -453,11 +453,19 @@ static struct player *descent3_parse_player (char *token[], int n, struct server
static struct player *q3_parse_player (char *token[], int n, struct server *s) {
struct player *player = NULL;
char* clan = NULL;
unsigned clanlen = 0;
if (n < 3)
return NULL;
player = g_malloc0 (sizeof (struct player) + strlen (token[0]) + 1);
if(n > 3 && strcmp(token[3], "0"))
{
clan = token[3];
clanlen = strlen(clan)+1;
}
player = g_malloc0 (sizeof (struct player) + strlen (token[0]) + 1 + clanlen);
player->time = -1;
player->frags = strtosh (token[1]);
player->ping = strtosh (token[2]);
@ -467,6 +475,13 @@ static struct player *q3_parse_player (char *token[], int n, struct server *s) {
player->name = (char *) player + sizeof (struct player);
q3_unescape (player->name, token[0]);
// show clan name in model column
if(clan)
{
player->model = (char *) player + sizeof (struct player) + strlen(player->name) + 1;
strcpy(player->model, clan);
}
return player;
}
@ -3259,6 +3274,18 @@ static void quake_save_info (FILE *f, struct server *s) {
p->ping);
break;
case Q4_SERVER:
fprintf (f,
"%s" QSTAT_DELIM_STR
"%d" QSTAT_DELIM_STR
"%d" QSTAT_DELIM_STR
"%s\n",
(p->name)? p->name : "",
p->frags,
p->ping,
p->model?p->model:"0");
break;
default:
fprintf (f,
"%s" QSTAT_DELIM_STR