R:/projects/actioncube/_svn/trunk/ac/source/src/serverbrowser.cpp File Reference

#include "pch.h"
#include "cube.h"
#include "SDL_thread.h"

Include dependency graph for serverbrowser.cpp:


Classes

struct  resolverthread
struct  resolverresult
struct  connectdata

Defines

#define RESOLVERTHREADS   1
#define RESOLVERLIMIT   3000
#define CONNLIMIT   20000
#define NUMSERVSORT   5

Functions

int resolverloop (void *data)
void resolverinit ()
void resolverstop (resolverthread &rt)
void resolverclear ()
void resolverquery (const char *name)
bool resolvercheck (const char **name, ENetAddress *address)
bool resolverwait (const char *name, ENetAddress *address)
int connectthread (void *data)
int connectwithtimeout (ENetSocket sock, const char *hostname, ENetAddress &address)
char * getservername (int n)
serverinfo * findserverinfo (ENetAddress address)
serverinfo * getconnectedserverinfo ()
static serverinfo * newserver (const char *name, uint ip=ENET_HOST_ANY, int port=CUBE_DEFAULT_SERVER_PORT)
void addserver (const char *servername, const char *serverport)
 VARP (servpingrate, 1000, 5000, 60000)
 VARP (maxservpings, 0, 0, 1000)
 VAR (searchlan, 0, 1, 2)
void pingservers ()
void checkresolver ()
void checkpings ()
 VARP (serversort, 0, 0, NUMSERVSORT-1)
 VARP (serversortdir, 0, 0, 1)
 VARP (showonlygoodservers, 0, 0, 1)
int sicompare (serverinfo **ap, serverinfo **bp)
 VAR (showallservers, 0, 1, 1)
void refreshservers (void *menu, bool init)
bool serverskey (void *menu, int code, bool isdown, int unicode)
void clearservers ()
 VARP (masterupdatefrequency, 1, 60 *60, 24 *60 *60)
void updatefrommaster (int force)
 COMMAND (addserver, ARG_2STR)
 COMMAND (clearservers, ARG_NONE)
 COMMAND (updatefrommaster, ARG_1INT)
void writeservercfg ()

Variables

bool isdedicated
vector< resolverthread > resolverthreads
vector< const char * > resolverqueries
vector< resolverresult > resolverresults
SDL_mutex * resolvermutex
SDL_cond * querycond
SDL_cond * resultcond
SDL_Thread * connthread = NULL
SDL_mutex * connmutex = NULL
SDL_cond * conncond = NULL
vector< serverinfo * > servers
ENetSocket pingsock = ENET_SOCKET_NULL
int lastinfo = 0
void * servmenu = NULL

Define Documentation

#define CONNLIMIT   20000

#define NUMSERVSORT   5

#define RESOLVERLIMIT   3000

#define RESOLVERTHREADS   1


Function Documentation

void addserver ( const char *  servername,
const char *  serverport 
)

void checkpings (  ) 

void checkresolver (  ) 

void clearservers (  ) 

COMMAND ( updatefrommaster  ,
ARG_1INT   
)

COMMAND ( clearservers  ,
ARG_NONE   
)

COMMAND ( addserver  ,
ARG_2STR   
)

int connectthread ( void *  data  ) 

int connectwithtimeout ( ENetSocket  sock,
const char *  hostname,
ENetAddress &  address 
)

serverinfo* findserverinfo ( ENetAddress  address  ) 

serverinfo* getconnectedserverinfo (  ) 

char* getservername ( int  n  ) 

static serverinfo* newserver ( const char *  name,
uint  ip = ENET_HOST_ANY,
int  port = CUBE_DEFAULT_SERVER_PORT 
) [static]

void pingservers (  ) 

void refreshservers ( void *  menu,
bool  init 
)

bool resolvercheck ( const char **  name,
ENetAddress *  address 
)

void resolverclear (  ) 

void resolverinit (  ) 

int resolverloop ( void *  data  ) 

void resolverquery ( const char *  name  ) 

void resolverstop ( resolverthread &  rt  ) 

bool resolverwait ( const char *  name,
ENetAddress *  address 
)

bool serverskey ( void *  menu,
int  code,
bool  isdown,
int  unicode 
)

int sicompare ( serverinfo **  ap,
serverinfo **  bp 
)

void updatefrommaster ( int  force  ) 

VAR ( showallservers  ,
0  ,
1  ,
1   
)

VAR ( searchlan  ,
0  ,
1  ,
2   
)

VARP ( masterupdatefrequency  ,
1  ,
60 *  60,
24 *60 *  60 
)

VARP ( showonlygoodservers  ,
0  ,
0  ,
1   
)

VARP ( serversortdir  ,
0  ,
0  ,
1   
)

VARP ( serversort  ,
0  ,
0  ,
NUMSERVSORT-  1 
)

VARP ( maxservpings  ,
0  ,
0  ,
1000   
)

VARP ( servpingrate  ,
1000  ,
5000  ,
60000   
)

void writeservercfg (  ) 


Variable Documentation

SDL_cond* conncond = NULL

SDL_mutex* connmutex = NULL

SDL_Thread* connthread = NULL

int lastinfo = 0

ENetSocket pingsock = ENET_SOCKET_NULL

SDL_cond* querycond

SDL_mutex* resolvermutex

vector<const char *> resolverqueries

SDL_cond * resultcond

void* servmenu = NULL


Generated on Mon Dec 8 21:41:33 2008 for AssaultCube by  doxygen 1.5.7.1