summaryrefslogtreecommitdiff
path: root/tracker/AdminServer/serverinfo.h
blob: 35036f0c778d0f9ab70a7a07f81605296c609e14 (plain) (blame)
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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: defines a RCon class used to send rcon commands to remote servers
//
// $NoKeywords: $
//=============================================================================

#ifndef SERVERINFO_H
#define SERVERINFO_H
#ifdef _WIN32
#pragma once
#endif

#include "server.h"
#include "netadr.h"

class CSocket;
class IResponse;


class CServerInfo 
{

public:

	CServerInfo(IResponse *target,serveritem_t &server);
	~CServerInfo();

	// send an rcon command to a server
	void Query();

	void Refresh();

	bool IsRefreshing();
	serveritem_t &GetServer();
	void RunFrame();
	bool Refreshed();

	void UpdateServer(netadr_t *adr, bool proxy, const char *serverName, const char *map, 
						 const char *gamedir, const char *gameDescription, int players, 
						 int maxPlayers, float recvTime, bool password);

	int serverID;
	int received;

private:

	serveritem_t m_Server;
	CSocket	*m_pQuery;	// Game server query socket
	
	IResponse *m_pResponseTarget;

	bool m_bIsRefreshing;
	float m_fSendTime;
	bool m_bRefreshed;

};


#endif // SERVERINFO_H