summaryrefslogtreecommitdiff
path: root/tracker/AdminServer/playerlist.h
blob: 473ea6aabdf72fce28a72cd45aafb0f3d0691146 (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
61
62
63
64
65
66
67
68
69
70
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================

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

#include "server.h"
#include "netadr.h"
#include "utlvector.h"
#include "playermsghandler.h"
#include "Iresponse.h"

class CSocket;
class IResponse;


class CPlayerList: public IResponse
{
public:

	CPlayerList(IResponse *target,serveritem_t &server, const char *rconPassword);
	~CPlayerList();

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

	void Refresh();

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

	void UpdateServer();
	CUtlVector<Players_t> *GetPlayerList();
	bool NewPlayerList();

	void ServerResponded();

	// called when a server response has timed out
	void ServerFailedToRespond();

	void SetPassword(const char *newPass);


private:

	serveritem_t m_Server;
	CSocket	*m_pQuery;	// Game server query socket
	CUtlVector<Players_t> m_PlayerList;

	IResponse *m_pResponseTarget;
	CRcon *m_pRcon;
	CPlayerMsgHandlerDetails *m_pPlayerInfoMsg;

	bool m_bIsRefreshing;
	bool m_bNewPlayerList;
	bool m_bRconFailed;
	char m_szRconPassword[100];

};


#endif // PLAYERLIST_H