Subversion Repositories spk

Rev

Rev 133 | Rev 147 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 133 Rev 134
Line 2932... Line 2932...
2932
void CPackages::AddLogEntry(int type, CyString args, CyStringList *errors)
2932
void CPackages::AddLogEntry(int type, CyString args, CyStringList *errors)
2933
{
2933
{
2934
	if ( !errors )
2934
	if ( !errors )
2935
		return;
2935
		return;
2936
 
2936
 
2937
	errors->PushBack(args, ERRORLOG(type));
2937
	errors->PushBack(args, ERRORLOG_OLD(type));
2938
}
2938
}
2939
 
2939
 
2940
/**
2940
/**
2941
 * Enable a package
2941
 * Enable a package
2942
 *
2942
 *
Line 3241... Line 3241...
3241
		if ( f->IsFakePatch() )
3241
		if ( f->IsFakePatch() )
3242
		{
3242
		{
3243
			// find package the fake patch belongs to
3243
			// find package the fake patch belongs to
3244
			if ( checkPackage )
3244
			if ( checkPackage )
3245
			{
3245
			{
3246
				newFilename = Utils::String(m_sCurrentDir.ToString()) + "/PluginManager/Disabled/FakePatches/FakePatch_" + checkPackage->GetNameValidFile().ToString() + "_" + checkPackage->author() + "_" + f->GetName().ToString();
3246
				newFilename = Utils::String(m_sCurrentDir.ToString()) + "/PluginManager/Disabled/FakePatches/FakePatch_" + checkPackage->getNameValidFile() + "_" + checkPackage->author() + "_" + f->name();
3247
				shuffle = true;
3247
				shuffle = true;
3248
			}
3248
			}
3249
		}
3249
		}
3250
		else if ( f->isAutoTextFile() )
3250
		else if ( f->isAutoTextFile() )
3251
		{
3251
		{
3252
			if ( checkPackage )
3252
			if ( checkPackage )
3253
			{
3253
			{
3254
				newFilename = Utils::String(m_sCurrentDir.ToString()) + "/PluginManager/Disabled/TextFiles/Text_" + checkPackage->GetNameValidFile().ToString() + "_" + checkPackage->author() + "_" + f->GetName().ToString();
3254
				newFilename = Utils::String(m_sCurrentDir.ToString()) + "/PluginManager/Disabled/TextFiles/Text_" + checkPackage->getNameValidFile() + "_" + checkPackage->author() + "_" + f->name();
3255
				shuffle = true;
3255
				shuffle = true;
3256
			}
3256
			}
3257
		}
3257
		}
3258
		// otherwise we can just use the standard filename
3258
		// otherwise we can just use the standard filename
3259
		else
3259
		else
Line 4959... Line 4959...
4959
	{
4959
	{
4960
		m_gameExe.ParseExe("x2.exe|0:5:NOSAVESUBDIR:HKCU/Software/EgoSoftware/X2/ModName:X2 The Threat:!GAMEDIR!:2:1604608!2150400:1.4 Artifical Life:1974272:1.5 Uplink");
4960
		m_gameExe.ParseExe("x2.exe|0:5:NOSAVESUBDIR:HKCU/Software/EgoSoftware/X2/ModName:X2 The Threat:!GAMEDIR!:2:1604608!2150400:1.4 Artifical Life:1974272:1.5 Uplink");
4961
		m_gameExe.ParseExe("x3.exe|30:5:0:HKCU/Software/Egosoft/X3/ModName:X3 Reunion:Egosoft/X3:2:2347008:2.0 Bala Gi:2367488!2375680:2.5 Uplink");
4961
		m_gameExe.ParseExe("x3.exe|30:5:0:HKCU/Software/Egosoft/X3/ModName:X3 Reunion:Egosoft/X3:2:2347008:2.0 Bala Gi:2367488!2375680:2.5 Uplink");
4962
		m_gameExe.ParseExe("x3tc.exe|35:5:NO_XOR|TC_TEXT|MYDOCLOG:HKCU/Software/Egosoft/X3TC/ModName:X3 Terran Conflict:Egosoft/X3TC:3:1933464!1933520:2.0 Aldrin Expansion:-1:2.5 A New Home (Superbox):-1:3.0 Balance of Power");
4962
		m_gameExe.ParseExe("x3tc.exe|35:5:NO_XOR|TC_TEXT|MYDOCLOG:HKCU/Software/Egosoft/X3TC/ModName:X3 Terran Conflict:Egosoft/X3TC:3:1933464!1933520:2.0 Aldrin Expansion:-1:2.5 A New Home (Superbox):-1:3.0 Balance of Power");
4963
		m_gameExe.ParseExe("x3ap.exe|38:2:NO_XOR|TC_TEXT|MYDOCLOG|ADDON:HKCU/Software/Egosoft/X3AP/ModName:X3 Albion Prelude:Egosoft/X3AP:addon!x3tc.exe:3:-1:2.0 The War Continues:-1:2.5 Operation Loose Ends:-1:3.0 Shady Business");
4963
		m_gameExe.ParseExe("x3ap.exe|38:2:NO_XOR|TC_TEXT|MYDOCLOG|ADDON:HKCU/Software/Egosoft/X3AP/ModName:X3 Albion Prelude:Egosoft/X3AP:addon!x3tc.exe:3:-1:2.0 The War Continues:-1:2.5 Operation Loose Ends:-1:3.0 Shady Business");
-
 
4964
		m_gameExe.ParseExe("x3fl.exe|39:3:NO_XOR|TC_TEXT|MYDOCLOG|ADDON:HKCU/Software/Egosoft/X3FL/ModName:X3 Farnham's Legacy:Egosoft/X3FL:addon2!x3tc.exe:0");
4964
	}
4965
	}
4965
}
4966
}
4966
void CPackages::startup(const Utils::String &dir, const Utils::String &tempDir, const Utils::String &myDoc, const Utils::String &mod)
4967
void CPackages::startup(const Utils::String &dir, const Utils::String &tempDir, const Utils::String &myDoc, const Utils::String &mod)
4967
{
4968
{
4968
	startup(dir, tempDir, myDoc);
4969
	startup(dir, tempDir, myDoc);
Line 7621... Line 7622...
7621
	}
7622
	}
7622
 
7623
 
7623
	return baseFile->GeneratePackagerScript(wildcard, list, game, gameAddons, datafile);
7624
	return baseFile->GeneratePackagerScript(wildcard, list, game, gameAddons, datafile);
7624
}
7625
}
7625
 
7626
 
7626
CBaseFile *CPackages::LoadPackagerScript(const Utils::String &filename, int compression, Utils::String (*askFunc)(const Utils::String &), Utils::CStringList *malformedLines, Utils::CStringList *unknownCommands, Utils::CStringList *variables)
7627
CBaseFile *CPackages::LoadPackagerScript(const Utils::String &filename, int compression, Utils::String (*askFunc)(const Utils::String &), Utils::CStringList *malformedLines, Utils::CStringList *unknownCommands, Utils::CStringList *variables, CProgressInfo *progress)
7627
{
7628
{
7628
	// check the file exists
7629
	// check the file exists
7629
	if ( !CFileIO::Exists(filename) )
7630
	if ( !CFileIO::Exists(filename) )
7630
		return NULL;
7631
		return NULL;
7631
 
7632
 
Line 7796... Line 7797...
7796
				ftpdir = rest;
7797
				ftpdir = rest;
7797
			else if ( cmd.Compare("MultiGames") ) {
7798
			else if ( cmd.Compare("MultiGames") ) {
7798
				sMainGame = rest.token(" ", 1);
7799
				sMainGame = rest.token(" ", 1);
7799
				otherGames.tokenise(rest.tokens(" ", 2), " ");
7800
				otherGames.tokenise(rest.tokens(" ", 2), " ");
7800
			}
7801
			}
7801
			else if ( !package->LoadPackageData(cmd, rest, sMainGame, otherGames, gameAddons) )
7802
			else if ( !package->LoadPackageData(cmd, rest, sMainGame, otherGames, gameAddons, progress) )
7802
			{
7803
			{
7803
				if ( unknownCommands )
7804
				if ( unknownCommands )
7804
					unknownCommands->pushBack(cmd, rest);
7805
					unknownCommands->pushBack(cmd, rest);
7805
			}
7806
			}
7806
		}
7807
		}
7807
	}
7808
	}
7808
 
7809
 
7809
	if ( package->filename().empty() )
7810
	if ( package->filename().empty() )
7810
		package->LoadPackageData("AutoSave", "$AUTOSAVE", sMainGame, otherGames, gameAddons);
7811
		package->LoadPackageData("AutoSave", "$AUTOSAVE", sMainGame, otherGames, gameAddons, progress);
7811
 
7812
 
7812
	if (package->autoExtraction())
7813
	if (package->autoExtraction())
7813
	{
7814
	{
7814
		for (auto itr = package->autoExtraction()->begin(); itr != package->autoExtraction()->end(); itr++)
7815
		for (auto itr = package->autoExtraction()->begin(); itr != package->autoExtraction()->end(); itr++)
7815
		{
7816
		{
Line 8979... Line 8980...
8979
			}
8980
			}
8980
 
8981
 
8981
			// now check type name
8982
			// now check type name
8982
			int filetype = GetFileTypeFromString(checkType);
8983
			int filetype = GetFileTypeFromString(checkType);
8983
			if ( filetype == -1 )
8984
			if ( filetype == -1 )
8984
				archive->LoadPackageData(first.ToString(), rest.ToString(), Utils::String::Null(), otherGames, gameAddons);
8985
				archive->LoadPackageData(first.ToString(), rest.ToString(), Utils::String::Null(), otherGames, gameAddons, NULL);
8985
		}
8986
		}
8986
	}
8987
	}
8987
 
8988
 
8988
	CLEANSPLIT(str, max)
8989
	CLEANSPLIT(str, max)
8989
}
8990
}
Line 9248... Line 9249...
9248
 
9249
 
9249
	// write script
9250
	// write script
9250
	if ( package->WriteFile(saveto) )
9251
	if ( package->WriteFile(saveto) )
9251
	{
9252
	{
9252
		if ( package->AutoGenerateUpdateFile() )
9253
		if ( package->AutoGenerateUpdateFile() )
9253
			package->CreateUpdateFile(CFileIO(saveto).dir());
9254
			package->createUpdateFile(CFileIO(saveto).dir());
9254
		return saveto;
9255
		return saveto;
9255
	}
9256
	}
9256
 
9257
 
9257
	return Utils::String::Null();
9258
	return Utils::String::Null();
9258
}
9259
}
Line 9280... Line 9281...
9280
				CBaseFile *p = packages.OpenPackage(Dir.file((*itr)->str), &error, 0, SPKREAD_NODATA);
9281
				CBaseFile *p = packages.OpenPackage(Dir.file((*itr)->str), &error, 0, SPKREAD_NODATA);
9281
				if ( !p )
9282
				if ( !p )
9282
					continue;
9283
					continue;
9283
 
9284
 
9284
				if ( includeSingle )
9285
				if ( includeSingle )
9285
					p->CreateUpdateFile(dir);
9286
					p->createUpdateFile(dir.ToString());
9286
				filedata.pushBack(CPackages::FormatAvailablePackageData(p));
9287
				filedata.pushBack(CPackages::FormatAvailablePackageData(p));
9287
				delete p;
9288
				delete p;
9288
			}
9289
			}
9289
		}
9290
		}
9290
	}
9291
	}