File: gt2aServer.h

package info (click to toggle)
openmohaa 0.82.1%2Bdfsg-1
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 34,192 kB
  • sloc: cpp: 315,720; ansic: 275,789; sh: 312; xml: 246; asm: 141; makefile: 7
file content (65 lines) | stat: -rw-r--r-- 1,526 bytes parent folder | download | duplicates (2)
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
/*
GameSpy GT2 SDK
GT2Action - sample app
Dan "Mr. Pants" Schoenblum
dan@gamespy.com

Copyright 2000 GameSpy Industries, Inc

*/

#ifndef _GT2ASERVER_H_
#define _GT2ASERVER_H_

#define MAX_CLIENTS            MAX_PLAYERS

typedef struct Client
{
	GT2Bool used;              // If this slot is in use or not.
	int index;                // This client's clientIndex.
	GT2Connection connection;  // The GT2Connection for this client.
	V2f position;             // The current position (0 <= x,y < MAP_MAX).
	float rotation;           // Client's view angle (0 <= rotation < 360).
	int motion;               // Client's current motion (STILL, FORWARD, BACKWARD).
	int turning;              // Client's current turning direction (STILL, LEFT, RIGHT).
	unsigned long lastUpdate; // Last update received from this client.
	char nick[MAX_NICK];      // The client's nick.
	int score;                // The client's score.
	GT2Bool dead;              // True if this client was killed and not respawned.
	unsigned long spawnTime;  // If dead, spawn at this time.
	unsigned long lastPress;  // When the last press event was received.
	int numAsteroids;         // The number of asteroids being held by this player.
} Client;

extern Client clients[MAX_CLIENTS];

GT2Bool InitializeServer
(
	void
);

void ServerThink
(
	unsigned long now
);

void SendSound
(
	int sound,
	int sendClient
);

void SendNumAsteroids
(
	int total,
	int sendClient
);

void BroadcastText
(
	const char * message,
	int exceptIndex,
	GT2Bool reliable
);

#endif