Skip to content

Commit

Permalink
notify players that they are banned or kicked from the server
Browse files Browse the repository at this point in the history
  • Loading branch information
Istador committed Oct 8, 2024
1 parent ad79fe1 commit 9130b2d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions source/server/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 9130b2d

Please sign in to comment.