remove references to glide in master
[carveJwlIkooP6JGAAIwe30JlM.git] / gameserver.h
1 #ifndef GAMESERVER_H
2 #define GAMESERVER_H
3
4 #define VG_SERVER
5
6 #include "vg/vg.h"
7 #include "vg/vg_steam.h"
8 #include "vg/vg_steam_networking.h"
9 #include "vg/vg_steam_http.h"
10 #include "vg/vg_steam_auth.h"
11 #include "network_msg.h"
12 #include "network_common.h"
13 #include "highscores.h"
14 #include <sys/socket.h>
15
16 #define CLIENT_KNOWLEDGE_SAME_WORLD0 0x1
17 #define CLIENT_KNOWLEDGE_SAME_WORLD1 0x2
18 #define CLIENT_KNOWLEDGE_FRIENDS 0x4 /* TODO? */
19
20 struct {
21 HSteamNetPollGroup client_group;
22 EServerMode auth_mode;
23
24 struct gameserver_client {
25 int active;
26 u32 version;
27 int authenticated;
28 HSteamNetConnection connection;
29 char username[ NETWORK_USERNAME_MAX ];
30
31 u8 instance;
32
33 struct gameserver_item {
34 char uid[ADDON_UID_MAX];
35 u32 hash;
36 }
37 items[k_netmsg_playeritem_max];
38
39 char region[ NETWORK_REGION_MAX ];
40 u32 region_flags;
41
42 u64 steamid;
43 }
44 clients[ NETWORK_MAX_PLAYERS ];
45
46 u8 client_knowledge_mask[ (NETWORK_MAX_PLAYERS*(NETWORK_MAX_PLAYERS-1))/2 ];
47 u8 app_symmetric_key[ k_nSteamEncryptedAppTicketSymmetricKeyLen ];
48
49 /* TODO: Consider removing this */
50 int monitor_fd;
51 int monitor_clients[ 4 ];
52 }
53 static gameserver = {
54 .auth_mode = eServerModeAuthentication
55 };
56
57 static ISteamNetworkingSockets *hSteamNetworkingSockets = NULL;
58
59 #endif /* GAMESERVER_H */