Don't send player updates unless info changed (#389)

This commit is contained in:
in1tiate 2025-01-02 13:20:11 -06:00 committed by GitHub
parent ecc981ae53
commit 3ddd53e121
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -502,8 +502,10 @@ QString AOClient::name() const { return m_ooc_name; }
void AOClient::setName(const QString &f_name) void AOClient::setName(const QString &f_name)
{ {
m_ooc_name = f_name; if (f_name != m_ooc_name) {
Q_EMIT nameChanged(m_ooc_name); m_ooc_name = f_name;
Q_EMIT nameChanged(m_ooc_name);
}
} }
int AOClient::areaId() const int AOClient::areaId() const
@ -513,8 +515,10 @@ int AOClient::areaId() const
void AOClient::setAreaId(const int f_area_id) void AOClient::setAreaId(const int f_area_id)
{ {
m_current_area = f_area_id; if (f_area_id != m_current_area) {
Q_EMIT areaIdChanged(m_current_area); m_current_area = f_area_id;
Q_EMIT areaIdChanged(m_current_area);
}
} }
QString AOClient::character() const QString AOClient::character() const
@ -524,16 +528,20 @@ QString AOClient::character() const
void AOClient::setCharacter(const QString &f_character) void AOClient::setCharacter(const QString &f_character)
{ {
m_current_char = f_character; if (f_character != m_current_char) {
Q_EMIT characterChanged(m_current_char); m_current_char = f_character;
Q_EMIT characterChanged(m_current_char);
}
} }
QString AOClient::characterName() const { return m_showname; } QString AOClient::characterName() const { return m_showname; }
void AOClient::setCharacterName(const QString &f_showname) void AOClient::setCharacterName(const QString &f_showname)
{ {
m_showname = f_showname; if (f_showname != m_showname) {
Q_EMIT characterNameChanged(m_showname); m_showname = f_showname;
Q_EMIT characterNameChanged(m_showname);
}
} }
void AOClient::setSpectator(bool f_spectator) void AOClient::setSpectator(bool f_spectator)