mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
Working on compression, still needs work
This commit is contained in:
parent
95d4e95400
commit
f2be05f47f
@ -45,13 +45,13 @@ void EQStreamIdentifier::Process() {
|
|||||||
Record &r = *cur;
|
Record &r = *cur;
|
||||||
|
|
||||||
//first see if this stream has expired
|
//first see if this stream has expired
|
||||||
if(r.expire.Check(false)) {
|
//if(r.expire.Check(false)) {
|
||||||
//this stream has failed to match any pattern in our timeframe.
|
// //this stream has failed to match any pattern in our timeframe.
|
||||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()));
|
// Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()));
|
||||||
r.stream->ReleaseFromUse();
|
// r.stream->ReleaseFromUse();
|
||||||
cur = m_streams.erase(cur);
|
// cur = m_streams.erase(cur);
|
||||||
continue;
|
// continue;
|
||||||
}
|
//}
|
||||||
|
|
||||||
//then make sure the stream is still active
|
//then make sure the stream is still active
|
||||||
//if stream hasn't finished initializing then continue;
|
//if stream hasn't finished initializing then continue;
|
||||||
|
|||||||
@ -383,7 +383,9 @@ void EQ::Net::DaybreakConnection::ProcessPacket(Packet &p)
|
|||||||
for (int i = 0; i < 2; ++i) {
|
for (int i = 0; i < 2; ++i) {
|
||||||
switch (m_encode_passes[i]) {
|
switch (m_encode_passes[i]) {
|
||||||
case EncodeCompression:
|
case EncodeCompression:
|
||||||
|
Log.OutF(Logs::General, Logs::Debug, "Decompressing packet on pass {1}\n{0}", temp.ToString(), i);
|
||||||
Decompress(temp, DaybreakHeader::size(), temp.Length() - DaybreakHeader::size() - m_crc_bytes);
|
Decompress(temp, DaybreakHeader::size(), temp.Length() - DaybreakHeader::size() - m_crc_bytes);
|
||||||
|
Log.OutF(Logs::General, Logs::Debug, "Decompressed packet on pass {1}\n{0}", temp.ToString(), i);
|
||||||
break;
|
break;
|
||||||
case EncodeXOR:
|
case EncodeXOR:
|
||||||
Decode(temp, DaybreakHeader::size(), temp.Length() - DaybreakHeader::size() - m_crc_bytes);
|
Decode(temp, DaybreakHeader::size(), temp.Length() - DaybreakHeader::size() - m_crc_bytes);
|
||||||
@ -887,7 +889,7 @@ void EQ::Net::DaybreakConnection::Decompress(Packet &p, size_t offset, size_t le
|
|||||||
if (length < 2) {
|
if (length < 2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t new_buffer[4096];
|
static uint8_t new_buffer[4096];
|
||||||
uint8_t *buffer = (uint8_t*)p.Data() + offset;
|
uint8_t *buffer = (uint8_t*)p.Data() + offset;
|
||||||
uint32_t new_length = 0;
|
uint32_t new_length = 0;
|
||||||
@ -900,8 +902,7 @@ void EQ::Net::DaybreakConnection::Decompress(Packet &p, size_t offset, size_t le
|
|||||||
new_length = (uint32_t)length - 1;
|
new_length = (uint32_t)length - 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
memcpy(new_buffer, buffer, length);
|
return;
|
||||||
new_length = length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p.Resize(offset);
|
p.Resize(offset);
|
||||||
|
|||||||
@ -398,7 +398,7 @@ int main(int argc, char** argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQ::Net::EQStreamManagerOptions opts(true, false);
|
EQ::Net::EQStreamManagerOptions opts(false, true);
|
||||||
opts.daybreak_options.port = 9000;
|
opts.daybreak_options.port = 9000;
|
||||||
opts.opcode_size = 2;
|
opts.opcode_size = 2;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user