OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
gt2aClient.h
1/*
2GameSpy GT2 SDK
3GT2Action - sample app
4Dan "Mr. Pants" Schoenblum
5dan@gamespy.com
6
7Copyright 2000 GameSpy Industries, Inc
8
9*/
10
11#ifndef _GT2ACLIENT_H_
12#define _GT2ACLIENT_H_
13
14#include "gt2aMath.h"
15#include "gt2aLogic.h"
16
17#define UPDATE_HISTORY_LEN 250
18
19typedef struct Player
20{
21 GT2Bool used; // If this slot is in use or not.
22 V2f position; // The current position (0 <= x,y < MAP_MAX).
23 float rotation; // Client's view angle (0 <= rotation < 360).
24 int motion; // The client's current motion (STILL, FORWARD, BACKWARD).
25 int turning; // The client's current tunring direction (STILL, LEFT, RIGHT).
26 char nick[MAX_NICK]; // The client's nick.
27 int score; // The client's score.
28 GT2Bool dead; // True if this client is currently dead.
29 float roll; // How much to roll them (-1->0->1).
30} Player;
31
32typedef struct CObject
33{
34 GT2Bool used; // If this slot is in use or not.
35 ObjectType type; // The type of object.
36 V2f position; // The object's position.
37 float rotation; // The object's rotation.
38 unsigned long totalTime; // The amount of time this object has existed.
39} CObject;
40
41typedef struct UpdateInfo
42{
43 int diff; // Time since the last update was received.
44 int len; // Length of the update, in bytes.
46
47extern float localRotation;
48extern char serverAddress[128];
49extern int localMotion;
50extern int localTurning;
51extern Player players[MAX_PLAYERS];
52extern GT2Bool connected;
53extern int localIndex;
54extern unsigned long lastServerUpdate;
55extern char localNick[MAX_NICK];
56extern CObject cObjects[MAX_OBJECTS];
57extern UpdateInfo updateHistory[UPDATE_HISTORY_LEN];
58extern int updateHistoryStart;
59extern int ClientNumAsteroids;
60
61// Stats.
63extern int reliableBytesSentClient;
64extern int reliableBytesReceivedClient;
65extern int unreliableBytesSentClient;
66extern int unreliableBytesReceivedClient;
67extern int reliableMessagesSentClient;
68extern int reliableMessagesReceivedClient;
69extern int unreliableMessagesSentClient;
70extern int unreliableMessagesReceivedClient;
71
72GT2Bool InitializeClient
73(
74 void
75);
76
77void ClientThink
78(
79 unsigned long now
80);
81
82void SendPress
83(
84 const char * value
85);
86
87void SendChat
88(
89 const char * message
90);
91
92#endif
Definition player.h:127
Definition gt2aClient.h:33
Definition gserverlist.c:94