mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-09 22:32:24 +00:00
Post-inc to pre-inc
This commit is contained in:
parent
16a6fc7d2c
commit
bb8a82030f
@ -242,7 +242,7 @@ void EQStreamFactory::CheckTimeout()
|
|||||||
//everybody is done, we can delete it now
|
//everybody is done, we can delete it now
|
||||||
//std::cout << "Removing connection" << std::endl;
|
//std::cout << "Removing connection" << std::endl;
|
||||||
std::map<std::pair<uint32, uint16>,EQStream *>::iterator temp=stream_itr;
|
std::map<std::pair<uint32, uint16>,EQStream *>::iterator temp=stream_itr;
|
||||||
stream_itr++;
|
++stream_itr;
|
||||||
//let whoever has the stream outside delete it
|
//let whoever has the stream outside delete it
|
||||||
delete temp->second;
|
delete temp->second;
|
||||||
Streams.erase(temp);
|
Streams.erase(temp);
|
||||||
@ -250,7 +250,7 @@ void EQStreamFactory::CheckTimeout()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stream_itr++;
|
++stream_itr;
|
||||||
}
|
}
|
||||||
MStreams.unlock();
|
MStreams.unlock();
|
||||||
}
|
}
|
||||||
@ -285,7 +285,7 @@ Timer DecayTimer(20);
|
|||||||
//copy streams into a seperate list so we dont have to keep
|
//copy streams into a seperate list so we dont have to keep
|
||||||
//MStreams locked while we are writting
|
//MStreams locked while we are writting
|
||||||
MStreams.lock();
|
MStreams.lock();
|
||||||
for(stream_itr=Streams.begin();stream_itr!=Streams.end();stream_itr++) {
|
for(stream_itr=Streams.begin();stream_itr!=Streams.end();++stream_itr) {
|
||||||
// If it's time to decay the bytes sent, then let's do it before we try to write
|
// If it's time to decay the bytes sent, then let's do it before we try to write
|
||||||
if (decay)
|
if (decay)
|
||||||
stream_itr->second->Decay();
|
stream_itr->second->Decay();
|
||||||
@ -307,7 +307,7 @@ Timer DecayTimer(20);
|
|||||||
//do the actual writes
|
//do the actual writes
|
||||||
cur = wants_write.begin();
|
cur = wants_write.begin();
|
||||||
end = wants_write.end();
|
end = wants_write.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
(*cur)->Write(sock);
|
(*cur)->Write(sock);
|
||||||
(*cur)->ReleaseFromUse();
|
(*cur)->ReleaseFromUse();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@ EQStreamIdentifier::~EQStreamIdentifier() {
|
|||||||
std::vector<Record *>::iterator cur, end;
|
std::vector<Record *>::iterator cur, end;
|
||||||
cur = m_streams.begin();
|
cur = m_streams.begin();
|
||||||
end = m_streams.end();
|
end = m_streams.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
Record *r = *cur;
|
Record *r = *cur;
|
||||||
r->stream->ReleaseFromUse();
|
r->stream->ReleaseFromUse();
|
||||||
delete r;
|
delete r;
|
||||||
@ -19,7 +19,7 @@ EQStreamIdentifier::~EQStreamIdentifier() {
|
|||||||
std::vector<Patch *>::iterator curp, endp;
|
std::vector<Patch *>::iterator curp, endp;
|
||||||
curp = m_patches.begin();
|
curp = m_patches.begin();
|
||||||
endp = m_patches.end();
|
endp = m_patches.end();
|
||||||
for(; curp != endp; curp++) {
|
for(; curp != endp; ++curp) {
|
||||||
delete *curp;
|
delete *curp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -56,7 +56,7 @@ void EQStreamIdentifier::Process() {
|
|||||||
//if stream hasn't finished initializing then continue;
|
//if stream hasn't finished initializing then continue;
|
||||||
if(r->stream->GetState() == UNESTABLISHED)
|
if(r->stream->GetState() == UNESTABLISHED)
|
||||||
{
|
{
|
||||||
cur++;
|
++cur;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(r->stream->GetState() != ESTABLISHED) {
|
if(r->stream->GetState() != ESTABLISHED) {
|
||||||
@ -94,7 +94,7 @@ void EQStreamIdentifier::Process() {
|
|||||||
//foreach possbile patch...
|
//foreach possbile patch...
|
||||||
curp = m_patches.begin();
|
curp = m_patches.begin();
|
||||||
endp = m_patches.end();
|
endp = m_patches.end();
|
||||||
for(; !found_one && curp != endp; curp++) {
|
for(; !found_one && curp != endp; ++curp) {
|
||||||
Patch *p = *curp;
|
Patch *p = *curp;
|
||||||
|
|
||||||
//ask the stream to see if it matches the supplied signature
|
//ask the stream to see if it matches the supplied signature
|
||||||
@ -137,7 +137,7 @@ void EQStreamIdentifier::Process() {
|
|||||||
delete r;
|
delete r;
|
||||||
cur = m_streams.erase(cur);
|
cur = m_streams.erase(cur);
|
||||||
} else {
|
} else {
|
||||||
cur++;
|
++cur;
|
||||||
}
|
}
|
||||||
} //end foreach stream
|
} //end foreach stream
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,7 +138,7 @@ public:
|
|||||||
iterator cur, end;
|
iterator cur, end;
|
||||||
cur = streams.begin();
|
cur = streams.begin();
|
||||||
end = streams.end();
|
end = streams.end();
|
||||||
for(; cur != end; cur++) {
|
for(; cur != end; ++cur) {
|
||||||
if(cur->second == it) {
|
if(cur->second == it) {
|
||||||
streams.erase(cur);
|
streams.erase(cur);
|
||||||
//lazy recursive delete for now, since we have to redo
|
//lazy recursive delete for now, since we have to redo
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user