Merge of a monster

This commit is contained in:
KimLS
2017-04-02 20:03:51 -07:00
146 changed files with 10532 additions and 7432 deletions
+11 -10
View File
@@ -46,8 +46,9 @@ void EQStreamIdentifier::Process() {
//first see if this stream has expired
if(r.expire.Check(false)) {
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", r.stream->GetRemoteAddr().c_str(), ntohs(r.stream->GetRemotePort()));
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", r.stream->GetRemoteAddr().c_str(), ntohs(r.stream->GetRemotePort()));
r.stream->Close();
cur = m_streams.erase(cur);
continue;
}
@@ -61,23 +62,23 @@ void EQStreamIdentifier::Process() {
}
if(r.stream->GetState() != ESTABLISHED) {
//the stream closed before it was identified.
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()));
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()));
switch(r.stream->GetState())
{
case ESTABLISHED:
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Established");
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Established");
break;
case CLOSING:
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Closing");
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Closing");
break;
case DISCONNECTING:
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Disconnecting");
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Disconnecting");
break;
case CLOSED:
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Closed");
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Closed");
break;
default:
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown");
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown");
break;
}
r.stream->ReleaseFromUse();
@@ -107,7 +108,7 @@ void EQStreamIdentifier::Process() {
case EQStreamInterface::MatchSuccessful: {
//yay, a match.
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()), p->name.c_str());
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()), p->name.c_str());
// before we assign the eqstream to an interface, let the stream recognize it is in use and the session should not be reset any further
r.stream->SetActive(true);
@@ -121,7 +122,7 @@ void EQStreamIdentifier::Process() {
}
case EQStreamInterface::MatchFailed:
//do nothing...
Log.Out(Logs::General, Logs::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()), p->name.c_str());
Log(Logs::General, Logs::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()), p->name.c_str());
break;
}
}
@@ -129,7 +130,7 @@ void EQStreamIdentifier::Process() {
//if we checked all patches and did not find a match.
if(all_ready && !found_one) {
//the stream cannot be identified.
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()));
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()));
r.stream->ReleaseFromUse();
}