Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.1 KiB

//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
9 years ago
//
// 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;
9 years ago
netadr_t remote_address;
int context;
9 years ago
} request_t;
typedef struct server_s
{
9 years ago
struct server_s *next;
netadr_t remote_address;
char *info;
int ping;
9 years ago
} server_t;
CHudServers();
~CHudServers();
void Think( double time );
void QueryThink( void );
9 years ago
int isQuerying( void );
9 years ago
9 years ago
int LoadMasterAddresses( int maxservers, int *count, netadr_t *padr );
9 years ago
void RequestList( void );
void RequestBroadcastList( int clearpending );
void ServerPing( int server );
void ServerRules( int server );
void ServerPlayers( int server );
void CancelRequest( void );
9 years ago
int CompareServers( server_t *p1, server_t *p2 );
9 years ago
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 );
9 years ago
int ServerListSize( void );
9 years ago
char *GetServerInfo( int server );
9 years ago
int GetServerCount( void );
9 years ago
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 );
//
9 years ago
char m_szToken[1024];
int m_nRequesting;
int m_nDone;
9 years ago
9 years ago
double m_dStarted;
9 years ago
request_t *m_pServerList;
request_t *m_pActiveList;
9 years ago
server_t *m_pServers;
9 years ago
9 years ago
int m_nServerCount;
9 years ago
9 years ago
int m_nActiveQueries;
int m_nQuerying;
double m_fElapsed;
9 years ago
9 years ago
request_t *m_pPingRequest;
request_t *m_pRulesRequest;
request_t *m_pPlayersRequest;
9 years ago
};
9 years ago
#endif // HUD_SERVERS_PRIVH