summaryrefslogtreecommitdiff
path: root/serverbrowser/igamelist.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /serverbrowser/igamelist.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'serverbrowser/igamelist.h')
-rw-r--r--serverbrowser/igamelist.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/serverbrowser/igamelist.h b/serverbrowser/igamelist.h
new file mode 100644
index 0000000..3944c9b
--- /dev/null
+++ b/serverbrowser/igamelist.h
@@ -0,0 +1,91 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================
+
+#ifndef IGAMELIST_H
+#define IGAMELIST_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+class gameserveritem_t;
+#if defined( STEAM )
+#include "steam2common.h"
+#include "FindSteam2Servers.h"
+#else
+#include "steamcommon.h"
+#include "FindSteamServers.h"
+#endif
+#include "netadr.h"
+
+
+typedef enum
+{
+ SERVERVERSION_SAME_VERSION = 0,
+ SERVERVERSION_SERVER_OLD,
+ SERVERVERSION_SERVER_NEWER
+} SERVERVERSION;
+
+struct serverdisplay_t
+{
+ serverdisplay_t()
+ {
+ m_iListID = -1;
+ m_iServerID = -1;
+ m_bDoNotRefresh = true;
+ }
+ int m_iListID; // the VGUI2 list panel index for displaying this server
+ int m_iServerID; // the matchmaking interface index for this server
+ bool m_bDoNotRefresh;
+ bool operator==( const serverdisplay_t &rhs ) const { return rhs.m_iServerID == m_iServerID; }
+
+};
+
+//-----------------------------------------------------------------------------
+// Purpose: Interface to accessing a game list
+//-----------------------------------------------------------------------------
+class IGameList
+{
+public:
+
+ enum InterfaceItem_e
+ {
+ FILTERS,
+ GETNEWLIST,
+ ADDSERVER,
+ ADDCURRENTSERVER,
+ };
+
+ // returns true if the game list supports the specified ui elements
+ virtual bool SupportsItem(InterfaceItem_e item) = 0;
+
+ // starts the servers refreshing
+ virtual void StartRefresh() = 0;
+
+ // gets a new server list
+ virtual void GetNewServerList() = 0;
+
+ // stops current refresh/GetNewServerList()
+ virtual void StopRefresh() = 0;
+
+ // returns true if the list is currently refreshing servers
+ virtual bool IsRefreshing() = 0;
+
+ // gets information about specified server
+ virtual gameserveritem_t *GetServer(unsigned int serverID) = 0;
+
+ // called when Connect button is pressed
+ virtual void OnBeginConnect() = 0;
+
+ // invalid server index
+ virtual int GetInvalidServerListID() = 0;
+
+ // Get code to use for tracking how people are connecting to servers
+ virtual const char *GetConnectCode() = 0;
+};
+
+
+#endif // IGAMELIST_H