Subversion Repositories spk

Rev

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

Rev 48 Rev 49
Line 879... Line 879...
879
		if ( !gNode->Data()->sVersion.empty() )
879
		if ( !gNode->Data()->sVersion.empty() )
880
			this->AddGameCompatability(gNode->Data()->iGame, gNode->Data()->sVersion);
880
			this->AddGameCompatability(gNode->Data()->iGame, gNode->Data()->sVersion);
881
		else
881
		else
882
			this->AddGameCompatability(gNode->Data()->iGame, (long)gNode->Data()->iVersion);
882
			this->AddGameCompatability(gNode->Data()->iGame, (long)gNode->Data()->iVersion);
883
	}
883
	}
884
 
-
 
885
	if ( !base->GetWebAddress().Empty() )
-
 
886
		m_sWebAddress = base->GetWebAddress();
-
 
887
	if ( !base->GetWebSite().Empty() )
-
 
888
		m_sWebSite = base->GetWebSite();
-
 
889
	if ( !base->GetEmail().Empty() )
-
 
890
		m_sEmail = base->GetEmail();
-
 
891
	if ( !base->GetForumLink().Empty() )
-
 
892
		m_sForumLink = base->GetForumLink();
-
 
893
 
-
 
894
 
884
 
895
	// copy over needed librarys
885
	// copy over needed librarys
896
	for ( CListNode<SNeededLibrary> *lNode = base->GetNeededLibraries()->Front(); lNode; lNode = lNode->next() )
886
	for ( CListNode<SNeededLibrary> *lNode = base->GetNeededLibraries()->Front(); lNode; lNode = lNode->next() )
897
		this->AddNeededLibrary(lNode->Data()->sName, lNode->Data()->sAuthor, lNode->Data()->sMinVersion);
887
		this->AddNeededLibrary(lNode->Data()->sName, lNode->Data()->sAuthor, lNode->Data()->sMinVersion);
898
 
888
 
Line 942... Line 932...
942
	Utils::String removeFile;
932
	Utils::String removeFile;
943
 
933
 
944
	unsigned char *uncomprData = NULL;
934
	unsigned char *uncomprData = NULL;
945
	unsigned char *data = NULL;
935
	unsigned char *data = NULL;
946
	long len = 0, newlen = 0;
936
	long len = 0, newlen = 0;
947
 
937
 
948
	if ( check == "HiP" ) {
938
	if ( check == "HiP" ) {
949
		fclose ( id );
939
		fclose ( id );
950
		bool opened = false;
940
		bool opened = false;
951
		if ( DecompressFile ( (char *)sOldFilename.c_str(), "uncompr.tmp" ) ) {
941
		if ( DecompressFile ( (char *)sOldFilename.c_str(), "uncompr.tmp" ) ) {
952
			removeFile = "uncompr.tmp";
942
			removeFile = "uncompr.tmp";
Line 994... Line 984...
994
	#ifdef _INCLUDE7ZIP
984
	#ifdef _INCLUDE7ZIP
995
		uncomprData = LZMADecodeData ( data, len, newlen, progress );
985
		uncomprData = LZMADecodeData ( data, len, newlen, progress );
996
	#else
986
	#else
997
		uncomprData = LZMADecode_C ( (unsigned char *)data, len, (size_t*)&newlen, NULL );
987
		uncomprData = LZMADecode_C ( (unsigned char *)data, len, (size_t*)&newlen, NULL );
998
	#endif
988
	#endif
999
	}
989
	}
1000
 
990
 
1001
	*pLen = newlen;
991
	*pLen = newlen;
1002
 
992
 
1003
	if ( !removeFile.empty() ) {
993
	if ( !removeFile.empty() ) {
1004
		CFileIO(removeFile).Remove();
994
		CFileIO(removeFile).Remove();
1005
	}
995
	}
1006
 
996
 
1007
	return uncomprData;
997
	return uncomprData;
1008
}
998
}
1009
 
999
 
1010
Utils::String CSpkFile::_convert_fileEndString(const Utils::String &sFile)
1000
Utils::String CSpkFile::_convert_fileEndString(const Utils::String &sFile)
1011
{
1001
{
1012
	if ( sFile.Compare("Text") )
1002
	if ( sFile.Compare("Text") )
1013
		return "-- End of Script --";
1003
		return "-- End of Script --";
1014
	else if ( sFile.Compare("Uninstall") )
1004
	else if ( sFile.Compare("Uninstall") )
Line 1021... Line 1011...
1021
		return "";
1011
		return "";
1022
	return "-- End of Script --";
1012
	return "-- End of Script --";
1023
}
1013
}
1024
 
1014
 
1025
int CSpkFile::_convert_fileType(const Utils::String &sFile)
1015
int CSpkFile::_convert_fileType(const Utils::String &sFile)
1026
{
1016
{
1027
	if ( sFile.Compare("Text") )
1017
	if ( sFile.Compare("Text") )
1028
		return FILETYPE_TEXT;
1018
		return FILETYPE_TEXT;
1029
	else if ( sFile.Compare("Uninstall") )
1019
	else if ( sFile.Compare("Uninstall") )
1030
		return FILETYPE_UNINSTALL;
1020
		return FILETYPE_UNINSTALL;
1031
	else if ( sFile.Compare("Readme") )
1021
	else if ( sFile.Compare("Readme") )
Line 1073... Line 1063...
1073
	}
1063
	}
1074
	else if ( sCmd == "Version:" )
1064
	else if ( sCmd == "Version:" )
1075
	{
1065
	{
1076
		this->SetVersion ( sRest );
1066
		this->SetVersion ( sRest );
1077
		CLog::logf(CLog::Log_EditPackage, "\tScript Version: %s", sRest.c_str() );
1067
		CLog::logf(CLog::Log_EditPackage, "\tScript Version: %s", sRest.c_str() );
1078
	}
1068
	}
1079
	else if ( sCmd == "Date:" )
1069
	else if ( sCmd == "Date:" )
1080
	{
1070
	{
1081
		this->SetCreationDate ( sRest );
1071
		this->SetCreationDate ( sRest );
1082
		CLog::logf(CLog::Log_EditPackage, "\tScript Creation Date: %s", sRest.c_str() );
1072
		CLog::logf(CLog::Log_EditPackage, "\tScript Creation Date: %s", sRest.c_str() );
1083
	}
1073
	}
1084
	else if ( sCmd == "Desc:" ) {
1074
	else if ( sCmd == "Desc:" ) {
1085
		this->setDescription(sRest.findReplace("<br>", "\n") );
1075
		this->setDescription(sRest.findReplace("<br>", "\n") );
1086
		CLog::logf(CLog::Log_EditPackage, "\tScript Description: %s", this->description().c_str() );
1076
		CLog::logf(CLog::Log_EditPackage, "\tScript Description: %s", this->description().c_str() );
1087
	}
1077
	}
1088
	else if ( sCmd == "WebAddress:" )
1078
	else if ( sCmd == "WebAddress:" ) {
1089
	{
-
 
1090
		this->SetWebAddress ( sRest );
1079
		this->setWebAddress(sRest);
1091
		CLog::logf(CLog::Log_EditPackage, "\tWeb Address: %s", sRest.c_str() );
1080
		CLog::logf(CLog::Log_EditPackage, "\tWeb Address: %s", sRest.c_str() );
1092
	}
1081
	}
1093
	else if ( sCmd == "WebMirror1:" )
1082
	else if ( sCmd == "WebMirror1:" )
1094
	{
1083
	{
1095
		this->AddWebMirror(sRest);
1084
		this->AddWebMirror(sRest);
1096
		CLog::logf(CLog::Log_EditPackage, "\tWeb Mirror Address: %s", sRest.c_str() );
1085
		CLog::logf(CLog::Log_EditPackage, "\tWeb Mirror Address: %s", sRest.c_str() );
1097
	}
1086
	}
1098
	else if ( sCmd == "WebMirror2:" )
1087
	else if ( sCmd == "WebMirror2:" )
1099
	{
1088
	{
Line 1101... Line 1090...
1101
		CLog::logf(CLog::Log_EditPackage, "\tWeb Mirror Address: %s", sRest.c_str() );
1090
		CLog::logf(CLog::Log_EditPackage, "\tWeb Mirror Address: %s", sRest.c_str() );
1102
	}
1091
	}
1103
	
1092
	
1104
	else if ( sCmd == "ScriptType:" )
1093
	else if ( sCmd == "ScriptType:" )
1105
		this->SetScriptType (sRest);
1094
		this->SetScriptType (sRest);
1106
	else if ( sCmd == "WebSite:" )
1095
	else if ( sCmd == "WebSite:" ) {
1107
	{
-
 
1108
		this->SetWebSite ( sRest );
1096
		this->setWebSite ( sRest );
1109
		CLog::logf(CLog::Log_EditPackage, "\tWeb Site: %s", sRest.c_str() );
1097
		CLog::logf(CLog::Log_EditPackage, "\tWeb Site: %s", sRest.c_str() );
1110
	}
1098
	}
1111
	else if ( sCmd == "Email:" )
1099
	else if ( sCmd == "Email:" ) {
1112
	{
-
 
1113
		this->SetEmail ( sRest );
1100
		this->setEmail(sRest);
1114
		CLog::logf(CLog::Log_EditPackage, "\tAuthor Email Address: %s", sRest.c_str() );
1101
		CLog::logf(CLog::Log_EditPackage, "\tAuthor Email Address: %s", sRest.c_str() );
1115
	}
1102
	}
1116
	else if ( sCmd == "GameVersion:" )
1103
	else if ( sCmd == "GameVersion:" )
1117
	{
1104
	{
1118
		//TODO: fix this for new game version
1105
		//TODO: fix this for new game version