2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-11-22 09:57:21 +01:00
hlsdk-xash3d/cl_dll/hud_servers_priv.h

98 lines
2.1 KiB
C
Raw Normal View History

2018-01-19 18:00:32 +01:00
//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============
2016-06-04 15:24:23 +02:00
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#if !defined( HUD_SERVERS_PRIVH )
#define HUD_SERVERS_PRIVH
#pragma once
#include "netadr.h"
class CHudServers
{
public:
typedef struct request_s
{
struct request_s *next;
2016-07-03 15:39:55 +02:00
netadr_t remote_address;
int context;
2016-06-04 15:24:23 +02:00
} request_t;
typedef struct server_s
{
2016-07-03 15:39:55 +02:00
struct server_s *next;
netadr_t remote_address;
char *info;
int ping;
2016-06-04 15:24:23 +02:00
} server_t;
CHudServers();
~CHudServers();
void Think( double time );
void QueryThink( void );
2016-07-03 15:39:55 +02:00
int isQuerying( void );
2016-06-04 15:24:23 +02:00
2016-07-03 15:39:55 +02:00
int LoadMasterAddresses( int maxservers, int *count, netadr_t *padr );
2016-06-04 15:24:23 +02:00
void RequestList( void );
void RequestBroadcastList( int clearpending );
void ServerPing( int server );
void ServerRules( int server );
void ServerPlayers( int server );
void CancelRequest( void );
2016-07-03 15:39:55 +02:00
int CompareServers( server_t *p1, server_t *p2 );
2016-06-04 15:24:23 +02:00
void ClearServerList( server_t **ppList );
void ClearRequestList( request_t **ppList );
void AddServer( server_t **ppList, server_t *p );
void RemoveServerFromList( request_t **ppList, request_t *item );
request_t *FindRequest( int context, request_t *pList );
2016-07-03 15:39:55 +02:00
int ServerListSize( void );
2016-06-04 15:24:23 +02:00
char *GetServerInfo( int server );
2016-07-03 15:39:55 +02:00
int GetServerCount( void );
2016-06-04 15:24:23 +02:00
void SortServers( const char *fieldname );
void ListResponse( struct net_response_s *response );
void ServerResponse( struct net_response_s *response );
void PingResponse( struct net_response_s *response );
void RulesResponse( struct net_response_s *response );
void PlayersResponse( struct net_response_s *response );
private:
server_t *GetServer( int server );
//
2016-07-03 15:39:55 +02:00
char m_szToken[1024];
int m_nRequesting;
int m_nDone;
2016-06-04 15:24:23 +02:00
2016-07-03 15:39:55 +02:00
double m_dStarted;
2016-06-04 15:24:23 +02:00
request_t *m_pServerList;
request_t *m_pActiveList;
2016-07-03 15:39:55 +02:00
server_t *m_pServers;
2016-06-04 15:24:23 +02:00
2016-07-03 15:39:55 +02:00
int m_nServerCount;
2016-06-04 15:24:23 +02:00
2016-07-03 15:39:55 +02:00
int m_nActiveQueries;
int m_nQuerying;
double m_fElapsed;
2016-06-04 15:24:23 +02:00
2016-07-03 15:39:55 +02:00
request_t *m_pPingRequest;
request_t *m_pRulesRequest;
request_t *m_pPlayersRequest;
2016-06-04 15:24:23 +02:00
};
2016-07-03 15:39:55 +02:00
#endif // HUD_SERVERS_PRIVH