Core/PacketIO: Remove packet handlers for deleted opcodes
Port From (https://github.com/TrinityCore/TrinityCore/commit/83b32667940844a257059965711284c9ab38ce44)
This commit is contained in:
@@ -35,17 +35,6 @@ namespace Framework.Constants
|
||||
HordeAllianceChallenge
|
||||
}
|
||||
|
||||
public enum BFLeaveReason
|
||||
{
|
||||
Close = 1,
|
||||
//BF_LEAVE_REASON_UNK1 = 2, (not used)
|
||||
//BF_LEAVE_REASON_UNK2 = 4, (not used)
|
||||
Exited = 8,
|
||||
LowLevel = 10,
|
||||
NotWhileInRaid = 15,
|
||||
Deserter = 16
|
||||
}
|
||||
|
||||
public enum BattlefieldState
|
||||
{
|
||||
Inactive = 0,
|
||||
|
||||
@@ -95,7 +95,6 @@ namespace Game.BattleFields
|
||||
if (m_PlayersInWar[player.GetTeamId()].Contains(player.GetGUID()))
|
||||
{
|
||||
m_PlayersInWar[player.GetTeamId()].Remove(player.GetGUID());
|
||||
player.GetSession().SendBfLeaveMessage(GetQueueId(), GetState(), player.GetZoneId() == GetZoneId());
|
||||
Group group = player.GetGroup();
|
||||
if (group) // Remove the player from the raid group
|
||||
group.RemoveMember(player.GetGUID());
|
||||
@@ -209,7 +208,7 @@ namespace Game.BattleFields
|
||||
return;
|
||||
|
||||
if (m_PlayersInQueue[player.GetTeamId()].Count <= m_MinPlayer || m_PlayersInQueue[GetOtherTeam(player.GetTeamId())].Count >= m_MinPlayer)
|
||||
player.GetSession().SendBfInvitePlayerToQueue(GetQueueId(), GetState());
|
||||
PlayerAcceptInviteToQueue(player);
|
||||
}
|
||||
|
||||
void InvitePlayersInQueueToWar()
|
||||
@@ -282,7 +281,7 @@ namespace Game.BattleFields
|
||||
|
||||
m_PlayersWillBeKick[player.GetTeamId()].Remove(player.GetGUID());
|
||||
m_InvitedPlayers[player.GetTeamId()][player.GetGUID()] = GameTime.GetGameTime() + m_TimeForAcceptInvite;
|
||||
player.GetSession().SendBfInvitePlayerToWar(GetQueueId(), m_ZoneId, m_TimeForAcceptInvite);
|
||||
PlayerAcceptInviteToWar(player);
|
||||
}
|
||||
|
||||
public void InitStalker(uint entry, Position pos)
|
||||
@@ -369,8 +368,6 @@ namespace Game.BattleFields
|
||||
{
|
||||
// Add player in queue
|
||||
m_PlayersInQueue[player.GetTeamId()].Add(player.GetGUID());
|
||||
// Send notification
|
||||
player.GetSession().SendBfQueueInviteResponse(GetQueueId(), m_ZoneId, GetState());
|
||||
}
|
||||
|
||||
// Called in WorldSession:HandleBfExitRequest
|
||||
@@ -396,7 +393,6 @@ namespace Game.BattleFields
|
||||
|
||||
if (AddOrSetPlayerToCorrectBfGroup(player))
|
||||
{
|
||||
player.GetSession().SendBfEntered(GetQueueId(), player.GetZoneId() != GetZoneId(), player.GetTeamId() == GetAttackerTeam());
|
||||
m_PlayersInWar[player.GetTeamId()].Add(player.GetGUID());
|
||||
m_InvitedPlayers[player.GetTeamId()].Remove(player.GetGUID());
|
||||
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.BattleFields;
|
||||
using Game.Networking.Packets;
|
||||
|
||||
namespace Game
|
||||
{
|
||||
public partial class WorldSession
|
||||
{
|
||||
/// <summary>
|
||||
/// This send to player windows for invite player to join the war.
|
||||
/// </summary>
|
||||
/// <param name="queueId">The queue id of Bf</param>
|
||||
/// <param name="zoneId">The zone where the battle is (4197 for wg)</param>
|
||||
/// <param name="acceptTime">Time in second that the player have for accept</param>
|
||||
public void SendBfInvitePlayerToWar(ulong queueId, uint zoneId, uint acceptTime)
|
||||
{
|
||||
BFMgrEntryInvite bfMgrEntryInvite = new();
|
||||
bfMgrEntryInvite.QueueID = queueId;
|
||||
bfMgrEntryInvite.AreaID = (int)zoneId;
|
||||
bfMgrEntryInvite.ExpireTime = GameTime.GetGameTime() + acceptTime;
|
||||
SendPacket(bfMgrEntryInvite);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This send invitation to player to join the queue.
|
||||
/// </summary>
|
||||
/// <param name="queueId">The queue id of Bf</param>
|
||||
/// <param name="battleState">Battlefield State</param>
|
||||
public void SendBfInvitePlayerToQueue(ulong queueId, BattlefieldState battleState)
|
||||
{
|
||||
BFMgrQueueInvite bfMgrQueueInvite = new();
|
||||
bfMgrQueueInvite.QueueID = queueId;
|
||||
bfMgrQueueInvite.BattleState = battleState;
|
||||
SendPacket(bfMgrQueueInvite);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This send packet for inform player that he join queue.
|
||||
/// </summary>
|
||||
/// <param name="queueId">The queue id of Bf</param>
|
||||
/// <param name="zoneId">The zone where the battle is (4197 for wg)</param>
|
||||
/// <param name="battleStatus">Battlefield status</param>
|
||||
/// <param name="canQueue">if able to queue</param>
|
||||
/// <param name="loggingIn">on log in send queue status</param>
|
||||
public void SendBfQueueInviteResponse(ulong queueId, uint zoneId, BattlefieldState battleStatus, bool canQueue = true, bool loggingIn = false)
|
||||
{
|
||||
BFMgrQueueRequestResponse bfMgrQueueRequestResponse = new();
|
||||
bfMgrQueueRequestResponse.QueueID = queueId;
|
||||
bfMgrQueueRequestResponse.AreaID = (int)zoneId;
|
||||
bfMgrQueueRequestResponse.Result = (sbyte)(canQueue ? 1 : 0);
|
||||
bfMgrQueueRequestResponse.BattleState = battleStatus;
|
||||
bfMgrQueueRequestResponse.LoggingIn = loggingIn;
|
||||
SendPacket(bfMgrQueueRequestResponse);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is call when player accept to join war.
|
||||
/// </summary>
|
||||
/// <param name="queueId">The queue id of Bf</param>
|
||||
/// <param name="relocated">Whether player is added to Bf on the spot or teleported from queue</param>
|
||||
/// <param name="onOffense">Whether player belongs to attacking team or not</param>
|
||||
public void SendBfEntered(ulong queueId, bool relocated, bool onOffense)
|
||||
{
|
||||
BFMgrEntering bfMgrEntering = new();
|
||||
bfMgrEntering.ClearedAFK = _player.IsAFK();
|
||||
bfMgrEntering.Relocated = relocated;
|
||||
bfMgrEntering.OnOffense = onOffense;
|
||||
bfMgrEntering.QueueID = queueId;
|
||||
SendPacket(bfMgrEntering);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is call when player leave battlefield zone.
|
||||
/// </summary>
|
||||
/// <param name="queueId">The queue id of Bf</param>
|
||||
/// <param name="battleState">Battlefield status</param>
|
||||
/// <param name="relocated">Whether player is added to Bf on the spot or teleported from queue</param>
|
||||
/// <param name="reason">Reason why player left battlefield</param>
|
||||
public void SendBfLeaveMessage(ulong queueId, BattlefieldState battleState, bool relocated, BFLeaveReason reason = BFLeaveReason.Exited)
|
||||
{
|
||||
BFMgrEjected bfMgrEjected = new();
|
||||
bfMgrEjected.QueueID = queueId;
|
||||
bfMgrEjected.Reason = reason;
|
||||
bfMgrEjected.BattleState = battleState;
|
||||
bfMgrEjected.Relocated = relocated;
|
||||
SendPacket(bfMgrEjected);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send by client on clicking in accept or refuse of invitation windows for join game.
|
||||
/// </summary>
|
||||
//[WorldPacketHandler(ClientOpcodes.BfMgrEntryInviteResponse)]
|
||||
void HandleBfEntryInviteResponse(BFMgrEntryInviteResponse bfMgrEntryInviteResponse)
|
||||
{
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldByQueueId(bfMgrEntryInviteResponse.QueueID);
|
||||
if (bf == null)
|
||||
return;
|
||||
|
||||
// If player accept invitation
|
||||
if (bfMgrEntryInviteResponse.AcceptedInvite)
|
||||
{
|
||||
bf.PlayerAcceptInviteToWar(GetPlayer());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetPlayer().GetZoneId() == bf.GetZoneId())
|
||||
bf.KickPlayerFromBattlefield(GetPlayer().GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send by client when he click on accept for queue.
|
||||
/// </summary>
|
||||
//[WorldPacketHandler(ClientOpcodes.BfMgrQueueInviteResponse)]
|
||||
void HandleBfQueueInviteResponse(BFMgrQueueInviteResponse bfMgrQueueInviteResponse)
|
||||
{
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldByQueueId(bfMgrQueueInviteResponse.QueueID);
|
||||
if (bf == null)
|
||||
return;
|
||||
|
||||
if (bfMgrQueueInviteResponse.AcceptedInvite)
|
||||
bf.PlayerAcceptInviteToQueue(GetPlayer());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send by client when exited battlefield
|
||||
/// </summary>
|
||||
//[WorldPacketHandler(ClientOpcodes.BfMgrQueueExitRequest)]
|
||||
void HandleBfExitRequest(BFMgrQueueExitRequest bfMgrQueueExitRequest)
|
||||
{
|
||||
BattleField bf = Global.BattleFieldMgr.GetBattlefieldByQueueId(bfMgrQueueExitRequest.QueueID);
|
||||
if (bf == null)
|
||||
return;
|
||||
|
||||
bf.AskToLeaveQueue(GetPlayer());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,20 @@ namespace Game.Networking.Packets
|
||||
public ObjectGuid HealerGuid;
|
||||
}
|
||||
|
||||
public class AreaSpiritHealerTime : ServerPacket
|
||||
{
|
||||
public AreaSpiritHealerTime() : base(ServerOpcodes.AreaSpiritHealerTime) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(HealerGuid);
|
||||
_worldPacket.WriteUInt32(TimeLeft);
|
||||
}
|
||||
|
||||
public ObjectGuid HealerGuid;
|
||||
public uint TimeLeft;
|
||||
}
|
||||
|
||||
public class AreaSpiritHealerQueue : ClientPacket
|
||||
{
|
||||
public AreaSpiritHealerQueue(WorldPacket packet) : base(packet) { }
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Entities;
|
||||
|
||||
namespace Game.Networking.Packets
|
||||
{
|
||||
class BFMgrEntryInvite : ServerPacket
|
||||
{
|
||||
public BFMgrEntryInvite() : base(ServerOpcodes.None) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt64(QueueID);
|
||||
_worldPacket.WriteInt32(AreaID);
|
||||
_worldPacket.WriteUInt32((uint)ExpireTime);
|
||||
}
|
||||
|
||||
public ulong QueueID;
|
||||
public int AreaID;
|
||||
public long ExpireTime;
|
||||
}
|
||||
|
||||
class BFMgrEntryInviteResponse : ClientPacket
|
||||
{
|
||||
public BFMgrEntryInviteResponse(WorldPacket packet) : base(packet) { }
|
||||
|
||||
public override void Read()
|
||||
{
|
||||
QueueID = _worldPacket.ReadUInt64();
|
||||
AcceptedInvite = _worldPacket.HasBit();
|
||||
}
|
||||
|
||||
public ulong QueueID;
|
||||
public bool AcceptedInvite;
|
||||
}
|
||||
|
||||
class BFMgrQueueInvite : ServerPacket
|
||||
{
|
||||
public BFMgrQueueInvite() : base(ServerOpcodes.None) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt64(QueueID);
|
||||
_worldPacket.WriteInt8((sbyte)BattleState);
|
||||
_worldPacket.WriteUInt32(Timeout);
|
||||
_worldPacket.WriteInt32(MinLevel);
|
||||
_worldPacket.WriteInt32(MaxLevel);
|
||||
_worldPacket.WriteInt32(MapID);
|
||||
_worldPacket.WriteUInt32(InstanceID);
|
||||
_worldPacket.WriteBit(Index != 0);
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
|
||||
public ulong QueueID;
|
||||
public BattlefieldState BattleState;
|
||||
public uint Timeout = uint.MaxValue; // unused in client
|
||||
public int MinLevel; // unused in client
|
||||
public int MaxLevel; // unused in client
|
||||
public int MapID; // unused in client
|
||||
public uint InstanceID; // unused in client
|
||||
public sbyte Index; // unused in client
|
||||
}
|
||||
|
||||
class BFMgrQueueInviteResponse : ClientPacket
|
||||
{
|
||||
public BFMgrQueueInviteResponse(WorldPacket packet) : base(packet) { }
|
||||
|
||||
public override void Read()
|
||||
{
|
||||
QueueID = _worldPacket.ReadUInt64();
|
||||
AcceptedInvite = _worldPacket.HasBit();
|
||||
}
|
||||
|
||||
public ulong QueueID;
|
||||
public bool AcceptedInvite;
|
||||
}
|
||||
|
||||
class BFMgrQueueRequestResponse : ServerPacket
|
||||
{
|
||||
public BFMgrQueueRequestResponse() : base(ServerOpcodes.None) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt64(QueueID);
|
||||
_worldPacket.WriteInt32(AreaID);
|
||||
_worldPacket.WriteInt8(Result);
|
||||
_worldPacket.WritePackedGuid(FailedPlayerGUID);
|
||||
_worldPacket.WriteInt8((sbyte)BattleState);
|
||||
_worldPacket.WriteBit(LoggingIn);
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
|
||||
public ulong QueueID;
|
||||
public int AreaID;
|
||||
public sbyte Result;
|
||||
public ObjectGuid FailedPlayerGUID;
|
||||
public BattlefieldState BattleState;
|
||||
public bool LoggingIn;
|
||||
}
|
||||
|
||||
class BFMgrQueueExitRequest : ClientPacket
|
||||
{
|
||||
public BFMgrQueueExitRequest(WorldPacket packet) : base(packet) { }
|
||||
|
||||
public override void Read()
|
||||
{
|
||||
QueueID = _worldPacket.ReadUInt64();
|
||||
}
|
||||
|
||||
public ulong QueueID;
|
||||
}
|
||||
|
||||
class BFMgrEntering : ServerPacket
|
||||
{
|
||||
public BFMgrEntering() : base(ServerOpcodes.None, ConnectionType.Instance) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteBit(ClearedAFK);
|
||||
_worldPacket.WriteBit(Relocated);
|
||||
_worldPacket.WriteBit(OnOffense);
|
||||
_worldPacket.WriteUInt64(QueueID);
|
||||
}
|
||||
|
||||
public bool ClearedAFK;
|
||||
public bool Relocated;
|
||||
public bool OnOffense;
|
||||
public ulong QueueID;
|
||||
}
|
||||
|
||||
class BFMgrEjected : ServerPacket
|
||||
{
|
||||
public BFMgrEjected() : base(ServerOpcodes.None, ConnectionType.Instance) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt64(QueueID);
|
||||
_worldPacket.WriteInt8((sbyte)Reason);
|
||||
_worldPacket.WriteInt8((sbyte)BattleState);
|
||||
_worldPacket.WriteBit(Relocated);
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
|
||||
public ulong QueueID;
|
||||
public BFLeaveReason Reason;
|
||||
public BattlefieldState BattleState;
|
||||
public bool Relocated;
|
||||
}
|
||||
|
||||
public class AreaSpiritHealerTime : ServerPacket
|
||||
{
|
||||
public AreaSpiritHealerTime() : base(ServerOpcodes.AreaSpiritHealerTime) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(HealerGuid);
|
||||
_worldPacket.WriteUInt32(TimeLeft);
|
||||
}
|
||||
|
||||
public ObjectGuid HealerGuid;
|
||||
public uint TimeLeft;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user