115 |
|
} td; |
116 |
|
typedef struct { |
117 |
|
uint16_t PlayerNum; |
118 |
< |
Vector3 Position; |
119 |
< |
float Facing; |
120 |
< |
float DesiredFacing; |
118 |
> |
//Vector3 Position; |
119 |
> |
|
120 |
> |
//float Facing; |
121 |
> |
//float DesiredFacing; |
122 |
> |
|
123 |
> |
float UD; |
124 |
> |
float LR; |
125 |
> |
|
126 |
|
uint32_t Health; |
127 |
|
uint32_t MaxHealth; |
128 |
|
//input_struct Inputs; |
134 |
|
int Damage; |
135 |
|
int Deaths; |
136 |
|
uint16_t Ping; |
137 |
+ |
|
138 |
|
} player_data; |
139 |
|
|
140 |
|
//todo, move health in... |
151 |
|
} flatline_event; |
152 |
|
|
153 |
|
typedef struct { |
154 |
+ |
int16_t PlayerNum; |
155 |
|
float MouseDeltaX; |
156 |
|
float MouseDeltaY; |
157 |
|
uint32_t Actions1; |
158 |
|
uint32_t Actions2; |
159 |
+ |
float Facing; |
160 |
+ |
float DesiredFacing; |
161 |
+ |
Vector3 Position; |
162 |
|
} player_input; |
163 |
|
|
164 |
|
//used for storing data about each player |
219 |
|
}; |
220 |
|
|
221 |
|
|
222 |
+ |
typedef struct { |
223 |
+ |
//Server Only |
224 |
+ |
bool PleaseUpdateAllPlayers; |
225 |
+ |
//Client stuff (can be used by server "client") |
226 |
+ |
|
227 |
+ |
//Move from random scattered bools to these, please. |
228 |
+ |
bool ClientConnected; |
229 |
+ |
unsigned int ClientSlot; |
230 |
+ |
bool ServerStatus; |
231 |
+ |
} multiplayer_status; |
232 |
|
|
233 |
|
enum { |
234 |
|
STATE_ALIVE, |
246 |
|
Character* Chr; |
247 |
|
uint16_t spawnnumber; |
248 |
|
uint16_t list_slot; |
249 |
+ |
|
250 |
+ |
//Todo: move into struct for slightly faster copying |
251 |
|
float MouseDeltaX; |
252 |
|
float MouseDeltaY; |
253 |
|
uint32_t Actions1; |
254 |
|
uint32_t Actions2; |
255 |
+ |
float Facing; |
256 |
+ |
float DesiredFacing; |
257 |
+ |
//float Height; |
258 |
+ |
Vector3 Position; |
259 |
+ |
|
260 |
|
unsigned int LastInputTime; |
261 |
|
input_struct CacheInput; |
262 |
|
player_data player_data; |
268 |
|
int DeathTime; |
269 |
|
uint32_t Ping; |
270 |
|
bool DataApplied; |
271 |
+ |
|
272 |
+ |
uint32_t ShapeshiftCooldown; |
273 |
|
} player_info; |
274 |
|
|
275 |
|
player_info * FLr_FindEmptySlot(); |
288 |
|
extern sockaddr_in address; |
289 |
|
extern player_info Players[]; |
290 |
|
extern player_info * PlayerList[]; |
291 |
< |
|
291 |
> |
extern multiplayer_status MultiplayerStatus; |
292 |
|
int UDPServer_SendToAll(void* packet, int size); |
293 |
|
|
294 |
|
extern bool client_connected; |
299 |
|
void FLrPlayerDisconnect( int Player ); |
300 |
|
void FLrPlayerRespawn( int Player ); |
301 |
|
int FLrEvent_GetNumArgs( int eventIndex ); |
302 |
< |
|
302 |
> |
bool FlatlineInitialize(); |
303 |
|
extern unsigned int lastPingTime; |
304 |
|
#endif |