Subversion Repositories spk

Rev

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

Rev 161 Rev 162
Line 8090... Line 8090...
8090
		count += findPackageDirectories(packages, dir + "/Downloads");
8090
		count += findPackageDirectories(packages, dir + "/Downloads");
8091
	}
8091
	}
8092
 
8092
 
8093
	count += findPackageDirectories(packages, "./Addons");
8093
	count += findPackageDirectories(packages, "./Addons");
8094
	count += findPackageDirectories(packages, "./Downloads");
8094
	count += findPackageDirectories(packages, "./Downloads");
-
 
8095
	count += findPackageDirectories(packages, m_sMyDoc + "/Egosoft/PluginManager/Addons");
-
 
8096
	count += findPackageDirectories(packages, m_sMyDoc + "/Egosoft/PluginManager/Downloads");
8095
	
8097
 
8096
	if (_pCurrentDir)
8098
	if (_pCurrentDir)
8097
	{
8099
	{
8098
		count += findPackageDirectories(packages, _pCurrentDir->dir + "/Addons");
8100
		count += findPackageDirectories(packages, _pCurrentDir->dir + "/Addons");
8099
		count += findPackageDirectories(packages, _pCurrentDir->dir + "/Downloads");
8101
		count += findPackageDirectories(packages, _pCurrentDir->dir + "/Downloads");
8100
		count += findPackageDirectories(packages, _pCurrentDir->dir + "/ExtraContent");
8102
		count += findPackageDirectories(packages, _pCurrentDir->dir + "/ExtraContent");
Line 8616... Line 8618...
8616
 
8618
 
8617
	CXspFile *newShip = new CXspFile;
8619
	CXspFile *newShip = new CXspFile;
8618
	if ( !newShip->extractShip(pVfs, sId, progress) ) {
8620
	if ( !newShip->extractShip(pVfs, sId, progress) ) {
8619
		delete newShip;
8621
		delete newShip;
8620
		newShip = NULL;
8622
		newShip = NULL;
8621
	}
8623
	}
8622
 
8624
 
8623
	delete pVfs;
8625
	delete pVfs;
8624
 
8626
 
8625
	return newShip;
8627
	return newShip;
8626
}
8628
}
8627
 
8629
 
8628
void CPackages::getMergedFiles(Utils::CStringList &list, CCatFile *cat1, CCatFile *cat2)
8630
void CPackages::getMergedFiles(Utils::CStringList &list, CCatFile *cat1, CCatFile *cat2)
8629
{
8631
{
Line 9136... Line 9138...
9136
	}
9138
	}
9137
 
9139
 
9138
	return false;
9140
	return false;
9139
}
9141
}
9140
 
9142
 
9141
int CPackages::FindAllServers(CyStringList *list)
9143
int CPackages::findAllServers(Utils::CStringList *list) const
9142
{
9144
{
9143
	for ( CListNode<CBaseFile> *node = m_lPackages.Front(); node; node = node->next() )
9145
	for ( CListNode<CBaseFile> *node = m_lPackages.Front(); node; node = node->next() )
9144
	{
9146
	{
9145
		if ( !node->Data()->webAddress().empty() )
9147
		if (!node->Data()->webAddress().empty())
9146
			list->PushBack(CyString(node->Data()->webAddress()), true);
-
 
9147
		if ( node->Data()->AnyWebMirrors() )
-
 
9148
		{
9148
		{
-
 
9149
			if(!list->contains(node->Data()->webAddress()))
-
 
9150
				list->pushBack(node->Data()->webAddress());
-
 
9151
		}
-
 
9152
		if ( node->Data()->anyWebMirrors() )
-
 
9153
		{
9149
			for ( SStringList *str = node->;Data()->GetWebMirrors()->Head(); str; str = str->next )
9154
			auto l = node->;Data()->getWebMirrors();
-
 
9155
			for (auto itr = l->begin(); itr != l->end(); itr++)
-
 
9156
			{
-
 
9157
				if(!list->contains((*itr)->str))
9150
				list->PushBack(str->str, true);
9158
					list->pushBack((*itr)->str);
-
 
9159
			}
9151
		}
9160
		}
9152
	}
9161
	}
9153
 
9162
 
9154
	CFileIO File("data\\web");
9163
	CFileIO File("data\\web");
9155
 
9164
 
9156
	if ( File.startRead() ) {
9165
	if ( File.startRead() ) {
9157
		while(!File.atEnd()) {
9166
		while(!File.atEnd()) {
9158
			Utils::String line = File.readEndOfLine();
9167
			Utils::String line = File.readEndOfLine();
9159
			line.removeChar("\n\r\t ");
9168
			line.removeChar("\n\r\t ");
9160
			if ( !line.empty() )
9169
			if (!line.empty())
-
 
9170
			{
-
 
9171
				if(!list->contains(line))
9161
				list->PushBack(CyString(line), true);
9172
					list->pushBack(line);
-
 
9173
			}
9162
		}
9174
		}
9163
		File.close();
9175
		File.close();
9164
	}
9176
	}
9165
 
9177
 
-
 
9178
	if (!list->contains("http://xpluginmanager.co.uk/tcscripts"))
9166
	list->PushBack("http://xpluginmanager.co.uk/tcscripts", true);
9179
		list->pushBack("http://xpluginmanager.co.uk/tcscripts");
-
 
9180
	if (!list->contains("http://xpluginmanager.co.uk/acscripts"))
9167
	list->PushBack("http://xpluginmanager.co.uk/apscripts", true);
9181
		list->pushBack("http://xpluginmanager.co.uk/apscripts");
-
 
9182
	if (!list->contains("http://xpluginmanager.co.uk/fcscripts"))
9168
	list->PushBack("http://xpluginmanager.co.uk/flscripts", true);
9183
		list->pushBack("http://xpluginmanager.co.uk/flscripts");
9169
 
9184
 
9170
	return list->Count();
9185
	return list->size();
9171
}
9186
}
9172
 
9187
 
9173
void CPackages::ReadArchiveData(CyString filename, CBaseFile *archive)
9188
void CPackages::ReadArchiveData(CyString filename, CBaseFile *archive)
9174
{
9189
{
9175
	size_t size;
9190
	size_t size;
Line 9187... Line 9202...
9187
		SGameExe *exe = m_gameExe.GetGame(i);
9202
		SGameExe *exe = m_gameExe.GetGame(i);
9188
		if (!exe->sAddon.empty())
9203
		if (!exe->sAddon.empty())
9189
			gameAddons.pushBack(Utils::String::Number(i + 1), exe->sAddon);
9204
			gameAddons.pushBack(Utils::String::Number(i + 1), exe->sAddon);
9190
	}
9205
	}
9191
 
9206
 
9192
	CyString data(buf);
9207
	Utils::String data(buf);
9193
	int max;
9208
	int max;
9194
	CyString *str = data.SplitToken("\n", &max);
9209
	Utils::String *str = data.tokenise("\n", &max);
9195
	if ( str && max )
9210
	if ( str && max )
9196
	{
9211
	{
9197
		for ( int i = 0; i < max; i++ )
9212
		for ( int i = 0; i < max; i++ )
9198
		{
9213
		{
9199
			Utils::String line = str[i].ToString();
9214
			Utils::String line = str[i];
9200
			if ( line.empty() )
9215
			if ( line.empty() )
9201
				continue;
9216
				continue;
9202
 
9217
 
9203
			// filter out any spaces, tabs in front
9218
			// filter out any spaces, tabs in front
9204
			line.removeChar('\t');
9219
			line.removeChar('\t');