Subversion Repositories spk

Rev

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

Rev 204 Rev 205
Line 8838... Line 8838...
8838
}
8838
}
8839
 
8839
 
8840
void CPackages::parseAvailablePackage(const Utils::WString &str, const Utils::WString &webaddress)
8840
void CPackages::parseAvailablePackage(const Utils::WString &str, const Utils::WString &webaddress)
8841
{
8841
{
8842
	// first check game
8842
	// first check game
8843
	int num = 0;
-
 
8844
	std::vector<Utils::WString> tok;
8843
	std::vector<Utils::WString> tok;
8845
	if (!str.tokenise(L"::", tok))
8844
	if (!str.tokenise(L"::", tok))
8846
		return;
8845
		return;
8847
	// invalid number of entries?
8846
	// invalid number of entries?
8848
	if ( num < 7 ) return;
8847
	if (tok.size() < 7 ) return;
8849
 
8848
 
8850
	SAvailablePackage *p = new SAvailablePackage;
8849
	SAvailablePackage *p = new SAvailablePackage;
8851
	p->iType = tok[0].toLong();
8850
	p->iType = tok[0].toLong();
8852
	p->bSigned = false;
8851
	p->bSigned = false;
8853
 
8852
 
Line 8880... Line 8879...
8880
		p->sFilename = webaddress + L"/" + p->sFilename;
8879
		p->sFilename = webaddress + L"/" + p->sFilename;
8881
 
8880
 
8882
	p->iChanging = p->iEase = p->iPluginType = p->iRec = p->iScriptType = -1;
8881
	p->iChanging = p->iEase = p->iPluginType = p->iRec = p->iScriptType = -1;
8883
 
8882
 
8884
	// check if we have the extra values
8883
	// check if we have the extra values
8885
	if ( num >= 12 )
8884
	if (tok.size() >= 12 )
8886
	{
8885
	{
8887
		p->iEase = tok[7].toLong();
8886
		p->iEase = tok[7].toLong();
8888
		p->iChanging = tok[8].toLong();
8887
		p->iChanging = tok[8].toLong();
8889
		p->iRec = tok[9].toLong();
8888
		p->iRec = tok[9].toLong();
8890
		p->iPluginType = tok[10].toLong();
8889
		p->iPluginType = tok[10].toLong();
8891
		p->iScriptType = tok[11].toLong();
8890
		p->iScriptType = tok[11].toLong();
8892
		if ( num > 12 ) {
-
 
8893
			if ( num > 13 ) {
8891
		if (tok.size()> 13 ) {
8894
				p->sDesc = tok[13];
8892
			p->sDesc = tok[13];
8895
				p->bSigned = tok[12].toBool();
8893
			p->bSigned = tok[12].toBool();
8896
			}
-
 
8897
			else
-
 
8898
				p->sDesc = tok[12];
-
 
8899
		}
8894
		}
-
 
8895
		else
-
 
8896
			p->sDesc = tok[12];
8900
	}
8897
	}
8901
	else if ( num > 7 )
8898
	else if (tok.size() > 7 )
8902
		p->sDesc = tok[8];
8899
		p->sDesc = tok[8];
8903
 
8900
 
8904
	if ( !p->sDesc.empty() )
8901
	if ( !p->sDesc.empty() )
8905
		p->sDesc = p->sDesc.findReplace(L"::newline::", L"\\n");
8902
		p->sDesc = p->sDesc.findReplace(L"::newline::", L"\\n");
8906
 
8903
 
Line 9102... Line 9099...
9102
	}
9099
	}
9103
 
9100
 
9104
	return false;
9101
	return false;
9105
}
9102
}
9106
 
9103
 
9107
int CPackages::findAllServers(Utils::CStringList *list) const
9104
int CPackages::findAllServers(Utils::WStringList *list) const
9108
{
9105
{
9109
	for ( CListNode<CBaseFile> *node = m_lPackages.Front(); node; node = node->next() )
9106
	for ( CListNode<CBaseFile> *node = m_lPackages.Front(); node; node = node->next() )
9110
	{
9107
	{
9111
		if (!node->Data()->webAddress().empty())
9108
		if (!node->Data()->webAddress().empty())
9112
		{
9109
		{
Line 9126... Line 9123...
9126
 
9123
 
9127
	CFileIO File(L"data\\web");
9124
	CFileIO File(L"data\\web");
9128
 
9125
 
9129
	if ( File.startRead() ) {
9126
	if ( File.startRead() ) {
9130
		while(!File.atEnd()) {
9127
		while(!File.atEnd()) {
9131
			Utils::String line = File.readEndOfLineStr();
9128
			Utils::WString line = File.readEndOfLine();
9132
			line.removeChar("\n\r\t ");
9129
			line.removeChar(L"\n\r\t ");
9133
			if (!line.empty())
9130
			if (!line.empty())
9134
			{
9131
			{
9135
				if(!list->contains(line))
9132
				if(!list->contains(line))
9136
					list->pushBack(line);
9133
					list->pushBack(line);
9137
			}
9134
			}
9138
		}
9135
		}
9139
		File.close();
9136
		File.close();
9140
	}
9137
	}
9141
 
9138
 
9142
	if (!list->contains("http://xpluginmanager.co.uk/tcscripts"))
9139
	if (!list->contains(L"http://xpluginmanager.co.uk/tcscripts"))
9143
		list->pushBack("http://xpluginmanager.co.uk/tcscripts");
9140
		list->pushBack(L"http://xpluginmanager.co.uk/tcscripts");
9144
	if (!list->contains("http://xpluginmanager.co.uk/acscripts"))
9141
	if (!list->contains(L"http://xpluginmanager.co.uk/acscripts"))
9145
		list->pushBack("http://xpluginmanager.co.uk/apscripts");
9142
		list->pushBack(L"http://xpluginmanager.co.uk/apscripts");
9146
	if (!list->contains("http://xpluginmanager.co.uk/fcscripts"))
9143
	if (!list->contains(L"http://xpluginmanager.co.uk/fcscripts"))
9147
		list->pushBack("http://xpluginmanager.co.uk/flscripts");
9144
		list->pushBack(L"http://xpluginmanager.co.uk/flscripts");
9148
 
9145
 
9149
	return list->size();
9146
	return list->size();
9150
}
9147
}
9151
 
9148
 
9152
void CPackages::readArchiveData(const Utils::String &filename, CBaseFile *archive) const
9149
void CPackages::readArchiveData(const Utils::String &filename, CBaseFile *archive) const