Team Fortress 2 Source Code as on 22/4/2020
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.

69 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef PLAYERLIST_H
  8. #define PLAYERLIST_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "server.h"
  13. #include "netadr.h"
  14. #include "utlvector.h"
  15. #include "playermsghandler.h"
  16. #include "Iresponse.h"
  17. class CSocket;
  18. class IResponse;
  19. class CPlayerList: public IResponse
  20. {
  21. public:
  22. CPlayerList(IResponse *target,serveritem_t &server, const char *rconPassword);
  23. ~CPlayerList();
  24. // send an rcon command to a server
  25. void SendQuery();
  26. void Refresh();
  27. bool IsRefreshing();
  28. serveritem_t &GetServer();
  29. void RunFrame();
  30. void UpdateServer();
  31. CUtlVector<Players_t> *GetPlayerList();
  32. bool NewPlayerList();
  33. void ServerResponded();
  34. // called when a server response has timed out
  35. void ServerFailedToRespond();
  36. void SetPassword(const char *newPass);
  37. private:
  38. serveritem_t m_Server;
  39. CSocket *m_pQuery; // Game server query socket
  40. CUtlVector<Players_t> m_PlayerList;
  41. IResponse *m_pResponseTarget;
  42. CRcon *m_pRcon;
  43. CPlayerMsgHandlerDetails *m_pPlayerInfoMsg;
  44. bool m_bIsRefreshing;
  45. bool m_bNewPlayerList;
  46. bool m_bRconFailed;
  47. char m_szRconPassword[100];
  48. };
  49. #endif // PLAYERLIST_H