Well, I tried to debug what mangos got from wotlk client and found, that client send:
uint32 addonSize // uncompressed size in bytes
compressed data:
uint32 addonCount
array:
String addonName + "\0"
uint8 flags
uint32 modulus crc
uint32 urlcrc crc
also there uint32 at the end of compressed data, seems like timestamp.
I tried all levels of zlib compress to send addonInfo like wotlk client sent, but seems like smth wrong,
because before I was getting error with -5 code from the code below, now I got -3 error code:
Code:
if (uncompress(const_cast<Bytef*>(clientAddonData.contents()), &addonSize,
reinterpret_cast<const Bytef *>(authSession->contents() + authSession->rpos()),
static_cast<uLongf>(authSession->size() - authSession->rpos())) != Z_OK)
{
sLog.outBasic("ADDON: Addon information failed to compress. Account %s (id %u) IP %s",
_session->GetAccountName().c_str(), _session->GetAccountId(), _session->GetRemoteAddress().c_str());
return false;
}
Does anybode know how to send addon info correctly ?