Subversion Repositories spk

Rev

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

Rev 126 Rev 127
Line 249... Line 249...
249
			continue;
249
			continue;
250
		if ( f->GetName() != file->GetName () )
250
		if ( f->GetName() != file->GetName () )
251
			continue;
251
			continue;
252
		if ( f->GetDir() != file->GetDir() )
252
		if ( f->GetDir() != file->GetDir() )
253
			continue;
253
			continue;
254
		if ( f->GetGame() != file->GetGame() )
254
		if ( f->game() != file->game() )
255
			continue;
255
			continue;
256
 
256
 
257
		m_lFiles.remove(node, true);
257
		m_lFiles.remove(node, true);
258
		break;
258
		break;
259
	}
259
	}
260
 
260
 
261
	_addFile(file);
261
	_addFile(file);
262
}
262
}
263
 
263
 
264
C_File *CBaseFile::AddFile ( CyString file, CyString dir, int type, int game )
264
C_File *CBaseFile::AddFile(CyString file, CyString dir, int type, int game)
265
{
265
{
-
 
266
	return addFile(file.ToString(), dir.ToString(), (FileType)type, game);
-
 
267
}
-
 
268
C_File *CBaseFile::addFile(const Utils::String &file, const Utils::String &dir, FileType type, int game)
-
 
269
{
266
	C_File *newfile = new C_File ( file );
270
	C_File *newfile = new C_File(file);
267
	newfile->SetDir ( dir );
271
	newfile->SetDir(dir);
268
	newfile->SetFileType ( type );
272
	newfile->SetFileType(type);
269
	newfile->SetGame(game);
273
	newfile->setGame(game);
270
 
274
 
271
	// first check if the file already exists
275
	// first check if the file already exists
272
	for ( CListNode<C_File> *node = m_lFiles.Front(); node; node = node->next() )
276
	for ( CListNode<C_File> *node = m_lFiles.Front(); node; node = node->next() )
273
	{
277
	{
274
		C_File *f = node->Data();
278
		C_File *f = node->Data();
275
		if ( f->GetFileType() != newfile->GetFileType() )
279
		if ( f->GetFileType() != newfile->GetFileType() )
276
			continue;
280
			continue;
277
		if ( f->GetName() != newfile->GetName () )
281
		if ( f->GetName() != newfile->GetName () )
278
			continue;
282
			continue;
279
		if ( f->GetDir() != newfile->GetDir() )
283
		if ( f->GetDir() != newfile->GetDir() )
280
			continue;
284
			continue;
281
		if ( f->GetGame() != newfile->GetGame() )
285
		if ( f->game() != newfile->game() )
282
			continue;
286
			continue;
283
 
287
 
284
		// must already exist, delete this one
288
		// must already exist, delete this one
285
		m_lFiles.remove(node, true);
289
		m_lFiles.remove(node, true);
286
		break;
290
		break;
287
	}
291
	}
288
 
292
 
289
	_addFile(newfile);
293
	_addFile(newfile);
290
 
294
 
291
	return newfile;
295
	return newfile;
292
}
296
}
293
 
297
 
294
bool CBaseFile::AddFileNow ( CyString file, CyString dir, int type, CProgressInfo *progress )
298
bool CBaseFile::AddFileNow ( CyString file, CyString dir, int type, CProgressInfo *progress )
295
{
299
{
296
	C_File *f = AddFile ( file, dir, type );
300
	C_File *f = AddFile ( file, dir, type );
297
	if ( !f->ReadFromFile () )
301
	if ( !f->ReadFromFile () )
298
		return false;
302
		return false;
299
 
303
 
300
	// compress the file
304
	// compress the file
301
	return f->CompressData ( m_SHeader2.iDataCompression, progress );
305
	return f->CompressData ( m_SHeader2.iDataCompression, progress );
302
}
306
}
303
 
307
 
Line 305... Line 309...
305
{
309
{
306
	C_File *newfile = AddFile ( file, dir, type, game );
310
	C_File *newfile = AddFile ( file, dir, type, game );
307
	if ( !newfile )
311
	if ( !newfile )
308
		return NULL;
312
		return NULL;
309
 
313
 
310
 
314
 
311
	// read the file into memory
315
	// read the file into memory
312
	if ( newfile->ReadFromFile () )
316
	if ( newfile->ReadFromFile () )
313
	{
317
	{
314
		// now compress the file
318
		// now compress the file
315
		if ( newfile->CompressData ( m_SHeader2.iDataCompression, progress ) )
319
		if ( newfile->CompressData ( m_SHeader2.iDataCompression, progress ) )
316
			return newfile;
320
			return newfile;
317
	}
321
	}
318
	else if ( newfile->GetLastError() == SPKERR_MALLOC )
322
	else if ( newfile->GetLastError() == SPKERR_MALLOC )
319
	{
323
	{
320
		if ( newfile->CompressFile ( progress ) )
324
		if ( newfile->CompressFile ( progress ) )
321
			return newfile;
325
			return newfile;
322
	}
326
	}
323
 
327
 
324
	m_lFiles.pop_back ();
328
	m_lFiles.pop_back ();
325
	delete newfile;
329
	delete newfile;
326
 
330
 
327
	return NULL;
331
	return NULL;
328
}
332
}
329
 
333
 
330
C_File *CBaseFile::FindFileAt ( int filetype, int pos )
334
C_File *CBaseFile::FindFileAt ( int filetype, int pos )
331
{
335
{
332
	int count = 0;
336
	int count = 0;
333
	for ( CListNode<C_File> *node = m_lFiles.Front(); node; node = node->next() )
337
	for ( CListNode<C_File> *node = m_lFiles.Front(); node; node = node->next() )
334
	{
338
	{
335
		C_File *file = node->Data();
339
		C_File *file = node->Data();
336
		if ( file->GetFileType() != filetype )
340
		if ( file->GetFileType() != filetype )
337
			continue;
341
			continue;
338
 
342
 
339
		if ( count == pos )
343
		if ( count == pos )
340
			return file;
344
			return file;
341
 
345
 
342
		++count;
346
		++count;
343
	}
347
	}
Line 347... Line 351...
347
 
351
 
348
C_File *CBaseFile::FindFile ( CyString filename, int type, CyString dir, int game )
352
C_File *CBaseFile::FindFile ( CyString filename, int type, CyString dir, int game )
349
{
353
{
350
	CyString lfile = filename.ToLower();
354
	CyString lfile = filename.ToLower();
351
	lfile = lfile.FindReplace ( "\\", "/" );
355
	lfile = lfile.FindReplace ( "\\", "/" );
352
 
356
 
353
	lfile = lfile.GetToken ( lfile.NumToken('/'), '/' );
357
	lfile = lfile.GetToken ( lfile.NumToken('/'), '/' );
354
 
358
 
355
	CListNode<C_File> *node = m_lFiles.Front();
359
	CListNode<C_File> *node = m_lFiles.Front();
356
	while ( node )
360
	while ( node )
357
	{
361
	{
358
		C_File *f = node->Data();
362
		C_File *f = node->Data();
359
		node = node->next();
363
		node = node->next();
360
 
364
 
361
		if ( type != f->GetFileType() )
365
		if ( type != f->GetFileType() )
362
			continue;
366
			continue;
363
		if ( dir != f->GetDir() )
367
		if ( dir != f->GetDir() )
364
			continue;
368
			continue;
365
		if ( game != f->GetGame() )
369
		if ( game != f->game() )
366
			continue;
370
			continue;
367
		if ( f->GetName().ToLower() == lfile )
371
		if ( f->GetName().ToLower() == lfile )
368
			return f;
372
			return f;
369
	}
373
	}
370
	return NULL;
374
	return NULL;
Line 481... Line 485...
481
		bool uncomprToFile = false;
485
		bool uncomprToFile = false;
482
 
486
 
483
		if ( progress )
487
		if ( progress )
484
			progress->SwitchSecond();
488
			progress->SwitchSecond();
485
 
489
 
486
		if ( !fit->UncompressData ( progress ) )
490
		if(!fit->isExternalFile())
487
		{
491
		{
488
			if ( fit->GetCompressionType() == SPKCOMPRESS_7ZIP )
492
			if (!fit->UncompressData(progress))
489
			{
493
			{
490
				if ( !fit-&gt;UncompressToFile ( "temp", this, false, progress ) )
494
				if (fit-&gt;GetCompressionType() == SPKCOMPRESS_7ZIP)
491
					return false;
-
 
492
				else
-
 
493
				{
495
				{
-
 
496
					if (!fit->UncompressToFile("temp", this, false, progress))
-
 
497
						return false;
-
 
498
					else
-
 
499
					{
494
					uncomprToFile = true;
500
						uncomprToFile = true;
495
					fit->SetFullDir ( "temp" );
501
						fit->SetFullDir("temp");
-
 
502
					}
496
				}
503
				}
497
			}
-
 
498
 
504
 
499
			if ( !uncomprToFile )
505
				if (!uncomprToFile)
500
				return false;
506
					return false;
-
 
507
			}
501
		}
508
		}
502
 
509
 
503
		if ( progress )
510
		if ( progress )
504
			progress->SwitchSecond();
511
			progress->SwitchSecond();
505
	}
512
	}
Line 955... Line 962...
955
		C_File checkfile;
962
		C_File checkfile;
956
		CyString checkfilename = sDestination;
963
		CyString checkfilename = sDestination;
957
		if ( !checkfilename.Empty() ) checkfilename += "/";
964
		if ( !checkfilename.Empty() ) checkfilename += "/";
958
		checkfilename += pFile->GetNameDirectory(this);
965
		checkfilename += pFile->GetNameDirectory(this);
959
		checkfile.SetFilename ( checkfilename );
966
		checkfile.SetFilename ( checkfilename );
960
		checkfile.SetFileType ( pFile->GetFileType() );
967
		checkfile.setFileType(pFile->fileType());
961
		if ( checkfile.CheckValidFilePointer() ) {
968
		if ( checkfile.CheckValidFilePointer() ) {
962
			if ( checkfile.ReadScriptVersion() > pFile->GetVersion() ) {
969
			if ( checkfile.ReadScriptVersion() > pFile->GetVersion() ) {
963
				CLog::log(CLog::Log_Install, 1, "Newer version of the file found in directory, skipping");
970
				CLog::log(CLog::Log_Install, 1, "Newer version of the file found in directory, skipping");
964
				return false;
971
				return false;
965
			}
972
			}
Line 1297... Line 1304...
1297
		if ( adjustPointer )
1304
		if ( adjustPointer )
1298
		{
1305
		{
1299
			CLog::log(CLog::Log_Install, 2, "Adjusting pointers to existing file and deleting new file pointer");
1306
			CLog::log(CLog::Log_Install, 2, "Adjusting pointers to existing file and deleting new file pointer");
1300
			node->ChangeData(adjustPointer);
1307
			node->ChangeData(adjustPointer);
1301
			delete fit;
1308
			delete fit;
1302
		}
1309
		}
1303
 
1310
 
1304
		CLog::log(CLog::Log_Install, 1, "File installation completed");
1311
		CLog::log(CLog::Log_Install, 1, "File installation completed");
1305
	}
1312
	}
1306
 
1313
 
1307
	// now clear or data memory
1314
	// now clear or data memory
1308
	CLog::log(CLog::Log_Install, 2, "Delting temporary file data from memory");
1315
	CLog::log(CLog::Log_Install, 2, "Delting temporary file data from memory");
Line 1383... Line 1390...
1383
		}
1390
		}
1384
	}
1391
	}
1385
	else if ( first.Compare("GameVersion:") ) {
1392
	else if ( first.Compare("GameVersion:") ) {
1386
		if ( m_lGames.Back() ) {
1393
		if ( m_lGames.Back() ) {
1387
			m_lGames.Back()->Data()->iVersion = rest;
1394
			m_lGames.Back()->Data()->iVersion = rest;
1388
		}
1395
		}
1389
	}
1396
	}
1390
	else if ( first.Compare("Game:") )
1397
	else if ( first.Compare("Game:") )
1391
		this->AddGameCompatability(rest, "");
1398
		this->AddGameCompatability(rest, "");
1392
	else if ( first.Compare("GameCompat:") )
1399
	else if ( first.Compare("GameCompat:") )
1393
		this->AddGameCompatability(rest.token(" ", 1), rest.tokens(" ", 2));
1400
		this->AddGameCompatability(rest.token(" ", 1), rest.tokens(" ", 2));
1394
	else if ( first.Compare("GameCompatExact:") )
1401
	else if ( first.Compare("GameCompatExact:") )
Line 1460... Line 1467...
1460
	Func:   ParseFilesLine
1467
	Func:   ParseFilesLine
1461
	Input:  String - single line from a file to set
1468
	Input:  String - single line from a file to set
1462
	Return: Boolean - returns true if value exists
1469
	Return: Boolean - returns true if value exists
1463
	Desc:   Reads the line and assigns the parameters for the file
1470
	Desc:   Reads the line and assigns the parameters for the file
1464
*/
1471
*/
1465
bool CBaseFile::ParseFilesLine ( CyString line )
1472
bool CBaseFile::ParseFilesLine ( CyString sLine )
1466
{
1473
{
-
 
1474
	Utils::String line = sLine.ToString();
-
 
1475
 
1467
	if ( !line.IsIn(":") )
1476
	if ( !line.contains(":") )
1468
		return false;
1477
		return false;
1469
 
1478
 
1470
	CyString command = line.GetToken ( 1, &apos;:&apos; );
1479
	Utils::String command = line.token(&quot;:&quot;, 1);
1471
 
1480
 
1472
	long size = line.GetToken ( 2, ':&apos;).ToInt ();
1481
	long size = line.token(":&quot;, 2).toInt();
1473
	long usize = line.GetToken ( 3, ':&apos;).ToInt ();
1482
	long usize = line.token(":&quot;, 3).toInt ();
1474
	long compression = line.GetToken ( 4, ':&apos;).ToInt ();
1483
	long compression = line.token(":&quot;, 4).toInt ();
1475
 
1484
 
1476
	if ( command == "Icon" )
1485
	if ( command == "Icon" )
1477
	{
1486
	{
1478
		m_sIconExt = line.GetToken ( 5, &apos;:&apos; );
1487
		m_sIconExt = line.token (&quot;:&quot;, 5);
1479
		m_pIconFile = new C_File ();
1488
		m_pIconFile = new C_File ();
1480
		m_pIconFile->SetDataSize ( size - 4 );
1489
		m_pIconFile->SetDataSize ( size - 4 );
1481
		m_pIconFile->SetDataCompression ( compression );
1490
		m_pIconFile->SetDataCompression ( compression );
1482
		m_pIconFile->SetUncompressedDataSize ( usize );
1491
		m_pIconFile->SetUncompressedDataSize ( usize );
1483
 
1492
 
1484
		return true;
1493
		return true;
1485
	}
1494
	}
1486
 
1495
 
1487
	time_t time = line.GetToken ( 5,&apos;:&apos; ).ToLong();
1496
	time_t time = line.token(&quot;:&quot;, 5).toLong();
1488
	bool compressToFile = (line.GetToken ( 6, ':&apos;).ToInt() == 1) ? true : false;
1497
	bool compressToFile = (line.token(":&quot;, 6).toInt() == 1) ? true : false;
1489
	CyString name  = line.GetToken ( 7, &apos;:&apos; );
1498
	Utils::String name  = line.token(&quot;:&quot;, 7);
1490
	CyString dir = line.GetToken ( 8, &apos;:&apos; );
1499
	Utils::String dir = line.token(&quot;:&quot;, 8);
1491
 
1500
 
1492
	if ( name.Empty() )
1501
	if ( name.empty() )
1493
		return true;
1502
		return true;
1494
 
1503
 
1495
	bool shared = false;
1504
	bool shared = false;
1496
	if ( command.Left(1) == "$" )
1505
	if ( command.left(1) == "$" )
1497
	{
1506
	{
1498
		shared = true;
1507
		shared = true;
1499
		command.Erase ( 0, 1 );
1508
		command.erase(0, 1);
1500
	}
1509
	}
1501
 
1510
 
1502
	int type = -1;
1511
	FileType type = FILETYPE_UNKNOWN;
1503
	if ( command == "Script" )
1512
	if ( command == "Script" )
1504
		type = FILETYPE_SCRIPT;
1513
		type = FILETYPE_SCRIPT;
1505
	else if ( command == "Text" )
1514
	else if ( command == "Text" )
1506
		type = FILETYPE_TEXT;
1515
		type = FILETYPE_TEXT;
1507
	else if ( command == "Readme" )
1516
	else if ( command == "Readme" )
Line 1531... Line 1540...
1531
	else if ( command == "ShipOther" )
1540
	else if ( command == "ShipOther" )
1532
		type = FILETYPE_SHIPOTHER;
1541
		type = FILETYPE_SHIPOTHER;
1533
	else if ( command == "ShipModel" )
1542
	else if ( command == "ShipModel" )
1534
		type = FILETYPE_SHIPMODEL;
1543
		type = FILETYPE_SHIPMODEL;
1535
 
1544
 
1536
	if ( type == -1 )
1545
	if (type == FILETYPE_UNKNOWN)
1537
		return false;
1546
		return false;
1538
 
1547
 
1539
	C_File *file = new C_File ();
1548
	C_File *file = new C_File();
1540
 
1549
 
1541
	if ( dir.Left(5).Compare("GAME_") ) {
1550
	if (dir.left(5).Compare("GAME_")) {
1542
		file->SetGame(dir.GetToken("_", 2, 2).ToInt());
1551
		file->setGame(1 << 31 | 1 << dir.token("_", 2).toInt());
1543
		dir = NullString;
1552
		dir = Utils::String::Null();
1544
	} 
1553
	} 
1545
	else if ( line.NumToken(":") >= 9 ) {
1554
	else if ( line.countToken(":") >= 9 ) 
-
 
1555
	{
-
 
1556
		Utils::String game = line.token(":", 9);
-
 
1557
		if (game.contains("_"))
1546
		file->SetGame(line.GetToken(":", 9, 9).GetToken(&quot;_", 2, 2).ToInt());
1558
			file->setGame(1 << 31 | 1 << game.token(&quot;_", 2).toInt());
-
 
1559
		else
-
 
1560
		{
-
 
1561
			int iGame = game.toInt();
-
 
1562
			if (iGame & (1 << 31))
-
 
1563
				file->setGame(iGame);
-
 
1564
			else
-
 
1565
				file->setGame(1 << 31 | 1 << iGame);
-
 
1566
		}
-
 
1567
	}
-
 
1568
 
-
 
1569
	if (dir.Compare("NULL")) {
-
 
1570
		dir = Utils::String::Null();
1547
	}
1571
	}
1548
 
1572
 
1549
	file->SetFileType ( type );
1573
	file->setFileType(type);
1550
	file->SetCreationTime ( time );
1574
	file->SetCreationTime ( time );
1551
	file->SetName ( name );
1575
	file->SetName ( name );
1552
	file->SetDir ( dir );
1576
	file->SetDir ( dir );
1553
	file->SetDataSize ( size - 4 );
1577
	file->SetDataSize ( size - 4 );
1554
	file->SetDataCompression ( compression );
1578
	file->SetDataCompression ( compression );
Line 1569... Line 1593...
1569
*/
1593
*/
1570
void CBaseFile::ReadFiles ( CyString values )
1594
void CBaseFile::ReadFiles ( CyString values )
1571
{
1595
{
1572
	int num = 0;
1596
	int num = 0;
1573
	CyString *lines = values.SplitToken ( '\n', &num );
1597
	CyString *lines = values.SplitToken ( '\n', &num );
1574
 
1598
 
1575
	for ( int i = 0; i < num; i++ )
1599
	for ( int i = 0; i < num; i++ )
1576
		ParseFilesLine ( lines[i] );
1600
		ParseFilesLine ( lines[i] );
1577
 
1601
 
1578
	CLEANSPLIT(lines, num)
1602
	CLEANSPLIT(lines, num)
1579
}
1603
}
1580
 
1604
 
1581
 
1605
 
1582
 
1606
 
1583
/*
1607
/*
1584
	Func:   ReadFile
1608
	Func:   ReadFile
1585
	Input:  filename - the name of the file to open and read
1609
	Input:  filename - the name of the file to open and read
1586
			readdata - If falses, dont read the files to memory, just read the headers and values
1610
			readdata - If falses, dont read the files to memory, just read the headers and values
1587
	Return: boolean - return ture if acceptable format
1611
	Return: boolean - return ture if acceptable format
Line 1661... Line 1685...
1661
		readData = new unsigned char[m_SHeader2.lSize];
1685
		readData = new unsigned char[m_SHeader2.lSize];
1662
	}
1686
	}
1663
	catch (std::exception &e) {
1687
	catch (std::exception &e) {
1664
		CLog::logf(CLog::Log_IO, 2, "CBaseFile::_read_FileHeader() unable to malloc [header], %d (%s)", m_SHeader2.lSize, e.what());
1688
		CLog::logf(CLog::Log_IO, 2, "CBaseFile::_read_FileHeader() unable to malloc [header], %d (%s)", m_SHeader2.lSize, e.what());
1665
		return -1;
1689
		return -1;
1666
	}
1690
	}
1667
 
1691
 
1668
	unsigned char size[4];
1692
	unsigned char size[4];
1669
	File.read(size, 4);
1693
	File.read(size, 4);
1670
	File.read(readData, m_SHeader2.lSize);
1694
	File.read(readData, m_SHeader2.lSize);
1671
 
1695
 
1672
	unsigned long uncomprLen = (size[0] << 24) + (size[1] << 16) + (size[2] << 8) + size[3];
1696
	unsigned long uncomprLen = (size[0] << 24) + (size[1] << 16) + (size[2] << 8) + size[3];
Line 2253... Line 2277...
2253
 
2277
 
2254
	if ( !version.empty() )	this->AddNeededLibrary("<package>", "<author>", version);
2278
	if ( !version.empty() )	this->AddNeededLibrary("<package>", "<author>", version);
2255
}
2279
}
2256
 
2280
 
2257
 
2281
 
2258
bool CBaseFile::GeneratePackagerScript(bool wildcard, Utils::CStringList *list, int game, bool datafile)
2282
bool CBaseFile::GeneratePackagerScript(bool wildcard, Utils::CStringList *list, int game, const Utils::CStringList &gameAddons, bool datafile)
2259
{
2283
{
2260
	list->pushBack("#");
2284
	list->pushBack("#");
2261
	list->pushBack("# Packager Script");
2285
	list->pushBack("# Packager Script");
2262
	list->pushBack("# -- Generated by SPK Libraries V" + Utils::String::FromFloat(GetLibraryVersion(), 2) + " --");
2286
	list->pushBack("# -- Generated by SPK Libraries V" + Utils::String::FromFloat(GetLibraryVersion(), 2) + " --");
2263
	list->pushBack("#");
2287
	list->pushBack("#");
Line 2423... Line 2447...
2423
	list->pushBack("");
2447
	list->pushBack("");
2424
 
2448
 
2425
	return true;
2449
	return true;
2426
}
2450
}
2427
 
2451
 
2428
bool CBaseFile::GeneratePackagerScriptFile(bool wildcard, Utils::CStringList *list, int game)
2452
bool CBaseFile::GeneratePackagerScriptFile(bool wildcard, Utils::CStringList *list, int game, const Utils::CStringList &gameAddons)
2429
{
2453
{
2430
	// now do files and wildcards
2454
	// now do files and wildcards
2431
	Utils::CStringList files;
2455
	Utils::CStringList files;
2432
	for ( CListNode<C_File> *f = m_lFiles.Front(); f; f = f->next() )
2456
	for ( CListNode<C_File> *f = m_lFiles.Front(); f; f = f->next() )
2433
	{
2457
	{
2434
		if (game && f->;Data()-&gt;GetGame() != game)
2458
		if (game && !(f->Data()->;game() & 1 <&lt; game))
2435
			continue;
2459
			continue;
2436
 
2460
 
2437
		Utils::String name = "$GAMEDIR/";
2461
		Utils::String name = "$GAMEDIR/";
-
 
2462
 
-
 
2463
		// addon directory?
-
 
2464
		unsigned int checkGame = f->Data()->game() & ~(1 << 31);
-
 
2465
		unsigned int foundGame = 0;
-
 
2466
		for (int i = 0; i < 31; ++i)
-
 
2467
		{
-
 
2468
			if (checkGame == 1 << i)
-
 
2469
			{
-
 
2470
				foundGame = i;
-
 
2471
				break;
-
 
2472
			}
-
 
2473
		}
-
 
2474
 
-
 
2475
		if (foundGame)
-
 
2476
		{
-
 
2477
			Utils::String str = gameAddons.findString(Utils::String::Number(foundGame));
-
 
2478
			if(!str.empty())
-
 
2479
				name += str + "/";
-
 
2480
		}
2438
 
2481
 
2439
		bool done = false;
2482
		bool done = false;
2440
		if ( wildcard )
2483
		if ( wildcard )
2441
		{
2484
		{
2442
			Utils::String base = f->Data()->GetBaseName().ToString();
2485
			Utils::String base = f->Data()->GetBaseName().ToString();
Line 2474... Line 2517...
2474
		if ( !f->Data()->GetDir().Empty() )
2517
		if ( !f->Data()->GetDir().Empty() )
2475
		{
2518
		{
2476
			name += "|";
2519
			name += "|";
2477
			name += f->Data()->GetDir().ToString();
2520
			name += f->Data()->GetDir().ToString();
2478
		}
2521
		}
-
 
2522
		Utils::String s = "GAME ";
-
 
2523
		if (!f->Data()->game() || f->Data()->game() == GAME_ALLNEW)
2479
		Utils::String s = "GAME " + CBaseFile::ConvertGameToString(f->Data()->;GetGame()) + " &quot; + name;
2524
			s += CBaseFile::ConvertGameToString(f->;Data()-&gt;game());
-
 
2525
		else
-
 
2526
		{
-
 
2527
			bool first = true;
-
 
2528
			for (int i = 0; i < 31; ++i) 
-
 
2529
			{
-
 
2530
				if (f->Data()->game() & 1 << i)
-
 
2531
				{
-
 
2532
					if (first)
-
 
2533
						first = false;
-
 
2534
					else
-
 
2535
						s += "|";
-
 
2536
					s += CBaseFile::ConvertGameToString(i);
-
 
2537
				}
-
 
2538
			}
-
 
2539
		}
-
 
2540
 
-
 
2541
		s += " " + name;
2480
		if(!files.contains(s))
2542
		if(!files.contains(s))
2481
			files.pushBack(s, f->Data()->GetFileTypeString().ToString());
2543
			files.pushBack(s, f->Data()->GetFileTypeString().ToString());
2482
	}
2544
	}
2483
 
2545
 
2484
 
2546
 
2485
	if ( !files.empty() )
2547
	if ( !files.empty() )
2486
	{
2548
	{
2487
		list->pushBack("# Files List, all the files to add, can include wild cards");
2549
		list->pushBack("# Files List, all the files to add, can include wild cards");
2488
		for(auto itr = files.begin(); itr != files.end(); itr++)
2550
		for(auto itr = files.begin(); itr != files.end(); itr++)
2489
			list->pushBack((*itr)->data + ": " + (*itr)->str);
2551
			list->pushBack((*itr)->data + ": " + (*itr)->str);
2490
		list->pushBack("");
2552
		list->pushBack("");
2491
	}
2553
	}
2492
 
2554
 
2493
	return true;
2555
	return true;
2494
}
2556
}
2495
 
2557
 
2496
Utils::String CBaseFile::GetAutosaveName()
2558
Utils::String CBaseFile::GetAutosaveName()
2497
{
2559
{
2498
	return this->name() + "-V" + this->version() + "-" + this->creationDate().findReplace("/", ".");
2560
	return this->name() + "-V" + this->version() + "-" + this->creationDate().findReplace("/", ".");
2499
}
2561
}
2500
 
2562
 
2501
bool CBaseFile::CheckGameCompatability(int game)
2563
bool CBaseFile::CheckGameCompatability(int game)
2502
{
2564
{
2503
	if ( m_lGames.empty() )
2565
	if ( m_lGames.empty() )
2504
		return true; // no game compatability added, assume its ok for all
2566
		return true; // no game compatability added, assume its ok for all
2505
 
2567
 
2506
	for ( CListNode<SGameCompat> *node = m_lGames.Front(); node; node = node->next() ) {
2568
	for ( CListNode<SGameCompat> *node = m_lGames.Front(); node; node = node->next() ) {
2507
		if ( node->Data()->iGame == 0 || node->Data()->iGame == game )
2569
		if ( node->Data()->iGame == 0 || node->Data()->iGame == game )
2508
			return true;
2570
			return true;
2509
	}
2571
	}
2510
	return false;
2572
	return false;
2511
}
2573
}
2512
 
2574
 
2513
bool CBaseFile::CheckGameVersionCompatability(int game, CyString sVersion, int iVersion)
2575
bool CBaseFile::CheckGameVersionCompatability(int game, CyString sVersion, int iVersion)
2514
{
2576
{
2515
	if ( m_lGames.empty() )
2577
	if ( m_lGames.empty() )
2516
		return true; // no game compatability added, assume its ok for all
2578
		return true; // no game compatability added, assume its ok for all
2517
 
2579
 
Line 2531... Line 2593...
2531
				return true;
2593
				return true;
2532
			}
2594
			}
2533
		}
2595
		}
2534
	}
2596
	}
2535
	return foundAll;
2597
	return foundAll;
2536
}
2598
}
2537
 
2599
 
2538
bool CBaseFile::RemoveGameCompatability(int game)
2600
bool CBaseFile::RemoveGameCompatability(int game)
2539
{
2601
{
2540
	for ( CListNode<SGameCompat> *node = m_lGames.Front(); node; node = node->next() ) {
2602
	for ( CListNode<SGameCompat> *node = m_lGames.Front(); node; node = node->next() ) {
2541
		if ( node->Data()->iGame == game ) {
2603
		if ( node->Data()->iGame == game ) {
Line 2577... Line 2639...
2577
	else
2639
	else
2578
		Found->iVersion = version;
2640
		Found->iVersion = version;
2579
	_changed();
2641
	_changed();
2580
}
2642
}
2581
 
2643
 
2582
bool CBaseFile::LoadPackageData(const Utils::String &sFirst, const Utils::String &sRest, const Utils::String &sMainGame, Utils::CStringList &otherGames)
2644
bool CBaseFile::LoadPackageData(const Utils::String &sFirst, const Utils::String &sRest, const Utils::String &sMainGame, Utils::CStringList &otherGames, Utils::CStringList &gameAddons)
2583
{
2645
{
2584
	if ( sFirst.Compare("Name") )					this->setName(sRest);
2646
	if ( sFirst.Compare("Name") )					this->setName(sRest);
2585
	else if ( sFirst.Compare("Author") )			this->setAuthor(sRest);
2647
	else if ( sFirst.Compare("Author") )			this->setAuthor(sRest);
2586
	else if ( sFirst.Compare("ScriptName") )
2648
	else if ( sFirst.Compare("ScriptName") )
2587
		AddLanguageName(ParseLanguage(sRest.token(" ", 1)), sRest.tokens(" ", 2));
2649
		AddLanguageName(ParseLanguage(sRest.token(" ", 1)), sRest.tokens(" ", 2));
Line 2683... Line 2745...
2683
			checkType = sFirst.right(-6);
2745
			checkType = sFirst.right(-6);
2684
			shared = true;
2746
			shared = true;
2685
		}
2747
		}
2686
 
2748
 
2687
		// now check type name
2749
		// now check type name
2688
		int filetype = GetFileTypeFromString(checkType);
2750
		FileType filetype = GetFileTypeFromString(checkType);
2689
		if ( filetype != -1 )
2751
		if (filetype != FILETYPE_UNKNOWN)
2690
			this->AddFileScript(filetype, shared, sRest, sMainGame, otherGames);
2752
			this->AddFileScript(filetype, shared, sRest, sMainGame, otherGames, gameAddons);
2691
		else if ( !checkType.Compare("changelog") )
2753
		else if ( !checkType.Compare("changelog") )
2692
			return false;
2754
			return false;
2693
	}
2755
	}
2694
 
2756
 
2695
	return true;
2757
	return true;
2696
}
2758
}
2697
 
2759
 
2698
void CBaseFile::AddFileScript(int filetype, bool shared, CyString rest, const Utils::String &sMainGame, Utils::CStringList &otherGames)
2760
void CBaseFile::AddFileScript(FileType filetype, bool shared, CyString sRest, const Utils::String &sMainGame, Utils::CStringList &otherGames, Utils::CStringList &gameAddons)
2699
{
2761
{
2700
	CyString dir;
2762
	Utils::String dir;
2701
	if ( rest.IsIn("|") )
-
 
2702
	{
-
 
2703
		dir = rest.GetToken("|", 2);
2763
	Utils::String rest = sRest.ToString();
2704
		rest = rest.GetToken("|", 1, 1);
-
 
2705
	}
-
 
2706
 
-
 
2707
	int mainGame = CBaseFile::GetGameFromString(sMainGame);
-
 
2708
 
2764
 
-
 
2765
	unsigned int mainGame = CBaseFile::GetGameFromString(sMainGame);
2709
	int game = 0;
2766
	unsigned int game = 0;
2710
	if ( rest.GetToken(" ", 1, 1).Left(4).Compare("GAME") ) {
2767
	if ( rest.token(" ", 1).left(4).Compare("GAME") ) {
-
 
2768
		Utils::String gameStr = rest.token(" ", 2);
-
 
2769
		if (gameStr.contains("|"))
-
 
2770
		{
-
 
2771
			int max = 0;
-
 
2772
			Utils::String *games = gameStr.tokenise("|", &max);
-
 
2773
			for (int i = 0; i < max; ++i)
-
 
2774
			{
-
 
2775
				unsigned int g = CBaseFile::GetGameFromString(games[i]);
-
 
2776
				if (g)
-
 
2777
					game |= 1 << g;
-
 
2778
			}
-
 
2779
			CLEANSPLIT(games, max);
-
 
2780
		}
-
 
2781
		else
2711
		game = CBaseFile::GetGameFromString(rest.GetToken(" ", 2, 2).ToString());
2782
			game = 1 << CBaseFile::GetGameFromString(gameStr);
2712
		rest = rest.GetToken(" ", 3);
2783
		rest = rest.tokens(" ", 3);
-
 
2784
	}
-
 
2785
	if (game)
-
 
2786
		game |= 1 << 31;
-
 
2787
 
-
 
2788
	if (rest.contains("|"))
-
 
2789
	{
-
 
2790
		dir = rest.tokens("|", 2);
-
 
2791
		rest = rest.token("|", 1);
2713
	}
2792
	}
2714
 
2793
 
2715
	rest = rest.FindReplace("\\", "/");
2794
	rest = rest.findReplace("\\", "/");
2716
 
2795
 
2717
	// wild cards
2796
	// wild cards
2718
	if ( rest.IsAnyIn("*?") )
2797
	if ( rest.containsAny("*?") )
2719
	{
2798
	{
2720
		CDirIO Dir(CFileIO(rest).dir());
2799
		CDirIO Dir(CFileIO(rest).dir());
2721
		CyStringList *dirList = Dir.DirList();
2800
		CyStringList *dirList = Dir.DirList();
2722
		if ( dirList )
2801
		if ( dirList )
2723
		{
2802
		{
2724
			for ( SStringList *strNode = dirList->Head(); strNode; strNode = strNode->next )
2803
			for ( SStringList *strNode = dirList->Head(); strNode; strNode = strNode->next )
2725
			{
2804
			{
2726
				CyString file = Dir.File(strNode->str);
2805
				Utils::String file = Dir.file(strNode->str.ToString());
2727
				if ( file.WildMatch(rest) )
2806
				if (file.match(rest))
2728
				{
2807
				{
2729
					int addGame = game;
2808
					int addGame = game;
2730
					// check if the file exists in the subdirectory too, if it does, add for each game
2809
					// check if the file exists in the subdirectory too, if it does, add for each game
2731
					if ( game == GAME_ALL && !sMainGame.empty() && !otherGames.empty() ) {
2810
					if ( game == GAME_ALL && !sMainGame.empty() && !otherGames.empty() ) {
2732
						CFileIO F(file);
2811
						CFileIO F(file);
Line 2748... Line 2827...
2748
			delete dirList;
2827
			delete dirList;
2749
		}
2828
		}
2750
	}
2829
	}
2751
	else
2830
	else
2752
	{
2831
	{
2753
		int addGame = game;
2832
		unsigned int addGame = game;
2754
		// check if the file exists in the subdirectory too, if it does, add for each game
2833
		// check if the file exists in the subdirectory too, if it does, add for each game
2755
		if ( game == GAME_ALL && !sMainGame.empty() && !otherGames.empty() ) {
2834
		if ( game == GAME_ALL && !sMainGame.empty() && !otherGames.empty() ) {
2756
			CFileIO F(rest);
2835
			CFileIO F(rest);
2757
			for(Utils::String g = otherGames.firstString(); !g.empty(); g = otherGames.nextString()) {
2836
			for(Utils::String g = otherGames.firstString(); !g.empty(); g = otherGames.nextString()) {
2758
				Utils::String checkDir = F.dir() + "/" + g;
2837
				Utils::String checkDir = F.dir() + "/" + g;
Line 2762... Line 2841...
2762
					if ( newfile ) newfile->SetShared(shared);
2841
					if ( newfile ) newfile->SetShared(shared);
2763
				}
2842
				}
2764
			}
2843
			}
2765
		}
2844
		}
2766
 
2845
 
-
 
2846
		unsigned int checkGame = addGame & ~(1 << 31);
-
 
2847
		unsigned int foundGame = 0;
-
 
2848
		for (int i = 0; i < 31; ++i)
-
 
2849
		{
-
 
2850
			if (1 << i == checkGame)
-
 
2851
			{
-
 
2852
				foundGame = i;
-
 
2853
				break;
-
 
2854
			}
-
 
2855
		}
-
 
2856
 
-
 
2857
		C_File *file = NULL;
-
 
2858
		if (foundGame)
-
 
2859
		{
-
 
2860
			Utils::String addon = gameAddons.findString(Utils::String::Number(foundGame));
-
 
2861
			if (!addon.empty())
-
 
2862
			{
-
 
2863
				Utils::String dir = C_File::GetDirectory(filetype, rest, this);
-
 
2864
				Utils::String filename = rest;
-
 
2865
				if (CCatFile::IsAddonDir(dir))
-
 
2866
					filename = filename.findReplace(dir + "/", addon + "/" + dir + "/");
-
 
2867
 
-
 
2868
				file = this->AppendFile(filename, filetype, addGame, dir);
-
 
2869
			}
-
 
2870
		}
-
 
2871
 
-
 
2872
		if(!file)
2767
		C_File *file = this->AppendFile(rest, filetype, addGame, dir);
2873
			file = this->AppendFile(rest, filetype, addGame, dir);
-
 
2874
 
2768
		if ( file )
2875
		if (file)
2769
			file->SetShared(shared);
2876
			file->SetShared(shared);
2770
	}
2877
	}
2771
}
2878
}
2772
 
2879
 
2773
 
2880
 
2774
CyString CBaseFile::GetFullFileSizeString() { return SPK::GetSizeString ( this->GetFullFileSize() ); }
2881
CyString CBaseFile::GetFullFileSizeString() { return SPK::GetSizeString ( this->GetFullFileSize() ); }
2775
 
2882
 
2776
// used for a multiple spk file
2883
// used for a multiple spk file
2777
unsigned char *CBaseFile::CreateData(size_t *size, CProgressInfo *progress)
2884
unsigned char *CBaseFile::CreateData(size_t *size, CProgressInfo *progress)
Line 2784... Line 2891...
2784
	return NULL;
2891
	return NULL;
2785
}
2892
}
2786
 
2893
 
2787
 
2894
 
2788
void CBaseFile::ConvertNormalMod(C_File *f, CyString to)
2895
void CBaseFile::ConvertNormalMod(C_File *f, CyString to)
2789
{
2896
{
2790
	C_File *match = this->FindMatchingMod(f);
2897
	C_File *match = this->FindMatchingMod(f);
2791
	if ( match )
2898
	if ( match )
2792
	{
2899
	{
2793
		// file link
2900
		// file link
2794
		if ( !match->GetData() )
2901
		if ( !match->GetData() )
2795
			match->ReadFromFile();
2902
			match->ReadFromFile();
2796
		match->ChangeBaseName(to);
2903
		match->ChangeBaseName(to);
2797
	}
2904
	}
2798
 
2905
 
2799
	// file link
2906
	// file link
2800
	if ( !f->GetData() )
2907
	if ( !f->GetData() )
2801
		f->ReadFromFile();
2908
		f->ReadFromFile();
2802
 
2909
 
2803
	f->ChangeBaseName(to);
2910
	f->ChangeBaseName(to);
2804
}
2911
}
2805
 
2912
 
2806
void CBaseFile::ConvertAutoText(C_File *f)
2913
void CBaseFile::ConvertAutoText(C_File *f)
2807
{
2914
{
2808
	CyString to;
2915
	CyString to;
Line 2814... Line 2921...
2814
		to = f->GetBaseName().Left(-4) + "0000";
2921
		to = f->GetBaseName().Left(-4) + "0000";
2815
 
2922
 
2816
	// file link
2923
	// file link
2817
	if ( !f->GetData() )
2924
	if ( !f->GetData() )
2818
		f->ReadFromFile();
2925
		f->ReadFromFile();
2819
 
2926
 
2820
	f->ChangeBaseName(to);
2927
	f->ChangeBaseName(to);
2821
 
2928
 
2822
}
2929
}
2823
 
2930
 
2824
void CBaseFile::ConvertFakePatch(C_File *f)
2931
void CBaseFile::ConvertFakePatch(C_File *f)
Line 2840... Line 2947...
2840
				continue;
2947
				continue;
2841
			if ( node->Data()->GetBaseName().Compare(find) )
2948
			if ( node->Data()->GetBaseName().Compare(find) )
2842
			{
2949
			{
2843
				found = true;
2950
				found = true;
2844
				break;
2951
				break;
2845
			}
2952
			}
2846
		}
2953
		}
2847
	}
2954
	}
2848
 
2955
 
2849
	CyString to = CyString::Number(num).PadNumber(2);
2956
	CyString to = CyString::Number(num).PadNumber(2);
2850
	C_File *match = this->FindMatchingMod(f);
2957
	C_File *match = this->FindMatchingMod(f);
Line 2974... Line 3081...
2974
	}
3081
	}
2975
 
3082
 
2976
	for (CListNode<C_File> *node = m_lFiles.Front(); node; node = node->next())
3083
	for (CListNode<C_File> *node = m_lFiles.Front(); node; node = node->next())
2977
	{
3084
	{
2978
		if (game != -1) {
3085
		if (game != -1) {
2979
			if (game && node->Data()->GetGame() && node->Data()->GetGame() != game)
3086
			if (game && !(node->Data()->game() & (1 << game)))
2980
				continue;
3087
				continue;
-
 
3088
			// extracting for all games, so ignore files that have a game set
2981
			if (!game && node->Data()->GetGame())
3089
			if (!game && node->Data()->game() && node->Data()->game() != GAME_ALLNEW)
2982
				continue;
3090
				continue;
2983
		}
3091
		}
2984
		Utils::String fname = node->Data()->GetNameDirectory(this).ToString();
3092
		Utils::String fname = node->Data()->GetNameDirectory(this).ToString();
2985
 
3093
 
2986
		// use the addon directory
3094
		// use the addon directory
2987
		if (node->Data()->isFileInAddon() && exes)
3095
		if (node->Data()->isFileInAddon() && exes)
2988
		{
3096
		{
2989
			int whatGame = game;
3097
			unsigned int whatGame = game;
2990
			if (game == -1)
3098
			if (game == -1)
-
 
3099
			{
2991
				whatGame = node->;Data()-&gt;GetGame();
3100
				unsigned int checkGame = node->;Data()->game() &amp; ~GAME_ALLNEW;
-
 
3101
				whatGame = 0;
-
 
3102
				for (int i = 0; i < 31; ++i)
-
 
3103
				{
-
 
3104
					if (1 << i == checkGame)
-
 
3105
					{
-
 
3106
						whatGame = i;
-
 
3107
						break;
-
 
3108
					}
-
 
3109
				}
-
 
3110
			}
2992
 
3111
 
2993
			SGameExe *e = exes->GetGame(whatGame - 1);
-
 
2994
			if (e)
3112
			if (whatGame > 0)
2995
			{
3113
			{
-
 
3114
				SGameExe *e = exes->GetGame(whatGame - 1);
-
 
3115
				if (e)
-
 
3116
				{
2996
				if (e->iFlags & EXEFLAG_ADDON)
3117
					if (e->iFlags & EXEFLAG_ADDON)
2997
					fname = e->sAddon + "/" + fname;
3118
						fname = e->sAddon + "/" + fname;
-
 
3119
				}
2998
			}
3120
			}
2999
		}
3121
		}
3000
 
3122
 
3001
		// create the directory
3123
		// create the directory
3002
		wsprintf(buf, L"%hs", fname.c_str());
3124
		wsprintf(buf, L"%hs", fname.c_str());
-
 
3125
		if (node->Data()->isExternalFile())
-
 
3126
		{
-
 
3127
			CFileIO file(node->Data()->filePointer());
-
 
3128
			size_t size = 0;
-
 
3129
			unsigned char *data = file.readAll(&size);
-
 
3130
			ZipAdd(hz, buf, data, size);
-
 
3131
			delete data;
-
 
3132
		}
-
 
3133
		else
3003
		ZipAdd(hz, buf, node->Data()->GetData(), node->Data()->GetDataSize());
3134
			ZipAdd(hz, buf, node->Data()->GetData(), node->Data()->GetDataSize());
3004
	}
3135
	}
3005
 
3136
 
3006
	// if its a ship, then add any generated files
3137
	// if its a ship, then add any generated files
3007
	this->addGeneratedFiles(hz);
3138
	this->addGeneratedFiles(hz);
3008
 
3139
 
3009
	// add the data file
3140
	// add the data file
3010
	Utils::CStringList list;
3141
	Utils::CStringList list;
-
 
3142
	Utils::CStringList addons;
3011
	if ( this->GeneratePackagerScript(false, &list, game, true) )
3143
	if ( this->GeneratePackagerScript(false, &list, game, addons, true) )
3012
	{
3144
	{
3013
		if ( CFileIO("test.tmp").writeFile(&list) )
3145
		if ( CFileIO("test.tmp").writeFile(&list) )
3014
		{
3146
		{
3015
			ZipAdd(hz, L"pluginmanager.txt", L"test.tmp");
3147
			ZipAdd(hz, L"pluginmanager.txt", L"test.tmp");
3016
			CFileIO::Remove("test.tmp");
3148
			CFileIO::Remove("test.tmp");
3017
		}
3149
		}
3018
	}
3150
	}
3019
 
3151
 
3020
	CloseZip(hz);
3152
	CloseZip(hz);
3021
 
3153
 
3022
	return true;
3154
	return true;
3023
}
3155
}
3024
 
3156
 
3025
int CBaseFile::GetGameFromString(const Utils::String &sGame)
3157
int CBaseFile::GetGameFromString(const Utils::String &sGame)
3026
{
3158
{
3027
	int iGame = GAME_ALL;
3159
	int iGame = GAME_ALL;
3028
	if ( sGame.Compare("ALL") )
3160
	if ( sGame.Compare("ALL") )
3029
		iGame = GAME_ALL;
3161
		iGame = GAME_ALL;
3030
	else if ( sGame.Compare("X3") )
3162
	else if ( sGame.Compare("X3") )
3031
		iGame = GAME_X3;
3163
		iGame = GAME_X3;
Line 3035... Line 3167...
3035
		iGame = GAME_X3TC;
3167
		iGame = GAME_X3TC;
3036
	else if (sGame.Compare("X3AP"))
3168
	else if (sGame.Compare("X3AP"))
3037
		iGame = GAME_X3AP;
3169
		iGame = GAME_X3AP;
3038
	else if (sGame.Compare("X3FL"))
3170
	else if (sGame.Compare("X3FL"))
3039
		iGame = GAME_X3FL;
3171
		iGame = GAME_X3FL;
3040
	else if ( sGame.Compare("XREBIRTH") )
-
 
3041
		iGame = GAME_XREBIRTH;
-
 
3042
	else if ( sGame.isNumber() )
3172
	else if ( sGame.isNumber() )
3043
		iGame = sGame;
3173
		iGame = sGame;
3044
 
3174
 
3045
	return iGame;
3175
	return iGame;
3046
}
3176
}
3047
 
3177
 
3048
Utils::String CBaseFile::ConvertGameToString(int iGame)
3178
Utils::String CBaseFile::ConvertGameToString(int iGame)
3049
{
3179
{
3050
	Utils::String game = "ALL";
3180
	Utils::String game = "ALL";
3051
 
3181
 
3052
	switch(iGame) {
3182
	switch(iGame) {
3053
		case GAME_ALL:
3183
		case GAME_ALL:
-
 
3184
		case GAME_ALLNEW:
3054
			game = "ALL";
3185
			game = "ALL";
3055
			break;
3186
			break;
3056
		case GAME_X2:
3187
		case GAME_X2:
3057
			game = "X2";
3188
			game = "X2";
3058
			break;
3189
			break;
3059
		case GAME_X3:
3190
		case GAME_X3:
3060
			game = "X3";
3191
			game = "X3";
Line 3065... Line 3196...
3065
		case GAME_X3AP:
3196
		case GAME_X3AP:
3066
			game = "X3AP";
3197
			game = "X3AP";
3067
			break;
3198
			break;
3068
		case GAME_X3FL:
3199
		case GAME_X3FL:
3069
			game = "X3FL";
3200
			game = "X3FL";
3070
			break;
-
 
3071
		case GAME_XREBIRTH:
-
 
3072
			game = "XREBIRTH";
-
 
3073
			break;
3201
			break;
3074
		default:
3202
		default:
3075
			game = (long)iGame;
3203
			game = (long)iGame;
3076
	}
3204
	}
3077
 
3205