Esempio n. 1
0
void game_sv_GameState::SaveMapList				()
{
	if (0==MAPROT_LIST[0])				return;
	if (m_pMapRotation_List.empty())	return;
	IWriter*		fs		= FS.w_open(MAPROT_LIST);

	while(m_pMapRotation_List.size())
	{
		SMapRot& R			= m_pMapRotation_List.front();
		fs->w_printf		("sv_addmap %s/ver=%s\n", R.map_name.c_str(), R.map_ver.c_str());
		m_pMapRotation_List.pop_front();
	};
	FS.w_close				(fs);
};
Esempio n. 2
0
void	CServerDlg::SaveMapList()
{
//	if (!m_pSVServerOptDlg->m_pMapRotation.GetCheck()) return;
//	if (!m_pSVServerOptDlg->m_pMapRotationFile.GetWindowTextLength()) return;
	
	CString MapRotFileName = MAPROT_LIST_NAME;
//	m_pSVServerOptDlg->m_pMapRotationFile.GetWindowText(MapRotFileName);
//	MapRotFileName += ".ltx";

	string_path			MapRotFileFullPath;

	u32 size = xr_strlen(MapRotFileName);
//	memmove(MapRotFileFullPath, MapRotFileName, xr_strlen(MapRotFileName));
	strcpy(MapRotFileFullPath, MapRotFileName);
	
	FS.update_path		(MapRotFileFullPath, "$app_data_root$", MapRotFileName);
	CStalker_netDlg* pMainDlg = (CStalker_netDlg*) (GetParent()->GetParent());
	if (pMainDlg && pMainDlg->m_pLogsPath.GetWindowTextLength() != 0)
	{
		char tmp[1024];
		string_path NewPath;
		pMainDlg->m_pLogsPath.GetWindowText(tmp, 1024);
		sprintf(NewPath, "%s%s", tmp, MapRotFileFullPath);
		strcpy(MapRotFileFullPath, NewPath);
	}
	if (m_pMapList2.GetCount()<=0)
	{
		FS.file_delete(MapRotFileFullPath);
		return;
	};

	IWriter*		fs	= FS.w_open(MapRotFileFullPath);
	if (!fs) return;

	int SelIndx[1024];
	m_pMapList.GetSelItems(1024, SelIndx);

	char pMapName[1024];
	for (int i=0; i < m_pMapList2.GetCount(); i++)
	{
		m_pMapList2.GetText(i, pMapName);
		if (!pMapName[0]) continue;

		fs->w_printf("sv_addmap %s\n", pMapName);
	};		

	FS.w_close		(fs);
};