void HippoGridInfo::setPlatform(const std::string &platform)
{
	std::string tmp = platform;
	for (unsigned i=0; i<platform.size(); i++)
		tmp[i] = tolower(tmp[i]);

	if (tmp == "opensim") {
		setPlatform(PLATFORM_OPENSIM);
	} else if (tmp == "secondlife") {
		setPlatform(PLATFORM_SECONDLIFE);
	} else {
		setPlatform(PLATFORM_OTHER);
		llwarns << "Unknown platform '" << platform << "'." << llendl;
	}
}
Exemple #2
0
void AppUser::parseOrigin()
{
	rapidjson::Document doc;
	if (doc.Parse<0>(Origin.c_str()).HasParseError()) {

		log("AppUser origin parsing error : %s", doc.GetParseError());
		return;
	}

	const rapidjson::Value& id = doc["ID"];
	setID(id.GetString());

	const rapidjson::Value& name = doc["Name"];
	setName(name.GetString());

	const rapidjson::Value& number = doc["Number"];
	setNumber(number.GetString());

	const rapidjson::Value& platform = doc["Platform"];
	setPlatform(platform.GetString());

	const rapidjson::Value& imei = doc["IMEI"];
	setIMEI(imei.GetString());

	const rapidjson::Value& imsi = doc["IMSI"];
	setIMSI(imsi.GetString());
}
bool IOPlatformExpert::start( IOService * provider )
{
    IORangeAllocator *	physicalRanges;
    OSData *		busFrequency;
    
    if (!super::start(provider))
      return false;

    // Register the presence or lack thereof a system 
    // PCI address mapper with the IOMapper class

#if 1
    IORegistryEntry * regEntry = IORegistryEntry::fromPath("/u3/dart", gIODTPlane);
    if (!regEntry)
	regEntry = IORegistryEntry::fromPath("/dart", gIODTPlane);
    if (regEntry) {
	int debugFlags;
	if (!PE_parse_boot_arg("dart", &debugFlags) || debugFlags)
	    setProperty(kIOPlatformMapperPresentKey, kOSBooleanTrue);
	regEntry->release();
    }
#endif

    IOMapper::setMapperRequired(0 != getProperty(kIOPlatformMapperPresentKey));
    
    gIOInterruptControllers = OSDictionary::withCapacity(1);
    gIOInterruptControllersLock = IOLockAlloc();
    
    // Correct the bus frequency in the device tree.
    busFrequency = OSData::withBytesNoCopy((void *)&gPEClockFrequencyInfo.bus_clock_rate_hz, 4);
    provider->setProperty("clock-frequency", busFrequency);
    busFrequency->release();
    
    gPlatformInterruptControllerName = (OSSymbol *)OSSymbol::withCStringNoCopy("IOPlatformInterruptController");
    
    physicalRanges = IORangeAllocator::withRange(0xffffffff, 1, 16,
						 IORangeAllocator::kLocking);
    assert(physicalRanges);
    setProperty("Platform Memory Ranges", physicalRanges);
    
    setPlatform( this );
    gIOPlatform = this;
    
    PMInstantiatePowerDomains();
    
    // Parse the serial-number data and publish a user-readable string
    OSData* mydata = (OSData*) (provider->getProperty("serial-number"));
    if (mydata != NULL) {
        OSString *serNoString = createSystemSerialNumberString(mydata);
        if (serNoString != NULL) {
            provider->setProperty(kIOPlatformSerialNumberKey, serNoString);
            serNoString->release();
        }
    }
    
    return( configure(provider) );
}
void HippoGridInfo::setLoginUri(const std::string& loginUri)
{
	mLoginUri = sanitizeUri(loginUri);
	if (utf8str_tolower(LLURI(mLoginUri).hostName()) == "login.agni.lindenlab.com")
	{
		mIsInProductionGrid = true;
		useHttps();
		setPlatform(PLATFORM_SECONDLIFE);
	}
	else if (utf8str_tolower(LLURI(mLoginUri).hostName()) == "login.aditi.lindenlab.com")
	{
		useHttps();
		setPlatform(PLATFORM_SECONDLIFE);
	}
	else if (utf8str_tolower(LLURI(mLoginUri).hostName()) == "login.avination.com" ||
		utf8str_tolower(LLURI(mLoginUri).hostName()) == "login.avination.net")
	{
		mIsInAvination = true;
		useHttps();
	}
}