1 /* $Id: ogcache-client.h,v 1.2 2005-03-27 01:31:50 stpohle Exp $
2  * include file for the opengamesrv.c file
3  */
4 
5 #ifndef _OGCACHE_CLIENT_H
6 #define _OGCACHE_CLIENT_H
7 
8 #define MAX_OGC_ENTRYS 255
9 #define UDP_DEFAULTPORT "11111"
10 #define LEN_OGCHOST 64
11 #define LEN_OGCPORT 10
12 #define LEN_GAME 32
13 
14 #ifndef LEN_VERSION
15 	#define LEN_VERSION 20
16 #endif
17 
18 #define LEN_STATUS 6
19 #define LEN_GAMENAME 32
20 #define BUF_SIZE 1024
21 
22 struct game_entry {
23 	int serial;
24     char host[LEN_OGCHOST];
25     char port[LEN_OGCPORT];
26 	char game[LEN_GAME];
27 	char version [LEN_VERSION];
28     char gamename[LEN_GAMENAME];
29     int curplayers;
30     int maxplayers;
31     signed char ai_family;
32     char status[LEN_STATUS];
33 };
34 
35 extern struct game_entry ogc_array[MAX_OGC_ENTRYS];
36 extern int ogc_browsing;
37 
38 int ogc_init (char *localport, char *server, char *port, char *game, int ai_family);
39 void ogc_shutdown ();
40 int ogc_loop ();
41 int ogc_sendgamestatus (int sock, char *game, char *version, char *gamename,
42 						int curplayers, int maxplayers, char *status);
43 int ogc_sendgamequit (int sock); /* send that the game quitted */
44 void ogc_browsestart ();
45 void ogc_browsestop ();
46 
47 #endif
48