示例#1
0
/*
=================
ArenaServers_StartRefresh
=================
*/
static void ArenaServers_StartRefresh(qboolean full)
{
	int		i;
	char	*ptr;

//	qtime_t q;
//	trap_RealTime(&q);
// 	trap_Cvar_Set( va("ui_lastServerRefresh_%i", g_arenaservers.master.curvalue), va("%s-%i, %i at %i:%i", MonthAbbrev[q.tm_mon],q.tm_mday, 1900+q.tm_year,q.tm_hour,q.tm_min));

	if (!full) {
		UI_UpdatePendingPings();
		return;
	}

	serverStatus.refreshActive = qtrue;
	serverStatus.nextDisplayRefresh = uis.realtime + 1000;
	// clear number of displayed servers
	serverStatus.numDisplayServers = 0;
	serverStatus.numRefreshedServers = 0;
	serverStatus.numPlayersOnServers = 0;
	// reset list
	g_arenaservers.list.numitems = serverStatus.numDisplayServers;
	g_arenaservers.list.curvalue = 0;
	g_arenaservers.list.top      = 0;
	// mark all servers as visible so we store ping updates for them
	trap_LAN_MarkServerVisible(g_arenaservers.master.curvalue, -1, qtrue);
	// reset all the pings
	trap_LAN_ResetPings(g_arenaservers.master.curvalue);
	//
	serverStatus.refreshtime = uis.realtime + 1000;
	if( g_arenaservers.master.curvalue == AS_LOCAL ) {
		trap_Cmd_ExecuteText( EXEC_NOW, "localservers\n" );
		// update menu
		ArenaServers_UpdateMenu( qfalse );
		return;
	}

	if( g_arenaservers.master.curvalue == AS_GLOBAL || g_arenaservers.master.curvalue == AS_MPLAYER ) {
		serverStatus.refreshtime = uis.realtime + 4000;
		if( g_arenaservers.master.curvalue == AS_GLOBAL ) {
			i = 0;
		}
		else {
			i = 1;
		}

		ptr = UI_Cvar_VariableString("debug_protocol");
		if (strlen(ptr)) {
			trap_Cmd_ExecuteText( EXEC_NOW, va( "globalservers %d %s full empty\n", i, ptr));
		}
		else {
			trap_Cmd_ExecuteText( EXEC_NOW, va( "globalservers %d %d full empty\n", i, (int)trap_Cvar_VariableValue( "protocol" ) ) );
		}
	}
	// update menu
	ArenaServers_UpdateMenu( qfalse );
}
static void CG_Rocket_InitServers()
{
	const char *src = CG_Argv( 1 );
	trap_LAN_ResetPings( CG_StringToNetSource( src ) );
	trap_LAN_ResetServerStatus();

	if ( !Q_stricmp( src, "internet" ) )
	{
		trap_SendConsoleCommand( "globalservers 0 86 full empty\n" );
	}

	else if ( !Q_stricmp( src, "local" ) )
	{
		trap_SendConsoleCommand( "localservers\n" );
	}

	trap_LAN_UpdateVisiblePings( CG_StringToNetSource( src ) );
}
示例#3
0
/*
==================
UI_UpdatePendingPings
==================
*/
static void UI_UpdatePendingPings() { 
	trap_LAN_ResetPings(g_arenaservers.master.curvalue);
	serverStatus.refreshActive = qtrue;
	serverStatus.refreshtime = uis.realtime + 500;

}
static void CG_Rocket_ResetPings()
{
	const char *src = CG_Argv( 1 );
	trap_LAN_ResetPings( CG_StringToNetSource( src ) );
	trap_LAN_UpdateVisiblePings( CG_StringToNetSource( src ) );
}