bool SFServerConnectionManager::LoadConnectionServerList(WCHAR* szFileName)
{
	if (InitServerList(szFileName) == false)
		return false;

	for (auto& iter : m_mapServerInfo)
	{
		SFServerBridge* pServer = iter.second;		
		_ServerInfo& info = pServer->GetServerInfo();

		int serial = -1;
		serial = SFEngine::GetInstance()->AddConnector((char*)StringConversion::ToASCII(info.szIP.c_str()).c_str(), info.port);

		if (serial >= 0)
		{
			m_mapConnectedServer.insert(std::make_pair(serial, pServer));
		}
		else
		{
			m_listDisonnectedServer.push_back(info);
		}
	}

	return true;
}
Example #2
0
BOOL CTestScript::OnInitDialog()
{
    CDialog::OnInitDialog();
    //读取测试案例配置文件
    LoadCaseSetup();
    InitTree();
    InitTestConfigInfo();
    InitServerList();
    InitTestType();
    InitRegionList();
    InitOccuList();
    InitProjList();


//	this->GetDlgItem(IDC_UpdateScript)->EnableWindow(FALSE);

    m_edScriptInfo.LimitText(10);

    m_ctrlTestType.SetCurSel(m_mapTestConfigRecord[0]);
    m_ctrlServerList.SetCurSel(m_mapTestConfigRecord[1]);

    char cDisplay[256];
    sprintf(cDisplay,"%d",m_mapTestConfigRecord[2]);
    m_edStartCDKey.SetWindowText(cDisplay);

    sprintf(cDisplay,"%d",m_mapTestConfigRecord[3]);
    m_edEndCDKey.SetWindowText(cDisplay);

    sprintf(cDisplay,"%d",m_mapTestConfigRecord[4]);
    m_edTimer.SetWindowText(cDisplay);

    sprintf(cDisplay,"%d",m_mapTestConfigRecord[5]);
    m_edPlayerLevel.SetWindowText(cDisplay);

    m_ctrlOcculist.SetCurSel(m_mapTestConfigRecord[6]);

    m_bnThirdOccu.SetCheck(m_mapTestConfigRecord[7]);
    if (m_mapTestConfigRecord[7] == 1)
        m_ctrlOcculist.EnableWindow(0);

    m_ctrlRegionList.SetCurSel(m_mapTestConfigRecord[8]);

    sprintf(cDisplay,"%d",m_mapTestConfigRecord[9]);
    m_edPlayerX.SetWindowText(cDisplay);

    sprintf(cDisplay,"%d",m_mapTestConfigRecord[10]);
    m_edPlayerY.SetWindowText(cDisplay);


    m_bnEquipWeapon.SetCheck(m_mapTestConfigRecord[11]);

    m_bnMaxState.SetCheck(m_mapTestConfigRecord[12]);

    ((CComboBox*)GetDlgItem(IDC_COMBO_TDLG_PROJNAME))->SetCurSel(m_mapTestConfigRecord[13]);

    return TRUE;  // return TRUE unless you set the focus to a control
    // 异常: OCX 属性页应返回 FALSE
}