mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-22 09:42:26 +00:00
Fix for character select screen client crashes (fix #418)
This commit is contained in:
parent
76d7fe1586
commit
92c756c820
@ -1,5 +1,7 @@
|
|||||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
== 05/26/2015 ==
|
||||||
|
Uleat: Fix for packet size adjustment after initial declaration (issue #418) - should clear up some random client crashes and the inability to progress to charsel screen on affected accounts
|
||||||
|
|
||||||
== 05/25/2015 ==
|
== 05/25/2015 ==
|
||||||
Akkadius: Implemented disjointed zone based time, this can be triggered via quest methods
|
Akkadius: Implemented disjointed zone based time, this can be triggered via quest methods
|
||||||
|
|||||||
@ -571,12 +571,25 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// The (p->size++) and (length--) modification code inside of the (opcode & 0x00FF == 0) checks are a temporary solution
|
||||||
|
// to a discongruency in packet size due to an alteration of packet size after the initial declaration. This led to client
|
||||||
|
// crashes where the original packet size + protocol bytes mod MaxLen() produced a 0 result.
|
||||||
|
//
|
||||||
|
// These changes are local-only and there may be other calling methods affected by the EQ##Packet::serialize() issue.
|
||||||
|
if ((opcode & 0x00FF) == 0) { // this is final..but, had scope issues during early testing at this point
|
||||||
|
Log.Out(Logs::Detail, Logs::Netcode, _L "Adjusting application packet length for high byte opcode 0x%04X (%d to %d)" __L, opcode, p->size++, p->size);
|
||||||
|
}
|
||||||
|
|
||||||
// Convert the EQApplicationPacket to 1 or more EQProtocolPackets
|
// Convert the EQApplicationPacket to 1 or more EQProtocolPackets
|
||||||
if (p->size>(MaxLen-8)) { // proto-op(2), seq(2), app-op(2) ... data ... crc(2)
|
if (p->size>(MaxLen-8)) { // proto-op(2), seq(2), app-op(2) ... data ... crc(2)
|
||||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Making oversized packet, len %d" __L, p->size);
|
Log.Out(Logs::Detail, Logs::Netcode, _L "Making oversized packet, len %d" __L, p->size);
|
||||||
|
|
||||||
unsigned char *tmpbuff=new unsigned char[p->size+3];
|
unsigned char *tmpbuff=new unsigned char[p->size+3];
|
||||||
length=p->serialize(opcode, tmpbuff);
|
length=p->serialize(opcode, tmpbuff);
|
||||||
|
if ((opcode & 0x00FF) == 0) { // temp solution until all serialize() calls can be evaluated
|
||||||
|
Log.Out(Logs::Detail, Logs::Netcode, _L "Adjusting protocol packet length for high byte opcode 0x%04X (%d to %d)" __L, opcode, length--, length);
|
||||||
|
}
|
||||||
|
|
||||||
EQProtocolPacket *out=new EQProtocolPacket(OP_Fragment,nullptr,MaxLen-4);
|
EQProtocolPacket *out=new EQProtocolPacket(OP_Fragment,nullptr,MaxLen-4);
|
||||||
*(uint32 *)(out->pBuffer+2)=htonl(p->Size());
|
*(uint32 *)(out->pBuffer+2)=htonl(p->Size());
|
||||||
@ -601,6 +614,9 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
|
|||||||
|
|
||||||
unsigned char *tmpbuff=new unsigned char[p->Size()+3];
|
unsigned char *tmpbuff=new unsigned char[p->Size()+3];
|
||||||
length=p->serialize(opcode, tmpbuff+2) + 2;
|
length=p->serialize(opcode, tmpbuff+2) + 2;
|
||||||
|
if ((opcode & 0x00FF) == 0) { // temp solution until all serialize() calls can be evaluated
|
||||||
|
Log.Out(Logs::Detail, Logs::Netcode, _L "Adjusting protocol packet length for high byte opcode 0x%04X (%d to %d)" __L, opcode, length--, length);
|
||||||
|
}
|
||||||
|
|
||||||
EQProtocolPacket *out=new EQProtocolPacket(OP_Packet,tmpbuff,length);
|
EQProtocolPacket *out=new EQProtocolPacket(OP_Packet,tmpbuff,length);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user