X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=gameserver.h;h=00df20e2f0a5570f8b9cba777f2d84e05a6531b0;hb=304647a7672165dd35ffe54884ed9aedcc9bf363;hp=670a9ba089be4debe5a46160d33b0ee6875b934f;hpb=a5cdfe2fc872f03c7988d63498abb7e7827325c1;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/gameserver.h b/gameserver.h index 670a9ba..00df20e 100644 --- a/gameserver.h +++ b/gameserver.h @@ -1,22 +1,49 @@ -#ifndef GAMESERVER_H -#define GAMESERVER_H - +#pragma once #define VG_SERVER -#include "vg/vg.h" + +#include "vg/vg_platform.h" #include "vg/vg_steam.h" #include "vg/vg_steam_networking.h" #include "vg/vg_steam_http.h" #include "vg/vg_steam_auth.h" #include "network_msg.h" -#include "highscores.h" +#include "network_common.h" #include +#define CLIENT_KNOWLEDGE_SAME_WORLD0 0x1 +#define CLIENT_KNOWLEDGE_SAME_WORLD1 0x2 +#define CLIENT_KNOWLEDGE_FRIENDS 0x4 /* TODO? */ + struct { HSteamNetPollGroup client_group; EServerMode auth_mode; + struct gameserver_client { + int active; + u32 version; + int authenticated; + HSteamNetConnection connection; + char username[ NETWORK_USERNAME_MAX ]; + + u8 instance; + + struct gameserver_item { + char uid[ADDON_UID_MAX]; + u32 hash; + } + items[k_netmsg_playeritem_max]; + + char region[ NETWORK_REGION_MAX ]; + u32 region_flags; + + u64 steamid; + } + clients[ NETWORK_MAX_PLAYERS ]; + + u8 client_knowledge_mask[ (NETWORK_MAX_PLAYERS*(NETWORK_MAX_PLAYERS-1))/2 ]; u8 app_symmetric_key[ k_nSteamEncryptedAppTicketSymmetricKeyLen ]; + /* TODO: Consider removing this */ int monitor_fd; int monitor_clients[ 4 ]; } @@ -25,5 +52,3 @@ static gameserver = { }; static ISteamNetworkingSockets *hSteamNetworkingSockets = NULL; - -#endif /* GAMESERVER_H */