Пример #1
0
// Special Attrib parsing. craftStats must be good for extraInfo init
void	parseSpecialAttributes(const CSString &specialAttributes, MPCraftStats &craftStats, CExtraInfo &extraInfo)
{
	// evaluate DropOrSell according to CraftStats: can DropOrSell if it is a MP Craft
	extraInfo.DropOrSell= craftStats.Craft != "";

	// parse attributes
	vector<string> strArray;
	splitString(specialAttributes, "-", strArray);
	for(uint i=0;i<strArray.size();i++)
	{
		if(nlstricmp(strArray[i], "R")==0)
			craftStats.UsedAsCraftRequirement= true;
		if(nlstricmp(strArray[i], "D0")==0)
			extraInfo.DropOrSell= false;
		if(nlstricmp(strArray[i], "D1")==0)
			extraInfo.DropOrSell= true;
	}
}
Пример #2
0
// ***************************************************************************
EEnumTemplate stringToEnum(const std::string &str)
{
	for(uint i=0;i<NUM_ENUM_TEMPLATE;i++)
	{
		if(nlstricmp(StringArray[i], str)==0)
			return (EEnumTemplate)i;
	}
	return UNKNOWN;
}
Пример #3
0
// ****************************************************************************************************************
uint32 CWinProcess::getProcessIdFromModuleFilename(const std::string &moduleFileName)
{
	std::vector<uint32> processesId;
	if (!enumProcessesId(processesId)) return false;
	std::vector<std::string> moduleNames;
	for (uint prc = 0; prc < processesId.size(); ++prc)
	{
		if (enumProcessModules(processesId[prc], moduleNames))
		{
			for (uint m = 0; m < moduleNames.size(); ++m)
			{
				if (nlstricmp(CFile::getFilename(moduleNames[m]), moduleFileName) == 0)
				{
					return processesId[prc];
				}
			}
		}
	}
	return 0;
}