DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T p

⟦fdfcb8dd5⟧ TextFile

    Length: 1250 (0x4e2)
    Types: TextFile
    Names: »playerlist.c«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦526ad3590⟧ »EUUGD11/gnu-31mar87/X.V10.R4.tar.Z« 
        └─⟦2109abc41⟧ 
            └─ ⟦this⟧ »./X.V10R4/xtrek/watch/playerlist.c« 

TextFile


#include <X/Xlib.h>
#include <stdio.h>
#include <math.h>
#include <signal.h>
#include "defs.h"
#include "struct.h"
#include "data.h"
#include "bitmaps.h"

Window playerw;
extern Window w;
extern Font dfont;
extern FontInfo *dfontinfo;

char teamlet[] = {'X', 'F', 'R', 'X', 'K', 'X', 'X', 'X', 'O'};

playerlist()
{
    register int i;
    register int k = 0;
    char buf[BUFSIZ];
    register struct player *j;
    XEvent foo;

    playerw = XCreateWindow(w, 10, 10, 63 * dfontinfo->width,
	(MAXPLAYER + 3) * dfontinfo->height, 2, foreTile, backTile);
    XMapWindow(playerw);
    sprintf(buf, " # Team Name             Login       x      y    dir spd kills");
    XText(playerw, 0, dfontinfo->height, buf,
       strlen(buf), dfont, textColor, backColor);
    k = 2;
    for (i = 0, j = &players[i]; i < MAXPLAYER; i++, j++) {
	if (j->p_status != PALIVE)
	    continue;
	sprintf(buf, " %1x  %1c   %-16s %-8s %6d %6d %3d %3d %5.2f",
	    j->p_no,
	    teamlet[j->p_team],
	    j->p_name,
	    j->p_login,
	    j->p_x,
	    j->p_y,
	    j->p_dir,
	    j->p_speed,
	    j->p_kills);
	XText(playerw, 0, dfontinfo->height * k++, buf, strlen(buf),
	   dfont, textColor, backColor);
	XFlush();
    }
    XNextEvent(&foo);
    XDestroyWindow(playerw);
}