OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
cl_uiserverlist.h
1/*
2===========================================================================
3Copyright (C) 2015 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23#pragma once
24
25#include "../gamespy/goaceng.h"
26
27#define NUM_SERVERLISTS 2
28
30 int iServerType;
31 class UIFAKKServerList *serverList;
32};
33
34class UIFAKKServerList : public UIListCtrl
35{
36 friend class FAKKServerListItem;
37
38public:
39 CLASS_PROTOTYPE(UIFAKKServerList);
40
41protected:
42 // need a new struct instead of gamespy
43 struct GServerListImplementation *m_serverList[NUM_SERVERLISTS];
44 bool m_bHasList;
45 bool m_bLANListing;
46
47public:
48 bool m_bGettingList[NUM_SERVERLISTS];
49 bool m_bUpdatingList;
50
51private:
52 // Added in OPM
53 // Servers count
54 FAKKServerListInstance m_ServerListInst[NUM_SERVERLISTS];
55 int m_iServerQueryCount;
56 int m_iServerTotalCount;
57 int m_iTotalNumPlayers;
58 bool m_bDoneUpdating[NUM_SERVERLISTS];
59 bool m_NeedAdditionalLANSearch;
60
61protected:
62 void SelectServer(Event *ev);
63 void ConnectServer(Event *ev);
64 qboolean KeyEvent(int key, unsigned int time) override;
65 void UpdateUIElement(void) override;
66 void RefreshServerList(Event *ev);
67 void RefreshLANServerList(Event *ev);
68 void CancelRefresh(Event *ev);
69 void NewServerList(void);
70 void MakeLANListing(Event *ev);
71 void UpdateServer(Event *ev);
72 void RefreshStatus();
73
74 static int ServerCompareFunction(const UIListCtrlItem *i1, const UIListCtrlItem *i2, int columnname);
75 static void UpdateServerListCallBack(GServerList serverlist, int msg, void *instance, void *param1, void *param2);
76
77public:
78 UIFAKKServerList();
79
80 void Draw(void) override;
81 void SortByColumn(int column) override;
82};
Definition listener.h:246
Definition cl_uiserverlist.h:35
Definition uilistctrl.h:27
Definition cl_uiserverlist.h:29
Definition gserverlist.c:115