File: netserv.h

package info (click to toggle)
netmaze 0.81%2Bjpg0.82-14.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,208 kB
  • ctags: 915
  • sloc: ansic: 8,277; tcl: 1,223; makefile: 66; sh: 26
file content (83 lines) | stat: -rw-r--r-- 1,926 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*****************
 * exmenu controll
 */

enum { MENU_NOP , MENU_LOADMAZE , MENU_RUNGAME , MENU_STOPGAME , MENU_LIST ,
       MENU_DISCONNECT , MENU_SETMODE , MENU_SETDIVIDER , MENU_ERROR ,
       MENU_RUNTEAMGAME , MENU_SETTEAMS };

/**********************************************
 * new structures
 * they are replacing the old slot-struct ...
 */

struct cqueue;
struct pqueue;
struct gqueue;

/* player */
struct pqueue
{
  struct cqueue *connection; /* connection */
  struct gqueue *group;      /* group */
  struct pqueue *cnext; /* connection chain */
  struct pqueue *gnext; /* group chain */
  struct pqueue *clast; /* connection chain */
  struct pqueue *glast; /* group chain */
  struct pqueue *nextgf; /* group-first-chain */
  char name[MAXNAME+1];
  char comment[MAXCOMMENT+1];
  int  mode; /* player/cam */
  int  playing;
  int  joydata;
  int  cnumber; /* connectionnumber: (client) */
  int  number;  /* game number */
  int  groupnumber;
  int  team;
  int  master;
  int  checked; /* only checked players can receive personal messages */
};

/* connections */
struct cqueue
{
  struct cqueue *next; /* global chain */
  struct cqueue *last; /* global chain */
  struct pqueue *players; /* player-chain on the connection */
  int plnum; /* number of players from this connection */
  int mode; /* flags */
  int socket;
  unsigned int lasttick;
  struct sockaddr remoteaddr;  /* remote socket address */
  char hostname[256];
  int response;
};

/* groups */
struct gqueue
{
  struct gqueue *next;
  char groupname[16];
  int groupno;
  int numplayers; /* numplay */
  int mode;
  struct pqueue *first;
  int gameflag;
  int playing;
  int gamemode;
  int numgamers; /* number of PLAYING players */
  int numjoy;
  int numwait;
  int response;
  int numteams;
  int timeout;
  int divider;
  int dividercnt;
  MAZE maze;
  int nomaze;
};

#define PLAYING 1
#define SINGLEPLAYER 2
#define SINGLECAMERA 4