From 4e227366facd1c05abf51d552372e4721a31ff46 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Tue, 9 Apr 2024 18:20:34 +0200 Subject: Online list: Added Refresh button and bumped client version to 8 Bumping client version to 8 is needed to get a SMSG_ONLINE_LIST reply at all, though it needs to be investigated what other changes are needed. --- src/gui/socialwindow.cpp | 6 ++++++ src/gui/socialwindow.h | 1 + src/net/tmwa/loginhandler.cpp | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp index a81117a6..953d347a 100644 --- a/src/gui/socialwindow.cpp +++ b/src/gui/socialwindow.cpp @@ -357,11 +357,13 @@ SocialWindow::SocialWindow() : mCreateButton = new Button(_("Create"), "create", this); mInviteButton = new Button(_("Invite"), "invite", this); mLeaveButton = new Button(_("Leave"), "leave", this); + mRefreshButton = new Button(_("Refresh"), "refresh", this); mTabs = new TabbedArea; place(0, 0, mCreateButton); place(1, 0, mInviteButton); place(2, 0, mLeaveButton); + place(3, 0, mRefreshButton); place(0, 1, mTabs, 4, 4); widgetResized(nullptr); @@ -518,6 +520,10 @@ void SocialWindow::action(const gcn::ActionEvent &event) { static_cast(mTabs->getSelectedTab())->leave(); } + else if (event.getId() == "refresh") + { + Net::getPlayerListHandler()->refreshList(); + } else if (event.getId() == "create guild") { std::string name = mGuildCreateDialog->getText(); diff --git a/src/gui/socialwindow.h b/src/gui/socialwindow.h index 29c21f98..9db8f020 100644 --- a/src/gui/socialwindow.h +++ b/src/gui/socialwindow.h @@ -98,6 +98,7 @@ protected: Button *mCreateButton; Button *mInviteButton; Button *mLeaveButton; + Button *mRefreshButton; TabbedArea *mTabs; }; diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index 8ee5e102..24bc9ab2 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -321,7 +321,7 @@ void LoginHandler::sendLoginRegister(const std::string &username, const std::string &password) { MessageOut outMsg(CMSG_LOGIN_REGISTER); - outMsg.writeInt32(6); // client version + outMsg.writeInt32(8); // client version outMsg.writeString(username, 24); outMsg.writeString(password, 24); -- cgit v1.2.3-70-g09d2