Core: Allow macOS arm64 client to connect

Port From (https://github.com/TrinityCore/TrinityCore/commit/6b2d12206c56222ddd7877a786d11701396fc63f)
This commit is contained in:
Hondacrx
2024-10-09 00:46:39 -04:00
parent 0fd399e92e
commit 71cc76d6b6
3 changed files with 11 additions and 4 deletions
@@ -25,7 +25,7 @@ namespace BNetServer.Networking
return BattlenetRpcErrorCode.BadProgram;
}
if (logonRequest.Platform != "Win" && logonRequest.Platform != "Wn64" && logonRequest.Platform != "Mc64")
if (logonRequest.Platform != "Win" && logonRequest.Platform != "Wn64" && logonRequest.Platform != "Mc64" && logonRequest.Platform != "MacA")
{
Log.outDebug(LogFilter.Session, $"Battlenet.LogonRequest: {GetClientInfo()} attempted to log in from an unsupported platform (using {logonRequest.Platform})!");
return BattlenetRpcErrorCode.BadPlatform;
+7 -2
View File
@@ -36,8 +36,8 @@ public class RealmManager : Singleton<RealmManager>
void LoadBuildInfo()
{
// 0 1 2 3 4 5 6
SQLResult result = DB.Login.Query("SELECT majorVersion, minorVersion, bugfixVersion, hotfixVersion, build, win64AuthSeed, mac64AuthSeed FROM build_info ORDER BY build ASC");
// 0 1 2 3 4 5 6 7
SQLResult result = DB.Login.Query("SELECT majorVersion, minorVersion, bugfixVersion, hotfixVersion, build, win64AuthSeed, mac64AuthSeed, macArmAuthSeed FROM build_info ORDER BY build ASC");
if (!result.IsEmpty())
{
do
@@ -59,6 +59,10 @@ public class RealmManager : Singleton<RealmManager>
if (!mac64AuthSeedHexStr.IsEmpty() && mac64AuthSeedHexStr.Length == build.Mac64AuthSeed.Length * 2)
build.Mac64AuthSeed = mac64AuthSeedHexStr.ToByteArray();
string macArmAuthSeedHexStr = result.Read<string>(7);
if (macArmAuthSeedHexStr.IsEmpty() && mac64AuthSeedHexStr.Length == build.MacArmAuthSeed.Length * 2)
build.MacArmAuthSeed = macArmAuthSeedHexStr.ToByteArray();
_builds.Add(build);
} while (result.NextRow());
@@ -400,4 +404,5 @@ public class RealmBuildInfo
public char[] HotfixVersion = new char[4];
public byte[] Win64AuthSeed = new byte[16];
public byte[] Mac64AuthSeed = new byte[16];
public byte[] MacArmAuthSeed = new byte[16];
}
+3 -1
View File
@@ -489,6 +489,8 @@ namespace Game.Networking
digestKeyHash.Finish(buildInfo.Win64AuthSeed);
else if (account.game.OS == "Mc64")
digestKeyHash.Finish(buildInfo.Mac64AuthSeed);
else if (account.game.OS == "MacA")
digestKeyHash.Finish(buildInfo.MacArmAuthSeed);
else
{
Log.outError(LogFilter.Network, "WorldSocket.HandleAuthSession: Authentication failed for account: {0} ('{1}') address: {2}", account.game.Id, authSession.RealmJoinTicket, address);
@@ -567,7 +569,7 @@ namespace Game.Networking
// Must be done before WorldSession is created
bool wardenActive = WorldConfig.GetBoolValue(WorldCfg.WardenEnabled);
if (wardenActive && account.game.OS != "Win" && account.game.OS != "Wn64" && account.game.OS != "Mc64")
if (wardenActive && account.game.OS != "Win" && account.game.OS != "Wn64" && account.game.OS != "Mc64" && account.game.OS != "MacA")
{
SendAuthResponseError(BattlenetRpcErrorCode.Denied);
Log.outError(LogFilter.Network, "WorldSocket.HandleAuthSession: Client {0} attempted to log in using invalid client OS ({1}).", address, account.game.OS);