-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver_data.h
78 lines (68 loc) · 1.61 KB
/
server_data.h
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
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef _SERVER_DATA_H
#define _SERVER_DATA_H
#include <stdbool.h>
#include "common.h"
#include "client.h"
#include "paikka.h"
enum pup_tyypit {
PUP_SPEED = 0,
PUP_COOL,
PUP_IMMORTAL,
PUP_DESTROY,
PUP_FREEZE,
PUP_PASS_WALLS,
PUP_TYYPIT,
};
static int nappauspisteet[PUP_TYYPIT] __attribute__((unused)) = {
[PUP_SPEED] = 200,
[PUP_COOL] = 50,
[PUP_IMMORTAL] = 10,
[PUP_DESTROY] = 10,
[PUP_FREEZE] = 500,
[PUP_PASS_WALLS] = 10,
/* [PUP_SPEED] = 20000,
[PUP_COOL] = 500000,
[PUP_IMMORTAL] = 1000000,
[PUP_DESTROY] = 100000,
[PUP_FREEZE] = 5000000,
[PUP_PASS_WALLS] = 100000,
*/
};
struct alus_server_data {
int id;
int oma;
struct paikka p;
/* TODO: Check where these are used */
struct paikka coll_min;
struct paikka coll_max;
float suunta;
int nopeus;
float pituus;
float leveys;
bool rikki;
};
struct powerup_server_data {
int koko;
struct paikka p;
int tyyppi;
int nappauspisteet;
};
struct areena_server_data {
struct timespec last_server_update_c; /* Time when client got this data */
struct timespec last_server_update; /* Client should ignore these times */
/*
* TODO: Should we put the client update timestamps directly in correct
* 'alus' struct ?
*/
struct timespec last_client1_update; /* TODO: Split server specifics out */
struct timespec last_client2_update; /* TODO: Split server specifics out */
bool initialized;
unsigned pisteet_id1;
unsigned pisteet_id2;
int alusten_maara;
struct alus_server_data alukset[ALUKSET_MAX];
int active_pups;
struct powerup_server_data pups[MAX_PUPS];
};
void client_get_serverdata(struct client *c, struct areena_server_data *d);
#endif