mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-04-27 17:16:31 +00:00
Added reputation tracker in charxml
This commit is contained in:
parent
ba33c15b2d
commit
4bc5c8194f
@ -256,7 +256,11 @@ void CharacterComponent::LoadFromXML() {
|
|||||||
Game::logger->Log("CharacterComponent", "Failed to find char tag while loading XML!\n");
|
Game::logger->Log("CharacterComponent", "Failed to find char tag while loading XML!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (character->QueryAttribute("rpt", &m_Reputation) == tinyxml2::XML_NO_ATTRIBUTE) {
|
||||||
|
SetReputation(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Game::logger->Log("CharacterComponent", "error is %i", character->QueryAttribute("rpt", &m_Reputation));
|
||||||
character->QueryInt64Attribute("ls", &m_Uscore);
|
character->QueryInt64Attribute("ls", &m_Uscore);
|
||||||
|
|
||||||
// Load the statistics
|
// Load the statistics
|
||||||
@ -378,6 +382,8 @@ void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
character->SetAttribute("ls", m_Uscore);
|
character->SetAttribute("ls", m_Uscore);
|
||||||
|
// Custom attribute to keep track of reputation.
|
||||||
|
character->SetAttribute("rpt", GetReputation());
|
||||||
character->SetAttribute("stt", StatisticsToString().c_str());
|
character->SetAttribute("stt", StatisticsToString().c_str());
|
||||||
|
|
||||||
// Set the zone statistics of the form <zs><s/> ... <s/></zs>
|
// Set the zone statistics of the form <zs><s/> ... <s/></zs>
|
||||||
|
@ -146,6 +146,18 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool GetPvpEnabled() const;
|
bool GetPvpEnabled() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the characters lifetime reputation
|
||||||
|
* @return The lifetime reputation of this character.
|
||||||
|
*/
|
||||||
|
int64_t GetReputation() { return m_Reputation; };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the lifetime reputation of the character to newValue
|
||||||
|
* @param newValue the value to set reputation to
|
||||||
|
*/
|
||||||
|
void SetReputation(int64_t newValue) { m_Reputation = newValue; };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the current value of PvP combat being enabled
|
* Sets the current value of PvP combat being enabled
|
||||||
* @param value whether to enable PvP combat
|
* @param value whether to enable PvP combat
|
||||||
@ -291,6 +303,11 @@ private:
|
|||||||
*/
|
*/
|
||||||
int64_t m_Uscore;
|
int64_t m_Uscore;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The lifetime reputation earned by the entity
|
||||||
|
*/
|
||||||
|
int64_t m_Reputation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the character is landing by rocket
|
* Whether the character is landing by rocket
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user