Core/World: Move linking instance socket to WorldSession
Port From (https://github.com/TrinityCore/TrinityCore/commit/cb837ce926d6a8c13d5f74faea246fea19db91d0)
This commit is contained in:
@@ -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}");
|
||||
|
||||
Reference in New Issue
Block a user