mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-28 00:57:15 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -141,7 +141,7 @@ void EQ::Net::DaybreakConnectionManager::Process()
|
|||||||
connection->SendConnect();
|
connection->SendConnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case StatusConnected: {
|
case StatusConnected: {
|
||||||
if (m_options.keepalive_delay_ms != 0) {
|
if (m_options.keepalive_delay_ms != 0) {
|
||||||
auto time_since_last_send = std::chrono::duration_cast<std::chrono::milliseconds>(now - connection->m_last_send);
|
auto time_since_last_send = std::chrono::duration_cast<std::chrono::milliseconds>(now - connection->m_last_send);
|
||||||
@@ -463,7 +463,7 @@ void EQ::Net::DaybreakConnection::ProcessOutboundQueue()
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
auto stream = &m_streams[i];
|
auto stream = &m_streams[i];
|
||||||
|
|
||||||
if (stream->outstanding_bytes == 0) {
|
if (stream->outstanding_bytes == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -471,14 +471,14 @@ void EQ::Net::DaybreakConnection::ProcessOutboundQueue()
|
|||||||
while (!stream->buffered_packets.empty()) {
|
while (!stream->buffered_packets.empty()) {
|
||||||
auto &buff = stream->buffered_packets.front();
|
auto &buff = stream->buffered_packets.front();
|
||||||
|
|
||||||
if (stream->outstanding_bytes + buff.sent.packet.Length() >= m_owner->m_options.max_outstanding_bytes ||
|
if (stream->outstanding_bytes + buff.sent.packet.Length() >= m_owner->m_options.max_outstanding_bytes ||
|
||||||
stream->outstanding_packets.size() + 1 >= m_owner->m_options.max_outstanding_packets) {
|
stream->outstanding_packets.size() + 1 >= m_owner->m_options.max_outstanding_packets) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream->outstanding_bytes += buff.sent.packet.Length();
|
stream->outstanding_bytes += buff.sent.packet.Length();
|
||||||
stream->outstanding_packets.insert(std::make_pair(buff.seq, buff.sent));
|
stream->outstanding_packets.insert(std::make_pair(buff.seq, buff.sent));
|
||||||
InternalSend(buff.sent.packet);
|
InternalBufferedSend(buff.sent.packet);
|
||||||
stream->buffered_packets.pop_front();
|
stream->buffered_packets.pop_front();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1080,7 +1080,7 @@ void EQ::Net::DaybreakConnection::Ack(int stream, uint16_t seq)
|
|||||||
while (iter != s->outstanding_packets.end()) {
|
while (iter != s->outstanding_packets.end()) {
|
||||||
auto order = CompareSequence(seq, iter->first);
|
auto order = CompareSequence(seq, iter->first);
|
||||||
|
|
||||||
if (order != SequenceFuture) {
|
if (order != SequenceFuture) {
|
||||||
uint64_t round_time = (uint64_t)std::chrono::duration_cast<std::chrono::milliseconds>(now - iter->second.last_sent).count();
|
uint64_t round_time = (uint64_t)std::chrono::duration_cast<std::chrono::milliseconds>(now - iter->second.last_sent).count();
|
||||||
|
|
||||||
m_stats.max_ping = std::max(m_stats.max_ping, round_time);
|
m_stats.max_ping = std::max(m_stats.max_ping, round_time);
|
||||||
@@ -1133,7 +1133,7 @@ void EQ::Net::DaybreakConnection::BufferPacket(int stream, uint16_t seq, Daybrea
|
|||||||
|
|
||||||
s->outstanding_bytes += sent.packet.Length();
|
s->outstanding_bytes += sent.packet.Length();
|
||||||
s->outstanding_packets.insert(std::make_pair(seq, sent));
|
s->outstanding_packets.insert(std::make_pair(seq, sent));
|
||||||
InternalSend(sent.packet);
|
InternalBufferedSend(sent.packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQ::Net::DaybreakConnection::SendAck(int stream_id, uint16_t seq)
|
void EQ::Net::DaybreakConnection::SendAck(int stream_id, uint16_t seq)
|
||||||
@@ -1187,6 +1187,10 @@ void EQ::Net::DaybreakConnection::InternalBufferedSend(Packet &p)
|
|||||||
FlushBuffer();
|
FlushBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_buffered_packets.size() == 0) {
|
||||||
|
m_hold_time = Clock::now();
|
||||||
|
}
|
||||||
|
|
||||||
DynamicPacket copy;
|
DynamicPacket copy;
|
||||||
copy.PutPacket(0, p);
|
copy.PutPacket(0, p);
|
||||||
m_buffered_packets.push_back(copy);
|
m_buffered_packets.push_back(copy);
|
||||||
|
|||||||
@@ -219,8 +219,8 @@ namespace EQ
|
|||||||
keepalive_delay_ms = 9000;
|
keepalive_delay_ms = 9000;
|
||||||
resend_delay_ms = 150;
|
resend_delay_ms = 150;
|
||||||
resend_delay_factor = 1.5;
|
resend_delay_factor = 1.5;
|
||||||
resend_delay_min = 150;
|
resend_delay_min = 300;
|
||||||
resend_delay_max = 1000;
|
resend_delay_max = 3000;
|
||||||
connect_delay_ms = 500;
|
connect_delay_ms = 500;
|
||||||
stale_connection_ms = 90000;
|
stale_connection_ms = 90000;
|
||||||
connect_stale_ms = 5000;
|
connect_stale_ms = 5000;
|
||||||
@@ -230,14 +230,14 @@ namespace EQ
|
|||||||
encode_passes[1] = DaybreakEncodeType::EncodeNone;
|
encode_passes[1] = DaybreakEncodeType::EncodeNone;
|
||||||
port = 0;
|
port = 0;
|
||||||
hold_size = 448;
|
hold_size = 448;
|
||||||
hold_length_ms = 10;
|
hold_length_ms = 50;
|
||||||
simulated_in_packet_loss = 0;
|
simulated_in_packet_loss = 0;
|
||||||
simulated_out_packet_loss = 0;
|
simulated_out_packet_loss = 0;
|
||||||
tic_rate_hertz = 60.0;
|
tic_rate_hertz = 60.0;
|
||||||
resend_timeout = 90000;
|
resend_timeout = 90000;
|
||||||
connection_close_time = 2000;
|
connection_close_time = 2000;
|
||||||
max_outstanding_packets = 300;
|
max_outstanding_packets = 400;
|
||||||
max_outstanding_bytes = 200 * 512;
|
max_outstanding_bytes = 400 * 512;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t max_packet_size;
|
size_t max_packet_size;
|
||||||
@@ -298,4 +298,4 @@ namespace EQ
|
|||||||
friend class DaybreakConnection;
|
friend class DaybreakConnection;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1003,6 +1003,10 @@ void Mob::AI_Process() {
|
|||||||
if (DistanceNoZ(this->GetPosition(), this->GetTarget()->GetPosition()) > 50) {
|
if (DistanceNoZ(this->GetPosition(), this->GetTarget()->GetPosition()) > 50) {
|
||||||
this->FixZ();
|
this->FixZ();
|
||||||
}
|
}
|
||||||
|
/* If we are close to client and our Z differences aren't big, match the client */
|
||||||
|
else if (std::abs(this->GetZ() - this->GetTarget()->GetZ()) <= 5 && this->GetTarget()->IsClient()) {
|
||||||
|
this->m_Position.z = this->GetTarget()->GetZ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(m_PlayerState & static_cast<uint32>(PlayerState::Aggressive)))
|
if (!(m_PlayerState & static_cast<uint32>(PlayerState::Aggressive)))
|
||||||
|
|||||||
Reference in New Issue
Block a user