add: authentication failure handling and ingame error messages

This commit is contained in:
Matthew Toro 2026-04-04 19:56:53 -04:00
parent 14afabda0e
commit f238e682b3
13 changed files with 61 additions and 6 deletions

View file

@ -59,6 +59,7 @@
#include "PlayerChunkMap.h"
#include "Common\Telemetry\TelemetryManager.h"
#include "PlayerConnection.h"
#include "AuthScreen.h"
#ifdef _XBOX_ONE
#include "Durango\Network\NetworkPlayerDurango.h"
#endif
@ -648,6 +649,19 @@ bool MinecraftServer::initServer(int64_t seed, NetworkGameInitData *initData, DW
//motd = settings->getString(L"motd", L"A Minecraft Server");
//motd.replace('<27>', '$');
if (ShouldUseDedicatedServerProperties())
{
wstring am = GetDedicatedServerString(settings, L"auth-mode", L"session");
authMode = (am == L"offline") ? "offline" : "session";
}
else
{
int idx = AuthProfileManager::getSelectedIndex();
const auto &profiles = AuthProfileManager::getProfiles();
authMode = (idx >= 0 && idx < static_cast<int>(profiles.size()) &&
profiles[idx].type != AuthProfile::OFFLINE) ? "session" : "offline";
}
setAnimals(GetDedicatedServerBool(settings, L"spawn-animals", true));
setNpcsEnabled(GetDedicatedServerBool(settings, L"spawn-npcs", true));
setPvpAllowed(app.GetGameHostOption( eGameHostOption_PvP )>0?true:false);