From 9130b2d16e98e177117c992898dad50ab1c79e58 Mon Sep 17 00:00:00 2001 From: "Robin C. Ladiges" Date: Tue, 8 Oct 2024 19:38:32 +0200 Subject: [PATCH] notify players that they are banned or kicked from the server --- source/server/Client.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/server/Client.cpp b/source/server/Client.cpp index f30da5d..4d3f91c 100644 --- a/source/server/Client.cpp +++ b/source/server/Client.cpp @@ -76,8 +76,8 @@ void Client::init(al::LayoutInitInfo const &initInfo, GameDataHolderAccessor hol al::setPaneString(mConnectStatus, "TxtSaveSh", u"Connecting to Server.", 0); mUIMessage = new (mHeap) al::WindowConfirmWait("ServerWaitConnect", "WindowConfirmWait", initInfo); - mUIMessage->setTxtMessage(u"a"); - mUIMessage->setTxtMessageConfirm(u"b"); + mUIMessage->setTxtMessage(u"You've been kicked from the server."); + mUIMessage->setTxtMessageConfirm(u"You've been banned from the server!"); mHolder = holder; @@ -972,6 +972,16 @@ void Client::updateTagInfo(TagInf *packet) { */ void Client::sendToStage(ChangeStagePacket* packet) { if (mSceneInfo && mSceneInfo->mSceneObjHolder) { + if (!sInstance->mUIMessage->mIsAlive) { + if (strcmp(packet->changeStage, "$agogusStage") == 0) { // kicked + sInstance->mUIMessage->appear(); + nn::os::SleepThread(nn::TimeSpan::FromNanoSeconds(1500000000)); // wait 1.5s + } else if (strcmp(packet->changeStage, "$ejected") == 0) { // banned + sInstance->mUIMessage->appear(); + al::startAction(sInstance->mUIMessage, "Confirm", "State"); + nn::os::SleepThread(nn::TimeSpan::FromNanoSeconds(1500000000)); // wait 1.5s + } + } GameDataHolderAccessor accessor(mSceneInfo->mSceneObjHolder);