doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ServerScan.cpp
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 #include "../../idlib/precompiled.h"
30 #pragma hdrstop
31 
32 idCVar gui_filter_password( "gui_filter_password", "0", CVAR_GUI | CVAR_INTEGER | CVAR_ARCHIVE, "Password filter" );
33 idCVar gui_filter_players( "gui_filter_players", "0", CVAR_GUI | CVAR_INTEGER | CVAR_ARCHIVE, "Players filter" );
34 idCVar gui_filter_gameType( "gui_filter_gameType", "0", CVAR_GUI | CVAR_INTEGER | CVAR_ARCHIVE, "Gametype filter" );
35 idCVar gui_filter_idle( "gui_filter_idle", "0", CVAR_GUI | CVAR_INTEGER | CVAR_ARCHIVE, "Idle servers filter" );
36 idCVar gui_filter_game( "gui_filter_game", "0", CVAR_GUI | CVAR_INTEGER | CVAR_ARCHIVE, "Game filter" );
37 
38 const char* l_gameTypes[] = {
39  "Deathmatch",
40  "Tourney",
41  "Team DM",
42  "Last Man",
43  "CTF",
44  NULL
45 };
46 
47 static idServerScan *l_serverScan = NULL;
48 
49 /*
50 ================
51 idServerScan::idServerScan
52 ================
53 */
55  m_pGUI = NULL;
56  m_sort = SORT_PING;
57  m_sortAscending = true;
58  challenge = 0;
59  LocalClear();
60 }
61 
62 /*
63 ================
64 idServerScan::LocalClear
65 ================
66 */
68  scan_state = IDLE;
69  incoming_net = false;
70  lan_pingtime = -1;
71  net_info.Clear();
73  cur_info = 0;
74  if ( listGUI ) {
75  listGUI->Clear();
76  }
77  incoming_useTimeout = false;
79 }
80 
81 /*
82 ================
83 idServerScan::Clear
84 ================
85 */
87  LocalClear();
89 }
90 
91 /*
92 ================
93 idServerScan::Shutdown
94 ================
95 */
97  m_pGUI = NULL;
98  if ( listGUI ) {
99  listGUI->Config( NULL, NULL );
101  listGUI = NULL;
102  }
103  screenshot.Clear();
104 }
105 
106 /*
107 ================
108 idServerScan::SetupLANScan
109 ================
110 */
112  Clear();
115  challenge++;
117  common->DPrintf( "SetupLANScan with challenge %d\n", challenge );
118 }
119 
120 /*
121 ================
122 idServerScan::InfoResponse
123 ================
124 */
126  if ( scan_state == IDLE ) {
127  return false;
128  }
129 
130  idStr serv = Sys_NetAdrToString( server.adr );
131 
132  if ( server.challenge != challenge ) {
133  common->DPrintf( "idServerScan::InfoResponse - ignoring response from %s, wrong challenge %d.", serv.c_str(), server.challenge );
134  return false;
135  }
136 
137  if ( scan_state == NET_SCAN ) {
138  const idKeyValue *info = net_info.FindKey( serv.c_str() );
139  if ( !info ) {
140  common->DPrintf( "idServerScan::InfoResponse NET_SCAN: reply from unknown %s\n", serv.c_str() );
141  return false;
142  }
143  int id = atoi( info->GetValue() );
144  net_info.Delete( serv.c_str() );
145  inServer_t iserv = net_servers[ id ];
146  server.ping = Sys_Milliseconds() - iserv.time;
147  server.id = iserv.id;
148  } else {
149  server.ping = Sys_Milliseconds() - lan_pingtime;
150  server.id = 0;
151 
152  // check for duplicate servers
153  for ( int i = 0; i < Num() ; i++ ) {
154  if ( memcmp( &(*this)[ i ].adr, &server.adr, sizeof(netadr_t) ) == 0 ) {
155  common->DPrintf( "idServerScan::InfoResponse LAN_SCAN: duplicate server %s\n", serv.c_str() );
156  return true;
157  }
158  }
159  }
160 
161  const char *si_map = server.serverInfo.GetString( "si_map" );
162  const idDecl *mapDecl = declManager->FindType( DECL_MAPDEF, si_map, false );
163  const idDeclEntityDef *mapDef = static_cast< const idDeclEntityDef * >( mapDecl );
164  if ( mapDef ) {
165  const char *mapName = common->GetLanguageDict()->GetString( mapDef->dict.GetString( "name", si_map ) );
166  server.serverInfo.Set( "si_mapName", mapName );
167  } else {
168  server.serverInfo.Set( "si_mapName", si_map );
169  }
170 
171  int index = Append( server );
172  // for now, don't maintain sorting when adding new info response servers
173  m_sortedServers.Append( Num()-1 );
174  if ( listGUI->IsConfigured( ) && !IsFiltered( server ) ) {
175  GUIAdd( Num()-1, server );
176  }
177  if ( listGUI->GetSelection( NULL, 0 ) == ( Num()-1 ) ) {
179  }
180 
181  return index;
182 }
183 
184 /*
185 ================
186 idServerScan::AddServer
187 ================
188 */
189 void idServerScan::AddServer( int id, const char *srv ) {
190  inServer_t s;
191 
192  incoming_net = true;
194  s.id = id;
195 
196  // using IPs, not hosts
197  if ( !Sys_StringToNetAdr( srv, &s.adr, false ) ) {
198  common->DPrintf( "idServerScan::AddServer: failed to parse server %s\n", srv );
199  return;
200  }
201  if ( !s.adr.port ) {
202  s.adr.port = PORT_SERVER;
203  }
204 
205  net_servers.Append( s );
206 }
207 
208 /*
209 ================
210 idServerScan::EndServers
211 ================
212 */
214  incoming_net = false;
215  l_serverScan = this;
217  ApplyFilter();
218 }
219 
220 /*
221 ================
222 idServerScan::StartServers
223 ================
224 */
225 void idServerScan::StartServers( bool timeout ) {
226  incoming_net = true;
227  incoming_useTimeout = timeout;
229 }
230 
231 /*
232 ================
233 idServerScan::EmitGetInfo
234 ================
235 */
238 }
239 
240 /*
241 ===============
242 idServerScan::GetChallenge
243 ===============
244 */
246  return challenge;
247 }
248 
249 /*
250 ================
251 idServerScan::NetScan
252 ================
253 */
255  if ( !idAsyncNetwork::client.IsPortInitialized() ) {
256  // if the port isn't open, initialize it, but wait for a short
257  // time to let the OS do whatever magic things it needs to do...
259  // start the scan one second from now...
261  endWaitTime = Sys_Milliseconds() + 1000;
262  return;
263  }
264 
265  // make sure the client port is open
267 
269  challenge++;
270 
273  cur_info = 0;
274  net_info.Clear();
275  listGUI->Clear();
277  common->DPrintf( "NetScan with challenge %d\n", challenge );
278 
279  while ( cur_info < Min( net_servers.Num(), MAX_PINGREQUESTS ) ) {
280  netadr_t serv = net_servers[ cur_info ].adr;
281  EmitGetInfo( serv );
284  cur_info++;
285  }
286 }
287 
288 /*
289 ===============
290 idServerScan::ServerScanFrame
291 ===============
292 */
294  if ( scan_state == IDLE ) {
295  return;
296  }
297 
298  if ( scan_state == WAIT_ON_INIT ) {
299  if ( Sys_Milliseconds() >= endWaitTime ) {
300  scan_state = IDLE;
301  NetScan();
302  }
303  return;
304  }
305 
306  int timeout_limit = Sys_Milliseconds() - REPLY_TIMEOUT;
307 
308  if ( scan_state == LAN_SCAN ) {
309  if ( timeout_limit > lan_pingtime ) {
310  common->Printf( "Scanned for servers on the LAN\n" );
311  scan_state = IDLE;
312  }
313  return;
314  }
315 
316  // if scan_state == NET_SCAN
317 
318  // check for timeouts
319  int i = 0;
320  while ( i < net_info.GetNumKeyVals() ) {
321  if ( timeout_limit > net_servers[ atoi( net_info.GetKeyVal( i )->GetValue().c_str() ) ].time ) {
322  common->DPrintf( "timeout %s\n", net_info.GetKeyVal( i )->GetKey().c_str() );
324  } else {
325  i++;
326  }
327  }
328 
329  // possibly send more queries
331  netadr_t serv = net_servers[ cur_info ].adr;
332  EmitGetInfo( serv );
335  cur_info++;
336  }
337 
338  // update state
340  EndServers();
341  // the list is complete, we are no longer waiting for any getInfo replies
342  common->Printf( "Scanned %d servers.\n", cur_info );
343  scan_state = IDLE;
344  }
345 }
346 
347 /*
348 ===============
349 idServerScan::GetBestPing
350 ===============
351 */
353  int i, ic;
354  ic = Num();
355  if ( !ic ) {
356  return false;
357  }
358  serv = (*this)[ 0 ];
359  for ( i = 0 ; i < ic ; i++ ) {
360  if ( (*this)[ i ].ping < serv.ping ) {
361  serv = (*this)[ i ];
362  }
363  }
364  return true;
365 }
366 
367 /*
368 ================
369 idServerScan::GUIConfig
370 ================
371 */
372 void idServerScan::GUIConfig( idUserInterface *pGUI, const char *name ) {
373  m_pGUI = pGUI;
374  if ( listGUI == NULL ) {
376  }
377  listGUI->Config( pGUI, name );
378 }
379 
380 /*
381 ================
382 idServerScan::GUIUpdateSelected
383 ================
384 */
387 
388  if ( !m_pGUI ) {
389  return;
390  }
391  int i = listGUI->GetSelection( NULL, 0 );
392  if ( i == -1 || i >= Num() ) {
393  m_pGUI->SetStateString( "server_name", "" );
394  m_pGUI->SetStateString( "player1", "" );
395  m_pGUI->SetStateString( "player2", "" );
396  m_pGUI->SetStateString( "player3", "" );
397  m_pGUI->SetStateString( "player4", "" );
398  m_pGUI->SetStateString( "player5", "" );
399  m_pGUI->SetStateString( "player6", "" );
400  m_pGUI->SetStateString( "player7", "" );
401  m_pGUI->SetStateString( "player8", "" );
402  m_pGUI->SetStateString( "server_map", "" );
403  m_pGUI->SetStateString( "browser_levelshot", "" );
404  m_pGUI->SetStateString( "server_gameType", "" );
405  m_pGUI->SetStateString( "server_IP", "" );
406  m_pGUI->SetStateString( "server_passworded", "" );
407  } else {
408  m_pGUI->SetStateString( "server_name", (*this)[ i ].serverInfo.GetString( "si_name" ) );
409  for ( int j = 0; j < 8; j++ ) {
410  if ( (*this)[i].clients > j ) {
411  m_pGUI->SetStateString( va( "player%i", j + 1 ) , (*this)[ i ].nickname[ j ] );
412  } else {
413  m_pGUI->SetStateString( va( "player%i", j + 1 ) , "" );
414  }
415  }
416  m_pGUI->SetStateString( "server_map", (*this)[ i ].serverInfo.GetString( "si_mapName" ) );
417  fileSystem->FindMapScreenshot( (*this)[ i ].serverInfo.GetString( "si_map" ), screenshot, MAX_STRING_CHARS );
418  m_pGUI->SetStateString( "browser_levelshot", screenshot );
419  m_pGUI->SetStateString( "server_gameType", (*this)[ i ].serverInfo.GetString( "si_gameType" ) );
420  m_pGUI->SetStateString( "server_IP", Sys_NetAdrToString( (*this)[ i ].adr ) );
421  if ( (*this)[ i ].serverInfo.GetBool( "si_usePass" ) ) {
422  m_pGUI->SetStateString( "server_passworded", "PASSWORD REQUIRED" );
423  } else {
424  m_pGUI->SetStateString( "server_passworded", "" );
425  }
426  }
427 }
428 
429 /*
430 ================
431 idServerScan::GUIAdd
432 ================
433 */
434 void idServerScan::GUIAdd( int id, const networkServer_t server ) {
435  idStr name = server.serverInfo.GetString( "si_name", GAME_NAME " Server" );
436  bool d3xp = false;
437  bool mod = false;
438 
439  if ( !idStr::Icmp( server.serverInfo.GetString( "fs_game" ), "d3xp" ) ||
440  !idStr::Icmp( server.serverInfo.GetString( "fs_game_base" ), "d3xp" ) ) {
441  d3xp = true;
442  }
443  if ( server.serverInfo.GetString( "fs_game" )[ 0 ] != '\0' ) {
444  mod = true;
445  }
446 
447  name += "\t";
448  if ( server.serverInfo.GetString( "sv_punkbuster" )[ 0 ] == '1' ) {
449  name += "mtr_PB";
450  }
451 
452  name += "\t";
453  if ( d3xp ) {
454  // FIXME: even for a 'D3XP mod'
455  // could have a specific icon for this case
456  name += "mtr_doom3XPIcon";
457  } else if ( mod ) {
458  name += "mtr_doom3Mod";
459  } else {
460  name += "mtr_doom3Icon";
461  }
462  name += "\t";
463  name += va( "%i/%i\t", server.clients, server.serverInfo.GetInt( "si_maxPlayers" ) );
464  name += ( server.ping > -1 ) ? va( "%i\t", server.ping ) : "na\t";
465  name += server.serverInfo.GetString( "si_gametype" );
466  name += "\t";
467  name += server.serverInfo.GetString( "si_mapName" );
468  name += "\t";
469  listGUI->Add( id, name );
470 }
471 
472 /*
473 ================
474 idServerScan::ApplyFilter
475 ================
476 */
478  int i;
479  networkServer_t serv;
480  idStr s;
481 
482  listGUI->SetStateChanges( false );
483  listGUI->Clear();
484  for ( i = m_sortAscending ? 0 : m_sortedServers.Num() - 1;
485  m_sortAscending ? i < m_sortedServers.Num() : i >= 0;
486  m_sortAscending ? i++ : i-- ) {
487  serv = (*this)[ m_sortedServers[ i ] ];
488  if ( !IsFiltered( serv ) ) {
489  GUIAdd( m_sortedServers[ i ], serv );
490  }
491  }
493  listGUI->SetStateChanges( true );
494 }
495 
496 /*
497 ================
498 idServerScan::IsFiltered
499 ================
500 */
502  int i;
503  const idKeyValue *keyval;
504 
505  // OS support filter
506 #if 0
507  // filter out pure servers that won't provide checksumed game code for client OS
508  keyval = server.serverInfo.FindKey( "si_pure" );
509  if ( keyval && !idStr::Cmp( keyval->GetValue(), "1" ) ) {
510  if ( ( server.OSMask & ( 1 << BUILD_OS_ID ) ) == 0 ) {
511  return true;
512  }
513  }
514 #else
515  if ( ( server.OSMask & ( 1 << BUILD_OS_ID ) ) == 0 ) {
516  return true;
517  }
518 #endif
519  // password filter
520  keyval = server.serverInfo.FindKey( "si_usePass" );
521  if ( keyval && gui_filter_password.GetInteger() == 1 ) {
522  // show passworded only
523  if ( keyval->GetValue()[ 0 ] == '0' ) {
524  return true;
525  }
526  } else if ( keyval && gui_filter_password.GetInteger() == 2 ) {
527  // show no password only
528  if ( keyval->GetValue()[ 0 ] != '0' ) {
529  return true;
530  }
531  }
532  // players filter
533  keyval = server.serverInfo.FindKey( "si_maxPlayers" );
534  if ( keyval ) {
535  if ( gui_filter_players.GetInteger() == 1 && server.clients == atoi( keyval->GetValue() ) ) {
536  return true;
537  } else if ( gui_filter_players.GetInteger() == 2 && ( !server.clients || server.clients == atoi( keyval->GetValue() ) ) ) {
538  return true;
539  }
540  }
541  // gametype filter
542  keyval = server.serverInfo.FindKey( "si_gameType" );
543  if ( keyval && gui_filter_gameType.GetInteger() ) {
544  i = 0;
545  while ( l_gameTypes[ i ] ) {
546  if ( !keyval->GetValue().Icmp( l_gameTypes[ i ] ) ) {
547  break;
548  }
549  i++;
550  }
551  if ( l_gameTypes[ i ] && i != gui_filter_gameType.GetInteger() -1 ) {
552  return true;
553  }
554  }
555  // idle server filter
556  keyval = server.serverInfo.FindKey( "si_idleServer" );
557  if ( keyval && !gui_filter_idle.GetInteger() ) {
558  if ( !keyval->GetValue().Icmp( "1" ) ) {
559  return true;
560  }
561  }
562 
563  // autofilter D3XP games if the user does not has the XP installed
564  if(!fileSystem->HasD3XP() && !idStr::Icmp(server.serverInfo.GetString( "fs_game" ), "d3xp")) {
565  return true;
566  }
567 
568  // filter based on the game doom or XP
569  if(gui_filter_game.GetInteger() == 1) { //Only Doom
570  if(idStr::Icmp(server.serverInfo.GetString("fs_game"), "")) {
571  return true;
572  }
573  } else if(gui_filter_game.GetInteger() == 2) { //Only D3XP
574  if(idStr::Icmp(server.serverInfo.GetString("fs_game"), "d3xp")) {
575  return true;
576  }
577  }
578 
579  return false;
580 }
581 
582 /*
583 ================
584 idServerScan::Cmp
585 ================
586 */
587 
588 int idServerScan::Cmp( const int *a, const int *b ) {
589  networkServer_t serv1, serv2;
590  idStr s1, s2;
591  int ret;
592 
593  serv1 = (*l_serverScan)[ *a ];
594  serv2 = (*l_serverScan)[ *b ];
595  switch ( l_serverScan->m_sort ) {
596  case SORT_PING:
597  ret = serv1.ping < serv2.ping ? -1 : ( serv1.ping > serv2.ping ? 1 : 0 );
598  return ret;
599  case SORT_SERVERNAME:
600  serv1.serverInfo.GetString( "si_name", "", s1 );
601  serv2.serverInfo.GetString( "si_name", "", s2 );
602  return s1.IcmpNoColor( s2 );
603  case SORT_PLAYERS:
604  ret = serv1.clients < serv2.clients ? -1 : ( serv1.clients > serv2.clients ? 1 : 0 );
605  return ret;
606  case SORT_GAMETYPE:
607  serv1.serverInfo.GetString( "si_gameType", "", s1 );
608  serv2.serverInfo.GetString( "si_gameType", "", s2 );
609  return s1.Icmp( s2 );
610  case SORT_MAP:
611  serv1.serverInfo.GetString( "si_mapName", "", s1 );
612  serv2.serverInfo.GetString( "si_mapName", "", s2 );
613  return s1.Icmp( s2 );
614  case SORT_GAME:
615  serv1.serverInfo.GetString( "fs_game", "", s1 );
616  serv2.serverInfo.GetString( "fs_game", "", s2 );
617  return s1.Icmp( s2 );
618  }
619  return 0;
620 }
621 
622 /*
623 ================
624 idServerScan::SetSorting
625 ================
626 */
628  l_serverScan = this;
629  if ( sort == m_sort ) {
631  } else {
632  m_sort = sort;
633  m_sortAscending = true; // is the default for any new sort
635  }
636  // trigger a redraw
637  ApplyFilter();
638 }
639 
int InfoResponse(networkServer_t &server)
Definition: ServerScan.cpp:125
idCVar gui_filter_game("gui_filter_game","0", CVAR_GUI|CVAR_INTEGER|CVAR_ARCHIVE,"Game filter")
static const int INCOMING_TIMEOUT
Definition: ServerScan.h:127
void GUIUpdateSelected(void)
Definition: ServerScan.cpp:385
bool incoming_net
Definition: ServerScan.h:132
int incoming_lastTime
Definition: ServerScan.h:134
netadr_t adr
Definition: ServerScan.h:51
virtual void Add(int id, const idStr &s)=0
int GetInt(const char *key, const char *defaultString="0") const
Definition: Dict.h:252
int Cmp(const char *text) const
Definition: Str.h:652
void Delete(const char *key)
Definition: Dict.cpp:496
bool IsFiltered(const networkServer_t server)
Definition: ServerScan.cpp:501
static const int MAX_PINGREQUESTS
Definition: ServerScan.h:125
virtual void SetStateString(const char *varName, const char *value)=0
virtual void virtual void virtual const idLangDict * GetLanguageDict(void)=0
bool incoming_useTimeout
Definition: ServerScan.h:133
const idStr & GetKey(void) const
Definition: Dict.h:52
idCVar gui_filter_idle("gui_filter_idle","0", CVAR_GUI|CVAR_INTEGER|CVAR_ARCHIVE,"Idle servers filter")
#define GAME_NAME
Definition: Licensee.h:37
int lan_pingtime
Definition: ServerScan.h:136
static idAsyncClient client
Definition: AsyncNetwork.h:168
int Sys_Milliseconds(void)
unsigned short port
Definition: sys_public.h:407
void GetServerInfo(const netadr_t adr)
idFileSystem * fileSystem
Definition: FileSystem.cpp:500
void RunFrame()
Definition: ServerScan.cpp:293
idDict net_info
Definition: ServerScan.h:141
idStr screenshot
Definition: ServerScan.h:155
bool Sys_StringToNetAdr(const char *s, netadr_t *a, bool doDNSResolve)
Definition: posix_net.cpp:171
int GetChallenge()
Definition: ServerScan.cpp:245
virtual void FindMapScreenshot(const char *path, char *buf, int len)=0
idCVar gui_filter_gameType("gui_filter_gameType","0", CVAR_GUI|CVAR_INTEGER|CVAR_ARCHIVE,"Gametype filter")
virtual void SetStateChanges(bool enable)=0
GLdouble s
Definition: glext.h:2935
void Set(const char *key, const char *value)
Definition: Dict.cpp:275
idUserInterfaceManager * uiManager
int i
Definition: process.py:33
static const int REPLY_TIMEOUT
Definition: ServerScan.h:126
int IcmpNoColor(const char *text) const
Definition: Str.h:682
netadr_t adr
Definition: ServerScan.h:44
int Icmp(const char *text) const
Definition: Str.h:667
void GUIAdd(int id, const networkServer_t server)
Definition: ServerScan.cpp:434
serverSort_t m_sort
Definition: ServerScan.h:151
void LocalClear()
Definition: ServerScan.cpp:67
void ApplyFilter()
Definition: ServerScan.cpp:477
#define PORT_SERVER
Definition: Licensee.h:69
void Sort(cmp_t *compare=(cmp_t *)&idListSortCompare< type >)
Definition: List.h:898
scan_state_t scan_state
Definition: ServerScan.h:130
GLuint index
Definition: glext.h:3476
const char * GetString(const char *key, const char *defaultString="") const
Definition: Dict.h:240
#define MAX_STRING_CHARS
Definition: Lib.h:95
idUserInterface * m_pGUI
Definition: ServerScan.h:148
idCommon * common
Definition: Common.cpp:206
static int Cmp(const int *a, const int *b)
Definition: ServerScan.cpp:588
virtual idListGUI * AllocListGUI(void) const =0
#define NULL
Definition: Lib.h:88
idCVar gui_filter_players("gui_filter_players","0", CVAR_GUI|CVAR_INTEGER|CVAR_ARCHIVE,"Players filter")
void Clear(void)
Definition: Dict.cpp:201
virtual const idDecl * FindType(declType_t type, const char *name, bool makeDefault=true)=0
int GetInteger(void) const
Definition: CVarSystem.h:143
virtual int GetSelection(char *s, int size, int sel=0) const =0
const char * GetString(const char *str) const
Definition: LangDict.cpp:148
static const int REFRESH_START
Definition: ServerScan.h:128
virtual void FreeListGUI(idListGUI *listgui)=0
void EndServers()
Definition: ServerScan.cpp:213
const idStr & GetValue(void) const
Definition: Dict.h:53
void AddServer(int id, const char *srv)
Definition: ServerScan.cpp:189
void GUIConfig(idUserInterface *pGUI, const char *name)
Definition: ServerScan.cpp:372
void StartServers(bool timeout)
Definition: ServerScan.cpp:225
void Clear(void)
Definition: Str.h:724
bool InitPort(void)
const idKeyValue * FindKey(const char *key) const
Definition: Dict.cpp:451
GLubyte GLubyte GLubyte a
Definition: glext.h:4662
virtual void Printf(const char *fmt,...) id_attribute((format(printf
virtual bool IsConfigured(void) const =0
const char * Sys_NetAdrToString(const netadr_t a)
Definition: posix_net.cpp:187
virtual void Config(idUserInterface *pGUI, const char *name)=0
idDeclManager * declManager
GLubyte GLubyte b
Definition: glext.h:4662
int Append(const networkServer_t &obj)
void SetInt(const char *key, int val)
Definition: Dict.h:192
virtual void Clear(void)=0
GLuint id
Definition: glext.h:3103
void NetScan()
Definition: ServerScan.cpp:254
idList< inServer_t > net_servers
Definition: ServerScan.h:143
const GLcharARB * name
Definition: glext.h:3629
void EmitGetInfo(netadr_t &serv)
Definition: ServerScan.cpp:236
idListGUI * listGUI
Definition: ServerScan.h:149
Definition: Str.h:116
void SetSorting(serverSort_t sort)
Definition: ServerScan.cpp:627
idCVar si_map("si_map","game/mp/d3dm1", CVAR_GAME|CVAR_SERVERINFO|CVAR_ARCHIVE,"map to be played next on server", idCmdSystem::ArgCompletion_MapName)
void Shutdown()
Definition: ServerScan.cpp:96
const char * c_str(void) const
Definition: Str.h:487
serverSort_t
Definition: ServerScan.h:63
const idKeyValue * GetKeyVal(int index) const
Definition: Dict.h:294
void SetupLANScan()
Definition: ServerScan.cpp:111
void Clear()
Definition: ServerScan.cpp:86
GLint j
Definition: qgl.h:264
const char * l_gameTypes[]
Definition: ServerScan.cpp:38
idDict serverInfo
Definition: ServerScan.h:52
char * va(const char *fmt,...)
Definition: Str.cpp:1568
idList< int > m_sortedServers
Definition: ServerScan.h:153
virtual void DPrintf(const char *fmt,...) id_attribute((format(printf
idCVar gui_filter_password("gui_filter_password","0", CVAR_GUI|CVAR_INTEGER|CVAR_ARCHIVE,"Password filter")
int GetNumKeyVals(void) const
Definition: Dict.h:290
bool GetBestPing(networkServer_t &serv)
Definition: ServerScan.cpp:352
ID_INLINE T Min(T x, T y)
Definition: Lib.h:159
virtual bool HasD3XP(void)=0
bool m_sortAscending
Definition: ServerScan.h:152
void Clear(void)
Definition: List.h:184