mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Realms: Allow direct server ID, handle invalid ID (#1533)
This commit is contained in:
parent
8efb8d80a4
commit
9af9fe78ee
4 changed files with 21 additions and 8 deletions
|
|
@ -402,6 +402,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\config\MinecraftClient.ini" />
|
||||
<None Include="Resources\lang\de.ini" />
|
||||
<None Include="Resources\lang\en.ini" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
|
|
|||
|
|
@ -256,18 +256,28 @@ namespace MinecraftClient
|
|||
HandleFailure(Translations.Get("error.realms.access_denied"), false, ChatBot.DisconnectReason.LoginRejected);
|
||||
return;
|
||||
}
|
||||
int worldIndex = Convert.ToUInt16(addressInput.Split(':')[1]);
|
||||
string worldId = availableWorlds[worldIndex];
|
||||
string RealmsAddress = ProtocolHandler.GetRealmsWorldServerAddress(worldId, Settings.Username, session.PlayerID, session.ID);
|
||||
if (RealmsAddress != "")
|
||||
int worldIndex = 0;
|
||||
string worldId = addressInput.Split(':')[1];
|
||||
if (!availableWorlds.Contains(worldId) && int.TryParse(worldId, out worldIndex) && worldIndex < availableWorlds.Count)
|
||||
worldId = availableWorlds[worldIndex];
|
||||
if (availableWorlds.Contains(worldId))
|
||||
{
|
||||
addressInput = RealmsAddress;
|
||||
isRealms = true;
|
||||
Settings.ServerVersion = MCHighestVersion;
|
||||
string RealmsAddress = ProtocolHandler.GetRealmsWorldServerAddress(worldId, Settings.Username, session.PlayerID, session.ID);
|
||||
if (RealmsAddress != "")
|
||||
{
|
||||
addressInput = RealmsAddress;
|
||||
isRealms = true;
|
||||
Settings.ServerVersion = MCHighestVersion;
|
||||
}
|
||||
else
|
||||
{
|
||||
HandleFailure(Translations.Get("error.realms.server_unavailable"), false, ChatBot.DisconnectReason.LoginRejected);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HandleFailure(Translations.Get("error.realms.server_unavailable"), false, ChatBot.DisconnectReason.LoginRejected);
|
||||
HandleFailure(Translations.Get("error.realms.server_id"), false, ChatBot.DisconnectReason.LoginRejected);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ error.auth=§8Es gab einen Fehlercode vom Server, während die Authentication er
|
|||
error.realms.ip_error=Konnte die Server-IP deiner Realms-Welt nicht abfragen
|
||||
error.realms.access_denied=Diese Realms-Welt existiert nicht oder der Zugang wurde verweigert
|
||||
error.realms.server_unavailable=Der Realms-Server braucht ein wenig Zeit zum starten. Bitte versuche es später erneut.
|
||||
error.realms.server_id=Invalid or unknown Realms server ID.
|
||||
error.realms.disabled=Versuche der Realms-Welt beizutreten, allerdings wurde der Realms-Support in der Config deaktiviert
|
||||
|
||||
[internal command]
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ error.auth=§8Got error code from server while refreshing authentication: {0}
|
|||
error.realms.ip_error=Cannot retrieve the server IP of your Realms world
|
||||
error.realms.access_denied=This Realms world does not exist or access was denied
|
||||
error.realms.server_unavailable=Realms server may require some time to start up. Please retry again later.
|
||||
error.realms.server_id=Invalid or unknown Realms server ID.
|
||||
error.realms.disabled=Trying to join a Realms world but Realms support is disabled in config
|
||||
|
||||
[internal command]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue