Let ServerPacket Handle the writting of packet data.
This commit is contained in:
@@ -1401,13 +1401,12 @@ namespace Game
|
||||
public bool SendZoneMessage(uint zone, ServerPacket packet, WorldSession self = null, uint team = 0)
|
||||
{
|
||||
bool foundPlayerToSend = false;
|
||||
packet.Write();
|
||||
foreach (var session in m_sessions.Values)
|
||||
{
|
||||
if (session != null && session.GetPlayer() && session.GetPlayer().IsInWorld &&
|
||||
session.GetPlayer().GetZoneId() == zone && session != self && (team == 0 || (uint)session.GetPlayer().GetTeam() == team))
|
||||
{
|
||||
session.SendPacket(packet, false);
|
||||
session.SendPacket(packet);
|
||||
foundPlayerToSend = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ namespace Game
|
||||
Log.outError(LogFilter.Network, "Received unexpected opcode {0} Status: {1} Reason: {2} from {3}", (ClientOpcodes)packet.GetOpcode(), status, reason, GetPlayerInfo());
|
||||
}
|
||||
|
||||
public void SendPacket(ServerPacket packet, bool writePacket = true)
|
||||
public void SendPacket(ServerPacket packet)
|
||||
{
|
||||
if (packet == null)
|
||||
return;
|
||||
@@ -397,7 +397,7 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
m_Socket[(int)conIdx].SendPacket(packet, writePacket);
|
||||
m_Socket[(int)conIdx].SendPacket(packet);
|
||||
}
|
||||
|
||||
public void AddInstanceConnection(WorldSocket sock) { m_Socket[(int)ConnectionType.Instance] = sock; }
|
||||
|
||||
Reference in New Issue
Block a user