Core/World: Move linking instance socket to WorldSession

Port From (https://github.com/TrinityCore/TrinityCore/commit/cb837ce926d6a8c13d5f74faea246fea19db91d0)
This commit is contained in:
Hondacrx
2025-08-13 22:11:58 -04:00
parent 442e7dcde2
commit 4463e85ed9
2 changed files with 25 additions and 29 deletions
+17 -2
View File
@@ -373,6 +373,23 @@ namespace Game
return true;
}
public static void AddInstanceConnection(WorldSession session, WorldSocket socket, ConnectToKey key)
{
if (socket == null || !socket.IsOpen())
return;
if (session == null || session.GetConnectToInstanceKey() != key.Raw)
{
socket.SendAuthResponseError(BattlenetRpcErrorCode.TimedOut);
socket.CloseSocket();
return;
}
socket.SetWorldSession(session);
session.m_Socket[(int)ConnectionType.Instance] = socket;
session.HandleContinuePlayerLogin();
}
public void QueuePacket(WorldPacket packet)
{
_recvQueue.Enqueue(packet);
@@ -411,8 +428,6 @@ namespace Game
m_Socket[(int)conIdx].SendPacket(packet);
}
public void AddInstanceConnection(WorldSocket sock) { m_Socket[(int)ConnectionType.Instance] = sock; }
public void KickPlayer(string reason)
{
Log.outInfo(LogFilter.Network, $"Account: {GetAccountId()} Character: '{(_player != null ? _player.GetName() : "<none>")}' {(_player != null ? _player.GetGUID() : "")} kicked with reason: {reason}");