示例#1
0
/*
===================
RequestList

Request list of game servers from master
===================
*/
void CHudServers::RequestList( void )
{
	m_nRequesting	= 1;
	m_nDone			= 0;
	m_dStarted		= m_fElapsed;

	int	count = 0;
	netadr_t adr;

	if ( !LoadMasterAddresses( 1, &count, &adr ) )
	{
		gEngfuncs.Con_DPrintf( "SendRequest:  Unable to read master server addresses\n" );
		return;
	}

	ClearRequestList( &m_pActiveList );
	ClearRequestList( &m_pServerList );
	ClearServerList( &m_pServers );

	m_nServerCount = 0;

	// Make sure networking system has started.
	NET_API->InitNetworking();

	// Kill off left overs if any
	NET_API->CancelAllRequests();

	// Request Server List from master
	NET_API->SendRequest( context_id++, NETAPI_REQUEST_SERVERLIST, 0, 5.0, &adr, ::ListResponse );
}
示例#2
0
/*
===================
~CHudServers

===================
*/
CHudServers::~CHudServers( void )
{
	ClearRequestList( &m_pActiveList );
	ClearRequestList( &m_pServerList );
	ClearServerList( &m_pServers );

	m_nServerCount = 0;

	if ( m_pPingRequest )
	{
		delete m_pPingRequest;
		m_pPingRequest = NULL;

	}
	
	if ( m_pRulesRequest )
	{
		delete m_pRulesRequest;
		m_pRulesRequest = NULL;
	}

	if ( m_pPlayersRequest )
	{
		delete m_pPlayersRequest;
		m_pPlayersRequest = NULL;
	}
}
示例#3
0
FileUpload::~FileUpload()
{
    Director::getInstance()->getScheduler()->unschedule(schedule_selector(FileUpload::OnTimer), this);
    TerminateAndWait();
    
    ClearRequestList();
    ClearResponseList();
    
    CloseSocket(eCLIENT_STATE_NONE, false);
}
示例#4
0
void CHudServers::RequestBroadcastList( int clearpending )
{
	m_nRequesting	= 1;
	m_nDone			= 0;
	m_dStarted		= m_fElapsed;

	netadr_t		adr;
	memset( &adr, 0, sizeof( adr ) );

	if ( clearpending )
	{
		ClearRequestList( &m_pActiveList );
		ClearRequestList( &m_pServerList );
		ClearServerList( &m_pServers );

		m_nServerCount = 0;
	}

	// Make sure to byte swap server if necessary ( using "host" to "net" conversion
	adr.port = htons( PORT_SERVER );

	// Make sure networking system has started.
	NET_API->InitNetworking();

	if ( clearpending )
	{
		// Kill off left overs if any
		NET_API->CancelAllRequests();
	}

	adr.type = NA_BROADCAST;

	// Request Servers from LAN via IP
	NET_API->SendRequest( context_id++, NETAPI_REQUEST_DETAILS, FNETAPI_MULTIPLE_RESPONSE, 5.0, &adr, ::ServerResponse );

	adr.type = NA_BROADCAST_IPX;

	// Request Servers from LAN via IPX ( if supported )
	NET_API->SendRequest( context_id++, NETAPI_REQUEST_DETAILS, FNETAPI_MULTIPLE_RESPONSE, 5.0, &adr, ::ServerResponse );
}
示例#5
0
文件: Dan.cpp 项目: gthgame/gth
BOOL CDanBattleManager::MakeBattleDan()
{
	LPREQUEST_RECORD pReqA=static_cast<LPREQUEST_RECORD>(ViewFirst(&m_RequestList));
	if ( pReqA==NULL)
		return FALSE;

	if (m_pSuggester==NULL)
		return FALSE;

	BYTE bResult=MSG_ReadByte();		

	memcpy(&m_BattleDan[0],pReqA,sizeof(REQUEST_RECORD));			
	memcpy(&m_BattleDan[1],m_pSuggester,sizeof(REQUEST_RECORD));	


	
	g_pc[m_BattleDan[0].ServerID].curChargeSE -= g_logic.DanBattlePrice;
	g_pc[m_BattleDan[1].ServerID].curChargeSE -= g_logic.DanBattlePrice;

	
	SendGSM_Refresh_PersonData(&g_pc[m_BattleDan[0].ServerID], 0);
	SendGSM_Refresh_PersonData(&g_pc[m_BattleDan[1].ServerID], 0);
	
	

	

	SetStatus(DBTL_STATUS_MOVE);									

	
	BroadCast_BattleDan();

	

	if ( g_config.isDanBattleMap )
	{
		BATTLE_TEAM_INFO Team[2];
		
		Team[0].danIdx=m_BattleDan[0].DanIdx;
		memcpy(Team[0].DanName,m_BattleDan[0].DanName,GUILDNAMESTRING);
		Team[1].danIdx=m_BattleDan[1].DanIdx;
		memcpy(Team[1].DanName,m_BattleDan[1].DanName,GUILDNAMESTRING);
			
		g_pDanBattleSys->SetTeamInfo(0,&Team[0]);
		g_pDanBattleSys->SetTeamInfo(1,&Team[1]);
	}
		
	ClearRequestList();

	return TRUE;
}