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
|