From fc6486a1e0226301a4ab12816d43be374d2e3365 Mon Sep 17 00:00:00 2001 From: Orlin Dyankov Date: Fri, 11 Nov 2022 16:46:57 -0500 Subject: [PATCH] Disallow people to join with default yuzu name --- source/server/Client.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/source/server/Client.cpp b/source/server/Client.cpp index 9f8f1c4..37dd5de 100644 --- a/source/server/Client.cpp +++ b/source/server/Client.cpp @@ -1,10 +1,14 @@ #include "server/Client.hpp" +#include +#include #include "al/layout/SimpleLayoutAppearWaitEnd.h" +#include "al/util.hpp" #include "al/util/LiveActorUtil.h" #include "game/SaveData/SaveDataAccessFunction.h" #include "heap/seadHeapMgr.h" #include "logger.hpp" #include "packets/Packet.h" +#include "prim/seadSafeString.h" #include "server/hns/HideAndSeekMode.hpp" SEAD_SINGLETON_DISPOSER_IMPL(Client) @@ -55,7 +59,14 @@ Client::Client() { Logger::setLogName(playerName.name); // set Debug logger name to player name mUsername = playerName.name; - + + #if EMU + if (al::isEqualString(mUsername, "yuzu")) + { + mUsername = std::to_string(rand()).c_str(); + } + #endif + mUserID.print(); Logger::log("Player Name: %s\n", playerName.name); @@ -75,6 +86,11 @@ void Client::init(al::LayoutInitInfo const &initInfo, GameDataHolderAccessor hol mConnectStatus = new (mHeap) al::SimpleLayoutAppearWaitEnd("", "SaveMessage", initInfo, 0, false); + // #if EMU + + // #endif + + mConnectionWait->setTxtMessage(u"Connecting to Server."); mConnectionWait->setTxtMessageConfirm(u"Failed to Connect!");