mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-04 00:02:24 +00:00
(SoF+) Removed duplicate packets being sent to client on zone (Take #2)!
This commit is contained in:
parent
9daf572ea7
commit
69d727cbe5
@ -413,6 +413,69 @@ Client::~Client() {
|
|||||||
UninitializeBuffSlots();
|
UninitializeBuffSlots();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Client::SendZoneInPackets()
|
||||||
|
{
|
||||||
|
//////////////////////////////////////////////////////
|
||||||
|
// Spawn Appearance Packet
|
||||||
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
||||||
|
SpawnAppearance_Struct* sa = (SpawnAppearance_Struct*)outapp->pBuffer;
|
||||||
|
sa->type = AT_SpawnID; // Is 0x10 used to set the player id?
|
||||||
|
sa->parameter = GetID(); // Four bytes for this parameter...
|
||||||
|
outapp->priority = 6;
|
||||||
|
QueuePacket(outapp);
|
||||||
|
safe_delete(outapp);
|
||||||
|
|
||||||
|
// Inform the world about the client
|
||||||
|
outapp = new EQApplicationPacket();
|
||||||
|
|
||||||
|
CreateSpawnPacket(outapp);
|
||||||
|
outapp->priority = 6;
|
||||||
|
if (!GetHideMe()) entity_list.QueueClients(this, outapp, true);
|
||||||
|
safe_delete(outapp);
|
||||||
|
if (GetPVP()) //force a PVP update until we fix the spawn struct
|
||||||
|
SendAppearancePacket(AT_PVP, GetPVP(), true, false);
|
||||||
|
|
||||||
|
//Send AA Exp packet:
|
||||||
|
if (GetLevel() >= 51)
|
||||||
|
SendAAStats();
|
||||||
|
|
||||||
|
// Send exp packets
|
||||||
|
outapp = new EQApplicationPacket(OP_ExpUpdate, sizeof(ExpUpdate_Struct));
|
||||||
|
ExpUpdate_Struct* eu = (ExpUpdate_Struct*)outapp->pBuffer;
|
||||||
|
uint32 tmpxp1 = GetEXPForLevel(GetLevel() + 1);
|
||||||
|
uint32 tmpxp2 = GetEXPForLevel(GetLevel());
|
||||||
|
|
||||||
|
// Crash bug fix... Divide by zero when tmpxp1 and 2 equalled each other, most likely the error case from GetEXPForLevel() (invalid class, etc)
|
||||||
|
if (tmpxp1 != tmpxp2 && tmpxp1 != 0xFFFFFFFF && tmpxp2 != 0xFFFFFFFF) {
|
||||||
|
float tmpxp = (float)((float)m_pp.exp - tmpxp2) / ((float)tmpxp1 - tmpxp2);
|
||||||
|
eu->exp = (uint32)(330.0f * tmpxp);
|
||||||
|
outapp->priority = 6;
|
||||||
|
QueuePacket(outapp);
|
||||||
|
}
|
||||||
|
safe_delete(outapp);
|
||||||
|
|
||||||
|
SendAATimers();
|
||||||
|
|
||||||
|
outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(ZoneInSendName_Struct));
|
||||||
|
ZoneInSendName_Struct* zonesendname = (ZoneInSendName_Struct*)outapp->pBuffer;
|
||||||
|
strcpy(zonesendname->name, m_pp.name);
|
||||||
|
strcpy(zonesendname->name2, m_pp.name);
|
||||||
|
zonesendname->unknown0 = 0x0A;
|
||||||
|
QueuePacket(outapp);
|
||||||
|
safe_delete(outapp);
|
||||||
|
|
||||||
|
if (IsInAGuild()) {
|
||||||
|
SendGuildMembers();
|
||||||
|
SendGuildURL();
|
||||||
|
SendGuildChannel();
|
||||||
|
SendGuildLFGuildStatus();
|
||||||
|
}
|
||||||
|
SendLFGuildStatus();
|
||||||
|
|
||||||
|
//No idea why live sends this if even were not in a guild
|
||||||
|
SendGuildMOTD();
|
||||||
|
}
|
||||||
|
|
||||||
void Client::SendLogoutPackets() {
|
void Client::SendLogoutPackets() {
|
||||||
|
|
||||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_CancelTrade, sizeof(CancelTrade_Struct));
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_CancelTrade, sizeof(CancelTrade_Struct));
|
||||||
|
|||||||
@ -1415,6 +1415,7 @@ private:
|
|||||||
|
|
||||||
bool CanBeInZone();
|
bool CanBeInZone();
|
||||||
void SendLogoutPackets();
|
void SendLogoutPackets();
|
||||||
|
void SendZoneInPackets();
|
||||||
bool AddPacket(const EQApplicationPacket *, bool);
|
bool AddPacket(const EQApplicationPacket *, bool);
|
||||||
bool AddPacket(EQApplicationPacket**, bool);
|
bool AddPacket(EQApplicationPacket**, bool);
|
||||||
bool SendAllPackets();
|
bool SendAllPackets();
|
||||||
|
|||||||
@ -1089,76 +1089,15 @@ void Client::Handle_Connect_OP_SendAATable(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
void Client::Handle_Connect_OP_SendExpZonein(const EQApplicationPacket *app)
|
void Client::Handle_Connect_OP_SendExpZonein(const EQApplicationPacket *app)
|
||||||
{
|
{
|
||||||
//////////////////////////////////////////////////////
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_SendExpZonein, 0);
|
||||||
// Spawn Appearance Packet
|
|
||||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
|
||||||
SpawnAppearance_Struct* sa = (SpawnAppearance_Struct*)outapp->pBuffer;
|
|
||||||
sa->type = AT_SpawnID; // Is 0x10 used to set the player id?
|
|
||||||
sa->parameter = GetID(); // Four bytes for this parameter...
|
|
||||||
outapp->priority = 6;
|
|
||||||
QueuePacket(outapp);
|
QueuePacket(outapp);
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
|
|
||||||
// Inform the world about the client
|
// SoF+ Gets Zone-In packets after sending OP_WorldObjectsSent
|
||||||
outapp = new EQApplicationPacket();
|
if (GetClientVersion() < ClientVersion::SoF)
|
||||||
|
{
|
||||||
CreateSpawnPacket(outapp);
|
SendZoneInPackets();
|
||||||
outapp->priority = 6;
|
|
||||||
if (!GetHideMe()) entity_list.QueueClients(this, outapp, true);
|
|
||||||
safe_delete(outapp);
|
|
||||||
if (GetPVP()) //force a PVP update until we fix the spawn struct
|
|
||||||
SendAppearancePacket(AT_PVP, GetPVP(), true, false);
|
|
||||||
|
|
||||||
//Send AA Exp packet:
|
|
||||||
if (GetLevel() >= 51)
|
|
||||||
SendAAStats();
|
|
||||||
|
|
||||||
// Send exp packets
|
|
||||||
outapp = new EQApplicationPacket(OP_ExpUpdate, sizeof(ExpUpdate_Struct));
|
|
||||||
ExpUpdate_Struct* eu = (ExpUpdate_Struct*)outapp->pBuffer;
|
|
||||||
uint32 tmpxp1 = GetEXPForLevel(GetLevel() + 1);
|
|
||||||
uint32 tmpxp2 = GetEXPForLevel(GetLevel());
|
|
||||||
|
|
||||||
// Crash bug fix... Divide by zero when tmpxp1 and 2 equalled each other, most likely the error case from GetEXPForLevel() (invalid class, etc)
|
|
||||||
if (tmpxp1 != tmpxp2 && tmpxp1 != 0xFFFFFFFF && tmpxp2 != 0xFFFFFFFF) {
|
|
||||||
float tmpxp = (float)((float)m_pp.exp - tmpxp2) / ((float)tmpxp1 - tmpxp2);
|
|
||||||
eu->exp = (uint32)(330.0f * tmpxp);
|
|
||||||
outapp->priority = 6;
|
|
||||||
QueuePacket(outapp);
|
|
||||||
}
|
}
|
||||||
safe_delete(outapp);
|
|
||||||
|
|
||||||
SendAATimers();
|
|
||||||
|
|
||||||
outapp = new EQApplicationPacket(OP_SendExpZonein, 0);
|
|
||||||
QueuePacket(outapp);
|
|
||||||
safe_delete(outapp);
|
|
||||||
|
|
||||||
outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(ZoneInSendName_Struct));
|
|
||||||
ZoneInSendName_Struct* zonesendname = (ZoneInSendName_Struct*)outapp->pBuffer;
|
|
||||||
strcpy(zonesendname->name, m_pp.name);
|
|
||||||
strcpy(zonesendname->name2, m_pp.name);
|
|
||||||
zonesendname->unknown0 = 0x0A;
|
|
||||||
QueuePacket(outapp);
|
|
||||||
safe_delete(outapp);
|
|
||||||
|
|
||||||
/* this is actually the guild MOTD
|
|
||||||
outapp = new EQApplicationPacket(OP_ZoneInSendName2, sizeof(ZoneInSendName_Struct2));
|
|
||||||
ZoneInSendName_Struct2* zonesendname2=(ZoneInSendName_Struct2*)outapp->pBuffer;
|
|
||||||
strcpy(zonesendname2->name,m_pp.name);
|
|
||||||
QueuePacket(outapp);
|
|
||||||
safe_delete(outapp);*/
|
|
||||||
|
|
||||||
if (IsInAGuild()) {
|
|
||||||
SendGuildMembers();
|
|
||||||
SendGuildURL();
|
|
||||||
SendGuildChannel();
|
|
||||||
SendGuildLFGuildStatus();
|
|
||||||
}
|
|
||||||
SendLFGuildStatus();
|
|
||||||
|
|
||||||
//No idea why live sends this if even were not in a guild
|
|
||||||
SendGuildMOTD();
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1216,72 +1155,13 @@ void Client::Handle_Connect_OP_WearChange(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
void Client::Handle_Connect_OP_WorldObjectsSent(const EQApplicationPacket *app)
|
void Client::Handle_Connect_OP_WorldObjectsSent(const EQApplicationPacket *app)
|
||||||
{
|
{
|
||||||
//This is a copy of SendExpZonein created for SoF+ due to packet order change
|
// New for SoF+
|
||||||
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_WorldObjectsSent, 0);
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
// Spawn Appearance Packet
|
|
||||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
|
||||||
SpawnAppearance_Struct* sa = (SpawnAppearance_Struct*)outapp->pBuffer;
|
|
||||||
sa->type = AT_SpawnID; // Is 0x10 used to set the player id?
|
|
||||||
sa->parameter = GetID(); // Four bytes for this parameter...
|
|
||||||
outapp->priority = 6;
|
|
||||||
QueuePacket(outapp);
|
QueuePacket(outapp);
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
|
|
||||||
// Inform the world about the client
|
// Packet order changed for SoF+, so below is sent here instead of OP_SendExpLogin
|
||||||
outapp = new EQApplicationPacket();
|
SendZoneInPackets();
|
||||||
|
|
||||||
CreateSpawnPacket(outapp);
|
|
||||||
outapp->priority = 6;
|
|
||||||
if (!GetHideMe()) entity_list.QueueClients(this, outapp, true);
|
|
||||||
safe_delete(outapp);
|
|
||||||
if (GetPVP()) //force a PVP update until we fix the spawn struct
|
|
||||||
SendAppearancePacket(AT_PVP, GetPVP(), true, false);
|
|
||||||
|
|
||||||
//Send AA Exp packet:
|
|
||||||
if (GetLevel() >= 51)
|
|
||||||
SendAAStats();
|
|
||||||
|
|
||||||
// Send exp packets
|
|
||||||
outapp = new EQApplicationPacket(OP_ExpUpdate, sizeof(ExpUpdate_Struct));
|
|
||||||
ExpUpdate_Struct* eu = (ExpUpdate_Struct*)outapp->pBuffer;
|
|
||||||
uint32 tmpxp1 = GetEXPForLevel(GetLevel() + 1);
|
|
||||||
uint32 tmpxp2 = GetEXPForLevel(GetLevel());
|
|
||||||
|
|
||||||
// Crash bug fix... Divide by zero when tmpxp1 and 2 equalled each other, most likely the error case from GetEXPForLevel() (invalid class, etc)
|
|
||||||
if (tmpxp1 != tmpxp2 && tmpxp1 != 0xFFFFFFFF && tmpxp2 != 0xFFFFFFFF) {
|
|
||||||
float tmpxp = (float)((float)m_pp.exp - tmpxp2) / ((float)tmpxp1 - tmpxp2);
|
|
||||||
eu->exp = (uint32)(330.0f * tmpxp);
|
|
||||||
outapp->priority = 6;
|
|
||||||
QueuePacket(outapp);
|
|
||||||
}
|
|
||||||
safe_delete(outapp);
|
|
||||||
|
|
||||||
SendAATimers();
|
|
||||||
|
|
||||||
// New for Secrets of Faydwer - Used in Place of OP_SendExpZonein
|
|
||||||
outapp = new EQApplicationPacket(OP_WorldObjectsSent, 0);
|
|
||||||
QueuePacket(outapp);
|
|
||||||
safe_delete(outapp);
|
|
||||||
|
|
||||||
outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(ZoneInSendName_Struct));
|
|
||||||
ZoneInSendName_Struct* zonesendname = (ZoneInSendName_Struct*)outapp->pBuffer;
|
|
||||||
strcpy(zonesendname->name, m_pp.name);
|
|
||||||
strcpy(zonesendname->name2, m_pp.name);
|
|
||||||
zonesendname->unknown0 = 0x0A;
|
|
||||||
QueuePacket(outapp);
|
|
||||||
safe_delete(outapp);
|
|
||||||
|
|
||||||
if (IsInAGuild()) {
|
|
||||||
SendGuildMembers();
|
|
||||||
SendGuildURL();
|
|
||||||
SendGuildChannel();
|
|
||||||
SendGuildLFGuildStatus();
|
|
||||||
}
|
|
||||||
SendLFGuildStatus();
|
|
||||||
|
|
||||||
//No idea why live sends this if even were not in a guild
|
|
||||||
SendGuildMOTD();
|
|
||||||
|
|
||||||
if (RuleB(Mercs, AllowMercs))
|
if (RuleB(Mercs, AllowMercs))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user