bool
SipccSdpAttributeList::Load(sdp_t* sdp, uint16_t level,
                            SdpErrorHolder& errorHolder)
{

  LoadSimpleStrings(sdp, level, errorHolder);
  LoadSimpleNumbers(sdp, level, errorHolder);
  LoadFlags(sdp, level);
  LoadDirection(sdp, level, errorHolder);

  if (AtSessionLevel()) {
    if (!LoadGroups(sdp, level, errorHolder)) {
      return false;
    }

    if (!LoadMsidSemantics(sdp, level, errorHolder)) {
      return false;
    }

    LoadIdentity(sdp, level);
  } else {
    sdp_media_e mtype = sdp_get_media_type(sdp, level);
    if (mtype == SDP_MEDIA_APPLICATION) {
      if (!LoadSctpmap(sdp, level, errorHolder)) {
        return false;
      }
    } else {
      if (!LoadRtpmap(sdp, level, errorHolder)) {
        return false;
      }
    }
    LoadCandidate(sdp, level);
    LoadFmtp(sdp, level);
    LoadMsids(sdp, level, errorHolder);
    LoadRtcpFb(sdp, level, errorHolder);
    LoadRtcp(sdp, level, errorHolder);
    LoadSsrc(sdp, level);
    if (!LoadImageattr(sdp, level, errorHolder)) {
      return false;
    }
    if (!LoadSimulcast(sdp, level, errorHolder)) {
      return false;
    }
    if (!LoadRid(sdp, level, errorHolder)) {
      return false;
    }
  }

  LoadIceAttributes(sdp, level);
  if (!LoadFingerprint(sdp, level, errorHolder)) {
    return false;
  }
  LoadSetup(sdp, level);
  LoadExtmap(sdp, level, errorHolder);

  return true;
}
Beispiel #2
0
void Lunem::ReadFromFile(FILE* f)
{
	char buffer[128];
	unsigned char c;
	int i;
	
	// read species string
	fread(&c, sizeof(c), 1, f); //length
	ASSERT(c > 0);

	if (c > 127) c = 127;
	fread(&buffer, c, 1, f);
	m_sSpecies.append(buffer, c);
	
	// read name string
	fread(&c, sizeof(c), 1, f); //length
	ASSERT(c > 0);

	if (c > 127) c = 127;
	fread(&buffer, c, 1, f);
	mName.append(buffer, c);

	console->AddMessage("Reading in, name: " + mName + " species: " + m_sSpecies);

	fread(&m_bLevel, sizeof(m_bLevel), 1, f);
	fread(&m_bGene, sizeof(m_bGene), 1, f);

	for (i = 0; i < MAX_COMBATANT_TYPES; ++i)
	{
		fread(&m_bType[i], sizeof(m_bType[i]), 1, f);
	}	
	
	fread(&m_bBaseAttack, sizeof(m_bBaseAttack), 1, f);
	fread(&m_bBaseDefense, sizeof(m_bBaseDefense), 1, f);
	fread(&m_bBaseSpeed, sizeof(m_bBaseSpeed), 1, f);
	fread(&m_bBaseHealth, sizeof(m_bBaseHealth), 1, f);
	fread(&m_iExp, sizeof(m_iExp), 1, f);
	fread(&m_iCurrentHealth, sizeof(m_iCurrentHealth), 1, f);

	//read skills
	for (i = 0; i < MAX_COMBATANT_SKILLS; ++i)
	{
		fread(&c, sizeof(c), 1, f); //length
		if (c > 0)
		{
			if (c > 127) c = 127;
			fread(&buffer, c, 1, f);
			m_sSkills[i].id.append(buffer, c);
		}
	}

	LoadFlags(f);
	
	SetSpecies(m_sSpecies);
}
Beispiel #3
0
void CIP2Country::Enable()
{
	Disable();

	if (m_CountryDataMap.empty()) {
		LoadFlags();
	}

	if (!CPath::FileExists(m_DataBasePath)) {
		Update();
		return;
	}

	m_geoip = GeoIP_open(unicode2char(m_DataBasePath), GEOIP_STANDARD);
}