diff --git a/src/Player.cpp b/src/Player.cpp index e067190f..a8d1b642 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -813,6 +813,8 @@ void Player::check_logindata() { charQuery.addColumn("chars", "chr_lastsavetime"); charQuery.addColumn("chars", "chr_sex"); charQuery.addColumn("chars", "chr_race"); + charQuery.addColumn("chars", "chr_shortdesc_de"); + charQuery.addColumn("chars", "chr_shortdesc_us"); charQuery.addEqualCondition("chars", "chr_name", getName()); charQuery.addServerTable("chars"); @@ -836,6 +838,8 @@ void Player::check_logindata() { lastsavetime = charRow["chr_lastsavetime"].as(); setAttribute(Character::sex, charRow["chr_sex"].as()); setRace(charRow["chr_race"].as()); + descriptionEn = charRow["chr_shortdesc_us"].as(); + descriptionDe = charRow["chr_shortdesc_de"].as(); // first we check the status since we already retrieved it switch (status) { @@ -1080,6 +1084,8 @@ auto Player::save() noexcept -> bool { query.addAssignColumn("chr_lastip", last_ip); query.addAssignColumn("chr_onlinetime", onlinetime + lastsavetime - logintime); query.addAssignColumn("chr_lastsavetime", lastsavetime); + query.addAssignColumn("chr_shortdesc_us", descriptionEn); + query.addAssignColumn("chr_shortdesc_de", descriptionDe); if (status != 0) { query.addAssignColumn("chr_statustime", statustime); diff --git a/src/Player.hpp b/src/Player.hpp index 5f0b3453..7fc55e5e 100644 --- a/src/Player.hpp +++ b/src/Player.hpp @@ -141,8 +141,15 @@ class Player : public Character { CLIENTCOMMANDLIST immediateCommands; CLIENTCOMMANDLIST queuedCommands; std::mutex commandMutex; + TYPE_OF_ENGLISH descriptionEn; + TYPE_OF_GERMAN descriptionDe; public: + auto getDescriptionEn() const -> TYPE_OF_ENGLISH { return descriptionEn; } + void setDescriptionEn(const TYPE_OF_ENGLISH &descrEn) { descriptionEn = descrEn; } + auto getDescriptionDe() const -> TYPE_OF_GERMAN { return descriptionDe; } + void setDescriptionDe(const TYPE_OF_GERMAN &descrDe) { descriptionDe = descrDe; } + void receiveCommand(const ClientCommandPointer &cmd); void stopAttack() override; diff --git a/src/script/binding/player.cpp b/src/script/binding/player.cpp index 87485169..3a14cf10 100644 --- a/src/script/binding/player.cpp +++ b/src/script/binding/player.cpp @@ -26,6 +26,12 @@ namespace binding { auto player() -> Binding { return luabind::class_("Player") + .def("knows", &Player::knows) + .def("getCustomNameOf", &Player::getCustomNameOf) + .def("getDescriptionEn", &Player::getDescriptionEn) + .def("setDescriptionEn", &Player::setDescriptionEn) + .def("getDescriptionDe", &Player::getDescriptionDe) + .def("setDescriptionDe", &Player::setDescriptionDe) .enum_("player_language")[luabind::value("german", static_cast(Language::german)), luabind::value("english", static_cast(Language::english))] .enum_("quest_availability")[luabind::value("questAvailable", static_cast(questAvailable)),