diff --git a/include/liblobby/LobbyMessages.h b/include/liblobby/LobbyMessages.h index 125b64e..f554250 100644 --- a/include/liblobby/LobbyMessages.h +++ b/include/liblobby/LobbyMessages.h @@ -286,8 +286,7 @@ class LobbyMessage_PlayerList : public LobbyMessage for(unsigned i = 0; i < list.size(); ++i) { const LobbyPlayerInfo* player = list.getElement(i); - LOG.writeToFile(" %d: %d %s %s %d %d %d\n") % i % player->getId() % player->getName() - % player->getVersion() % player->getPunkte() % player->getGewonnen() % player->getVerloren(); + LOG.writeToFile(" %d: %d %s %s\n") % i % player->getId() % player->getName() % player->getVersion(); } } @@ -329,8 +328,7 @@ class LobbyMessage_PlayerList : public LobbyMessage for(unsigned i = 0; i < list.size(); ++i) { const LobbyPlayerInfo* player = list.getElement(i); - LOG.writeToFile(" %d: %d %s %s %d %d %d\n") % i % player->getId() % player->getName() - % player->getVersion() % player->getPunkte() % player->getGewonnen() % player->getVerloren(); + LOG.writeToFile(" %d: %d %s %s\n") % i % player->getId() % player->getName() % player->getVersion(); } return cb->OnNMSLobbyPlayerList(id, list, ingamePlayers); diff --git a/include/liblobby/LobbyPlayerInfo.h b/include/liblobby/LobbyPlayerInfo.h index b784407..844cc34 100644 --- a/include/liblobby/LobbyPlayerInfo.h +++ b/include/liblobby/LobbyPlayerInfo.h @@ -25,17 +25,11 @@ class LobbyPlayerInfo std::string getName() const { return name_; } std::string getEmail() const { return email_; } std::string getVersion() const { return version_; } - int getPunkte() const { return punkte_; } - unsigned getGewonnen() const { return gewonnen_; } - unsigned getVerloren() const { return verloren_; } void setId(const unsigned playerId) { this->playerId_ = playerId; } void setName(const std::string& name) { this->name_ = name; } void setEmail(const std::string& email) { this->email_ = email; } void setVersion(const std::string& version) { this->version_ = version; } - void setPunkte(const unsigned punkte) { this->punkte_ = punkte; } - void setGewonnen(const unsigned gewonnen) { this->gewonnen_ = gewonnen; } - void setVerloren(const unsigned verloren) { this->verloren_ = verloren; } /// Is the player in a game (not synchronized ATM) bool isIngame; @@ -45,7 +39,4 @@ class LobbyPlayerInfo std::string name_; std::string email_; std::string version_; - int punkte_; - unsigned gewonnen_; - unsigned verloren_; }; diff --git a/src/LobbyPlayerInfo.cpp b/src/LobbyPlayerInfo.cpp index f38bf0f..9a67f59 100644 --- a/src/LobbyPlayerInfo.cpp +++ b/src/LobbyPlayerInfo.cpp @@ -24,12 +24,9 @@ LobbyPlayerInfo::LobbyPlayerInfo(const unsigned /*playerId*/, Serializer& ser) */ void LobbyPlayerInfo::clear() { - playerId_ = 0; + playerId_ = static_cast(-1); name_.clear(); version_.clear(); - punkte_ = 0; - gewonnen_ = 0; - verloren_ = 0; isIngame = false; } @@ -43,9 +40,9 @@ void LobbyPlayerInfo::serialize(Serializer& ser) const ser.PushUnsignedInt(playerId_); ser.PushLongString(name_); ser.PushLongString(version_); - ser.PushSignedInt(punkte_); - ser.PushUnsignedInt(gewonnen_); - ser.PushUnsignedInt(verloren_); + ser.PushSignedInt(0); // points + ser.PushUnsignedInt(0); // games won + ser.PushUnsignedInt(0); // games lost } /** @@ -58,7 +55,7 @@ void LobbyPlayerInfo::deserialize(Serializer& ser) playerId_ = ser.PopUnsignedInt(); name_ = ser.PopLongString(); version_ = ser.PopLongString(); - punkte_ = ser.PopSignedInt(); - gewonnen_ = ser.PopUnsignedInt(); - verloren_ = ser.PopUnsignedInt(); + ser.PopSignedInt(); // points + ser.PopUnsignedInt(); // games won + ser.PopUnsignedInt(); // games lost }