Пример #1
0
void Character::SaveCharacter()
{
    _log( ITEM__TRACE, "Saving character %u.", itemID() );

    sLog.Debug( "Character::SaveCharacter()", "Saving all character info and skill attribute info to DB for character %s...", itemName().c_str() );
    // character data
    m_factory.db().SaveCharacter(
        itemID(),
        CharacterData(
            accountID(),
            title().c_str(),
            description().c_str(),
            gender(),
            bounty(),
            balance(),
            securityRating(),
            logonMinutes(),
            corporationID(),
            allianceID(),
            warFactionID(),
            stationID(),
            solarSystemID(),
            constellationID(),
            regionID(),
            ancestryID(),
            careerID(),
            schoolID(),
            careerSpecialityID(),
            startDateTime(),
            createDateTime(),
            corporationDateTime()
        )
    );

    // corporation data
    m_factory.db().SaveCorpMemberInfo(
        itemID(),
        CorpMemberInfo(
            corporationHQ(),
            corpRole(),
            rolesAtAll(),
            rolesAtBase(),
            rolesAtHQ(),
            rolesAtOther()
        )
    );

    // Save this character's own attributes:
    SaveAttributes();

    // Loop through all skills and invoke mAttributeMap.SaveAttributes() for each
    std::vector<InventoryItemRef> skills;
    GetSkillsList( skills );
    std::vector<InventoryItemRef>::iterator cur, end;
    cur = skills.begin();
    end = skills.end();
    for(; cur != end; cur++)
        cur->get()->SaveAttributes();
        //cur->get()->mAttributeMap.Save();
}
void
nsMutationReceiver::CharacterDataWillChange(nsIDocument *aDocument,
                                            nsIContent* aContent,
                                            CharacterDataChangeInfo* aInfo)
{
  if (nsAutoMutationBatch::IsBatching() ||
      !CharacterData() ||
      (!Subtree() && aContent != Target()) ||
      (Subtree() && RegisterTarget()->SubtreeRoot() != aContent->SubtreeRoot()) ||
      !IsObservable(aContent)) {
    return;
  }

  nsDOMMutationRecord* m =
    Observer()->CurrentRecord(nsGkAtoms::characterData);

  NS_ASSERTION(!m->mTarget || m->mTarget == aContent,
               "Wrong target!");

  if (!m->mTarget) {
    m->mTarget = aContent;
  }
  if (CharacterDataOldValue() && m->mPrevValue.IsVoid()) { 
    aContent->GetText()->AppendTo(m->mPrevValue);
  }
}
Пример #3
0
char*
XMLEntity::ToString(bool encoded, int level)
{
	string text = "";
	string indent = "";
	string character_data = EscapeText(CharacterData());

	for(int i=0; i<level; ++i) indent += "\t";
	
	text  = indent;
	text += "<";
	text += Name();

	for(int i=0; i < CountAttributes(); ++i) {
		text += " ";
		text += AttributeKey(i);
		text += "=";
		text += "\"";
		text += EscapeText(AttributeValue(i));
		text += "\"";
	}

	if (character_data.size() == 0 && CountChildren() == 0)	text += "/";
	text += ">";
	text += character_data;

	if (CountChildren() > 0)
	{
		text += "\n";

		for (int i=0; i < CountChildren(); ++i)
		{
			char *str = Child(i)->ToString(encoded, level + 1);
			if (str)
			{
				text += str;
				free(str);
			}
		}
		
		text += indent;
	}

	if (CountChildren() > 0 || character_data.size() > 0)
	{
		text += "</";
		text += Name();
		text += ">";
	}

	text += "\n";

	return strdup(text.c_str());	
}
Пример #4
0
void Character::SaveCharacter() const
{
    _log( ITEM__TRACE, "Saving character %u.", itemID() );

    // character data
    m_factory.db().SaveCharacter(
        itemID(),
        CharacterData(
            accountID(),
            title().c_str(),
            description().c_str(),
            gender(),
            bounty(),
            balance(),
            securityRating(),
            logonMinutes(),
            corporationID(),
            allianceID(),
			warFactionID(),
            stationID(),
            solarSystemID(),
            constellationID(),
            regionID(),
            ancestryID(),
            careerID(),
            schoolID(),
            careerSpecialityID(),
            startDateTime(),
            createDateTime(),
            corporationDateTime()
        )
    );

    // corporation data
    m_factory.db().SaveCorpMemberInfo(
        itemID(),
        CorpMemberInfo(
            corporationHQ(),
            corpRole(),
            rolesAtAll(),
            rolesAtBase(),
            rolesAtHQ(),
            rolesAtOther()
        )
    );
}
Пример #5
0
void EveApi::CharactersParser::parse( const QString& id, const QString& data,
                                      const QString& httpResponse,
                                      const QDateTime& cacheExpireTime )
{
    QString name = this->getRowsetAttribute(data, "name");
    QString key = this->getRowsetAttribute(data, "key");
    QStringList columns = this->getRowsetAttribute(data, "columns").split(QChar(','));

    QStringList characterIDs;
    characterIDs = this->getCharacterIds(data, key);
    QMap<QString, QString> rowValues;

    QList<CharacterData> characters;

    foreach(const QString& keyVal, characterIDs)
    {
        rowValues = this->getRowDataByName(name, key, keyVal, data, columns);
        characters.append(CharacterData(
                rowValues.value("name"), rowValues.value("characterID"),
                rowValues.value("corporationName"), rowValues.value("corporationID")));
    }
Пример #6
0
void
nsMutationReceiver::CharacterDataWillChange(nsIDocument *aDocument,
                                            nsIContent* aContent,
                                            CharacterDataChangeInfo* aInfo)
{
  if (nsAutoMutationBatch::IsBatching() ||
      !CharacterData() || !(Subtree() || aContent == Target()) ||
      aContent->ChromeOnlyAccess()) {
    return;
  }
  
  nsDOMMutationRecord* m =
    Observer()->CurrentRecord(NS_LITERAL_STRING("characterData"));
 
  NS_ASSERTION(!m->mTarget || m->mTarget == aContent,
               "Wrong target!");

  if (!m->mTarget) {
    m->mTarget = aContent;
  }
  if (CharacterDataOldValue() && m->mPrevValue.IsVoid()) { 
    aContent->GetText()->AppendTo(m->mPrevValue);
  }
}
Пример #7
0
const char*
XMLEntity::Data()
{
	return CharacterData();
}