fixed some crashes (with vc80)
This commit is contained in:
parent
7aaac21eca
commit
10e6b70c4d
@ -30,7 +30,7 @@ class ByteBuffer
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
const static size_t DEFAULT_SIZE = 0x1000;
|
const static size_t DEFAULT_SIZE = 0xFF;
|
||||||
|
|
||||||
ByteBuffer(): _rpos(0), _wpos(0)
|
ByteBuffer(): _rpos(0), _wpos(0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -126,7 +126,7 @@ void RealmSocket::_HandleRealmList(void)
|
|||||||
{
|
{
|
||||||
std::string realmAddr;
|
std::string realmAddr;
|
||||||
ByteBuffer realmbuf;
|
ByteBuffer realmbuf;
|
||||||
realmbuf.reserve(ibuf.GetLength());
|
realmbuf.resize(ibuf.GetLength());
|
||||||
ibuf.Read((char*)realmbuf.contents(), ibuf.GetLength());
|
ibuf.Read((char*)realmbuf.contents(), ibuf.GetLength());
|
||||||
|
|
||||||
uint32 unk;
|
uint32 unk;
|
||||||
|
|||||||
@ -36,7 +36,7 @@ void WorldSocket::OnRead()
|
|||||||
{
|
{
|
||||||
TcpSocket::OnRead();
|
TcpSocket::OnRead();
|
||||||
uint32 len = ibuf.GetLength();
|
uint32 len = ibuf.GetLength();
|
||||||
//printf("WorldSocket::OnRead() %u bytes\n",len);
|
printf("WorldSocket::OnRead() %u bytes\n",len);
|
||||||
if(!len)
|
if(!len)
|
||||||
{
|
{
|
||||||
this->CloseAndDelete();
|
this->CloseAndDelete();
|
||||||
@ -116,7 +116,7 @@ void WorldSocket::SendWorldPacket(WorldPacket &pkt)
|
|||||||
_crypt.EncryptSend((uint8*)&hdr, 6);
|
_crypt.EncryptSend((uint8*)&hdr, 6);
|
||||||
ByteBuffer final(pkt.size()+6);
|
ByteBuffer final(pkt.size()+6);
|
||||||
final.append((uint8*)&hdr,sizeof(ClientPktHeader));
|
final.append((uint8*)&hdr,sizeof(ClientPktHeader));
|
||||||
final.append(pkt.contents(),pkt.size());
|
final.append(pkt);
|
||||||
SendBuf((char*)final.contents(),final.size());
|
SendBuf((char*)final.contents(),final.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user