Core: Allow macOS arm64 client to connect
Port From (https://github.com/TrinityCore/TrinityCore/commit/6b2d12206c56222ddd7877a786d11701396fc63f)
This commit is contained in:
@@ -25,7 +25,7 @@ namespace BNetServer.Networking
|
|||||||
return BattlenetRpcErrorCode.BadProgram;
|
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})!");
|
Log.outDebug(LogFilter.Session, $"Battlenet.LogonRequest: {GetClientInfo()} attempted to log in from an unsupported platform (using {logonRequest.Platform})!");
|
||||||
return BattlenetRpcErrorCode.BadPlatform;
|
return BattlenetRpcErrorCode.BadPlatform;
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ public class RealmManager : Singleton<RealmManager>
|
|||||||
|
|
||||||
void LoadBuildInfo()
|
void LoadBuildInfo()
|
||||||
{
|
{
|
||||||
// 0 1 2 3 4 5 6
|
// 0 1 2 3 4 5 6 7
|
||||||
SQLResult result = DB.Login.Query("SELECT majorVersion, minorVersion, bugfixVersion, hotfixVersion, build, win64AuthSeed, mac64AuthSeed FROM build_info ORDER BY build ASC");
|
SQLResult result = DB.Login.Query("SELECT majorVersion, minorVersion, bugfixVersion, hotfixVersion, build, win64AuthSeed, mac64AuthSeed, macArmAuthSeed FROM build_info ORDER BY build ASC");
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
@@ -59,6 +59,10 @@ public class RealmManager : Singleton<RealmManager>
|
|||||||
if (!mac64AuthSeedHexStr.IsEmpty() && mac64AuthSeedHexStr.Length == build.Mac64AuthSeed.Length * 2)
|
if (!mac64AuthSeedHexStr.IsEmpty() && mac64AuthSeedHexStr.Length == build.Mac64AuthSeed.Length * 2)
|
||||||
build.Mac64AuthSeed = mac64AuthSeedHexStr.ToByteArray();
|
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);
|
_builds.Add(build);
|
||||||
|
|
||||||
} while (result.NextRow());
|
} while (result.NextRow());
|
||||||
@@ -400,4 +404,5 @@ public class RealmBuildInfo
|
|||||||
public char[] HotfixVersion = new char[4];
|
public char[] HotfixVersion = new char[4];
|
||||||
public byte[] Win64AuthSeed = new byte[16];
|
public byte[] Win64AuthSeed = new byte[16];
|
||||||
public byte[] Mac64AuthSeed = new byte[16];
|
public byte[] Mac64AuthSeed = new byte[16];
|
||||||
|
public byte[] MacArmAuthSeed = new byte[16];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -489,6 +489,8 @@ namespace Game.Networking
|
|||||||
digestKeyHash.Finish(buildInfo.Win64AuthSeed);
|
digestKeyHash.Finish(buildInfo.Win64AuthSeed);
|
||||||
else if (account.game.OS == "Mc64")
|
else if (account.game.OS == "Mc64")
|
||||||
digestKeyHash.Finish(buildInfo.Mac64AuthSeed);
|
digestKeyHash.Finish(buildInfo.Mac64AuthSeed);
|
||||||
|
else if (account.game.OS == "MacA")
|
||||||
|
digestKeyHash.Finish(buildInfo.MacArmAuthSeed);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log.outError(LogFilter.Network, "WorldSocket.HandleAuthSession: Authentication failed for account: {0} ('{1}') address: {2}", account.game.Id, authSession.RealmJoinTicket, address);
|
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
|
// Must be done before WorldSession is created
|
||||||
bool wardenActive = WorldConfig.GetBoolValue(WorldCfg.WardenEnabled);
|
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);
|
SendAuthResponseError(BattlenetRpcErrorCode.Denied);
|
||||||
Log.outError(LogFilter.Network, "WorldSocket.HandleAuthSession: Client {0} attempted to log in using invalid client OS ({1}).", address, account.game.OS);
|
Log.outError(LogFilter.Network, "WorldSocket.HandleAuthSession: Client {0} attempted to log in using invalid client OS ({1}).", address, account.game.OS);
|
||||||
|
|||||||
Reference in New Issue
Block a user