mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-07 14:33:52 +00:00
Change clientpackets to std::deque from LinkedList
This should be better performance, but I couldn't really push local testing to hit the performance issues ...
This commit is contained in:
parent
757c7f5b00
commit
34549a4bdb
@ -697,12 +697,13 @@ bool Client::AddPacket(const EQApplicationPacket *pApp, bool bAckreq) {
|
||||
//drop the packet because it will never get sent.
|
||||
return(false);
|
||||
}
|
||||
auto c = new CLIENTPACKET;
|
||||
|
||||
auto c = std::unique_ptr<CLIENTPACKET>(new CLIENTPACKET);
|
||||
|
||||
c->ack_req = bAckreq;
|
||||
c->app = pApp->Copy();
|
||||
|
||||
clientpackets.Append(c);
|
||||
clientpackets.push_back(std::move(c));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -714,26 +715,23 @@ bool Client::AddPacket(EQApplicationPacket** pApp, bool bAckreq) {
|
||||
//drop the packet because it will never get sent.
|
||||
return(false);
|
||||
}
|
||||
auto c = new CLIENTPACKET;
|
||||
auto c = std::unique_ptr<CLIENTPACKET>(new CLIENTPACKET);
|
||||
|
||||
c->ack_req = bAckreq;
|
||||
c->app = *pApp;
|
||||
*pApp = nullptr;
|
||||
|
||||
clientpackets.Append(c);
|
||||
clientpackets.push_back(std::move(c));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Client::SendAllPackets() {
|
||||
LinkedListIterator<CLIENTPACKET*> iterator(clientpackets);
|
||||
|
||||
CLIENTPACKET* cp = nullptr;
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
cp = iterator.GetData();
|
||||
while (!clientpackets.empty()) {
|
||||
cp = clientpackets.front().get();
|
||||
if(eqs)
|
||||
eqs->FastQueuePacket((EQApplicationPacket **)&cp->app, cp->ack_req);
|
||||
iterator.RemoveCurrent();
|
||||
clientpackets.pop_front();
|
||||
Log(Logs::Moderate, Logs::Client_Server_Packet, "Transmitting a packet");
|
||||
}
|
||||
return true;
|
||||
|
||||
@ -70,6 +70,7 @@ namespace EQEmu
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <deque>
|
||||
|
||||
|
||||
#define CLIENT_TIMEOUT 90000
|
||||
@ -1424,7 +1425,7 @@ private:
|
||||
bool AddPacket(const EQApplicationPacket *, bool);
|
||||
bool AddPacket(EQApplicationPacket**, bool);
|
||||
bool SendAllPackets();
|
||||
LinkedList<CLIENTPACKET *> clientpackets;
|
||||
std::deque<std::unique_ptr<CLIENTPACKET>> clientpackets;
|
||||
|
||||
//Zoning related stuff
|
||||
void SendZoneCancel(ZoneChange_Struct *zc);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user