Пример #1
0
void CVarManager::saveToDb(sqlite3x::sqlite3_command &cmd, uint8 flags)
{
	for (uint32 x=0; x<getCount(); x++)
	{
		CVar* cvarNode = getItem(x);

		if (cvarNode->getFlags() & CFLAG_NOSAVE)
			continue;

		//dont save if user = true and usercvar = false || user = false and usercvar = true
		if ((flags & CFLAG_USER) ^ (cvarNode->getFlags() & CFLAG_USER))
			continue;

		if ((flags & CFLAG_WINUSER) ^ (cvarNode->getFlags() & CFLAG_WINUSER))
			continue;

		//dont save if setting hasnt changed
		if (!cvarNode->getExitString() || (strcmp(cvarNode->getExitString(), cvarNode->getDefault())) == 0)
			continue;

		cmd.bind(1, std::string(cvarNode->getName()));
		cmd.bind(2, std::string(cvarNode->getExitString()));
		cmd.executenonquery();
	}
}
Пример #2
0
gcString DesuraJSSettings::getValue(gcString name)
{
	CVar* cvar = GetCVarManager()->findCVar(name.c_str());
	if (!cvar)
		return "";

	return cvar->getExitString();
}