mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 03:31:08 +00:00
High level debug (12) compile failure fix - I searched for as many as I could find with GrepWin, so there may be a few out there still
This commit is contained in:
+1
-1
@@ -343,7 +343,7 @@ bool valid=false;
|
||||
uint16 packet_crc=ntohs(*(const uint16 *)(buffer+length-2));
|
||||
#ifdef EQN_DEBUG
|
||||
if (packet_crc && comp_crc != packet_crc) {
|
||||
cout << "CRC mismatch: comp=" << hex << comp_crc << ", packet=" << packet_crc << dec << endl;
|
||||
std::cout << "CRC mismatch: comp=" << std::hex << comp_crc << ", packet=" << packet_crc << std::dec << std::endl;
|
||||
}
|
||||
#endif
|
||||
valid = (!packet_crc || comp_crc == packet_crc);
|
||||
|
||||
+6
-6
@@ -326,7 +326,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
//cout << "Got OP_SessionRequest" << endl;
|
||||
//std::cout << "Got OP_SessionRequest" << std::endl;
|
||||
init();
|
||||
OutboundQueueClear();
|
||||
SessionRequest *Request=(SessionRequest *)p->pBuffer;
|
||||
@@ -654,7 +654,7 @@ void EQStream::Write(int eq_fd)
|
||||
int32 threshold=RateThreshold;
|
||||
MRate.unlock();
|
||||
if (BytesWritten > threshold) {
|
||||
//cout << "Over threshold: " << BytesWritten << " > " << threshold << endl;
|
||||
//std::cout << "Over threshold: " << BytesWritten << " > " << threshold << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -848,15 +848,15 @@ sockaddr_in address;
|
||||
address.sin_port=remote_port;
|
||||
#ifdef NOWAY
|
||||
uint32 ip=address.sin_addr.s_addr;
|
||||
cout << "Sending to: "
|
||||
std::cout << "Sending to: "
|
||||
<< (int)*(unsigned char *)&ip
|
||||
<< "." << (int)*((unsigned char *)&ip+1)
|
||||
<< "." << (int)*((unsigned char *)&ip+2)
|
||||
<< "." << (int)*((unsigned char *)&ip+3)
|
||||
<< "," << (int)ntohs(address.sin_port) << "(" << p->size << ")" << endl;
|
||||
<< "," << (int)ntohs(address.sin_port) << "(" << p->size << ")" << std::endl;
|
||||
|
||||
p->DumpRaw();
|
||||
cout << "-------------" << endl;
|
||||
std::cout << "-------------" << std::endl;
|
||||
#endif
|
||||
length=p->serialize(buffer);
|
||||
if (p->opcode!=OP_SessionRequest && p->opcode!=OP_SessionResponse) {
|
||||
@@ -907,7 +907,7 @@ char temp[15];
|
||||
*((unsigned char *)&ip+2),
|
||||
*((unsigned char *)&ip+3),
|
||||
ntohs(from->sin_port));
|
||||
//cout << timestamp() << "Data from: " << temp << " OpCode 0x" << hex << setw(2) << setfill('0') << (int)p->opcode << dec << endl;
|
||||
//std::cout << timestamp() << "Data from: " << temp << " OpCode 0x" << std::hex << std::setw(2) << std::setfill('0') << (int)p->opcode << std::dec << std::endl;
|
||||
//dump_message(p->pBuffer,p->size,timestamp());
|
||||
|
||||
}
|
||||
|
||||
@@ -104,8 +104,8 @@ struct sockaddr_in address;
|
||||
fcntl(sock, F_SETFL, O_NONBLOCK);
|
||||
#endif
|
||||
//moved these because on windows the output was delayed and causing the console window to look bad
|
||||
//cout << "Starting factory Reader" << endl;
|
||||
//cout << "Starting factory Writer" << endl;
|
||||
//std::cout << "Starting factory Reader" << std::endl;
|
||||
//std::cout << "Starting factory Writer" << std::endl;
|
||||
#ifdef _WINDOWS
|
||||
_beginthread(EQStreamFactoryReaderLoop,0, this);
|
||||
_beginthread(EQStreamFactoryWriterLoop,0, this);
|
||||
@@ -119,7 +119,7 @@ struct sockaddr_in address;
|
||||
EQStream *EQStreamFactory::Pop()
|
||||
{
|
||||
EQStream *s=nullptr;
|
||||
//cout << "Pop():Locking MNewStreams" << endl;
|
||||
//std::cout << "Pop():Locking MNewStreams" << std::endl;
|
||||
MNewStreams.lock();
|
||||
if (NewStreams.size()) {
|
||||
s=NewStreams.front();
|
||||
@@ -127,18 +127,18 @@ EQStream *s=nullptr;
|
||||
s->PutInUse();
|
||||
}
|
||||
MNewStreams.unlock();
|
||||
//cout << "Pop(): Unlocking MNewStreams" << endl;
|
||||
//std::cout << "Pop(): Unlocking MNewStreams" << std::endl;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
void EQStreamFactory::Push(EQStream *s)
|
||||
{
|
||||
//cout << "Push():Locking MNewStreams" << endl;
|
||||
//std::cout << "Push():Locking MNewStreams" << std::endl;
|
||||
MNewStreams.lock();
|
||||
NewStreams.push(s);
|
||||
MNewStreams.unlock();
|
||||
//cout << "Push(): Unlocking MNewStreams" << endl;
|
||||
//std::cout << "Push(): Unlocking MNewStreams" << std::endl;
|
||||
}
|
||||
|
||||
void EQStreamFactory::ReaderLoop()
|
||||
@@ -240,7 +240,7 @@ void EQStreamFactory::CheckTimeout()
|
||||
//give it a little time for everybody to finish with it
|
||||
} else {
|
||||
//everybody is done, we can delete it now
|
||||
//cout << "Removing connection" << endl;
|
||||
//std::cout << "Removing connection" << std::endl;
|
||||
std::map<std::string,EQStream *>::iterator temp=stream_itr;
|
||||
stream_itr++;
|
||||
//let whoever has the stream outside delete it
|
||||
@@ -318,9 +318,9 @@ Timer DecayTimer(20);
|
||||
stream_count=Streams.size();
|
||||
MStreams.unlock();
|
||||
if (!stream_count) {
|
||||
//cout << "No streams, waiting on condition" << endl;
|
||||
//std::cout << "No streams, waiting on condition" << std::endl;
|
||||
WriterWork.Wait();
|
||||
//cout << "Awake from condition, must have a stream now" << endl;
|
||||
//std::cout << "Awake from condition, must have a stream now" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ bool EmuTCPConnection::SendPacket(ServerPacket* pack, uint32 iDestination) {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetrIP();
|
||||
CoutTimestamp(true);
|
||||
std::cout << ": Logging outgoing TCP OldPacket. OPCode: 0x" << hex << setw(4) << setfill('0') << pack->opcode << dec << ", size: " << setw(5) << setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
std::cout << ": Logging outgoing TCP OldPacket. OPCode: 0x" << std::hex << std::setw(4) << std::setfill('0') << pack->opcode << std::dec << ", size: " << std::setw(5) << std::setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
#if TCPN_LOG_PACKETS == 2
|
||||
if (pack->size >= 32)
|
||||
DumpPacket(pack->pBuffer, 32);
|
||||
@@ -198,7 +198,7 @@ bool EmuTCPConnection::SendPacket(ServerPacket* pack, uint32 iDestination) {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetrIP();
|
||||
CoutTimestamp(true);
|
||||
std::cout << ": Logging outgoing TCP packet. OPCode: 0x" << hex << setw(4) << setfill('0') << pack->opcode << dec << ", size: " << setw(5) << setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
std::cout << ": Logging outgoing TCP packet. OPCode: 0x" << std::hex << std::setw(4) << std::setfill('0') << pack->opcode << std::dec << ", size: " << std::setw(5) << std::setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
#if TCPN_LOG_PACKETS == 2
|
||||
if (pack->size >= 32)
|
||||
DumpPacket(pack->pBuffer, 32);
|
||||
@@ -237,7 +237,7 @@ bool EmuTCPConnection::SendPacket(EmuTCPNetPacket_Struct* tnps) {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetrIP();
|
||||
CoutTimestamp(true);
|
||||
std::cout << ": Logging outgoing TCP NetPacket. OPCode: 0x" << hex << setw(4) << setfill('0') << tnps->opcode << dec << ", size: " << setw(5) << setfill(' ') << tnps->size << " " << inet_ntoa(in) << ":" << GetrPort();
|
||||
std::cout << ": Logging outgoing TCP NetPacket. OPCode: 0x" << std::hex << std::setw(4) << std::setfill('0') << tnps->opcode << std::dec << ", size: " << std::setw(5) << std::setfill(' ') << tnps->size << " " << inet_ntoa(in) << ":" << GetrPort();
|
||||
if (pOldFormat)
|
||||
std::cout << " (OldFormat)";
|
||||
std::cout << std::endl;
|
||||
@@ -578,7 +578,7 @@ bool EmuTCPConnection::ProcessReceivedDataAsPackets(char* errbuf) {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetrIP();
|
||||
CoutTimestamp(true);
|
||||
std::cout << ": Logging incoming TCP packet. OPCode: 0x" << hex << setw(4) << setfill('0') << pack->opcode << dec << ", size: " << setw(5) << setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
std::cout << ": Logging incoming TCP packet. OPCode: 0x" << std::hex << std::setw(4) << std::setfill('0') << pack->opcode << std::dec << ", size: " << std::setw(5) << std::setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
#if TCPN_LOG_PACKETS == 2
|
||||
if (pack->size >= 32)
|
||||
DumpPacket(pack->pBuffer, 32);
|
||||
@@ -663,7 +663,7 @@ bool EmuTCPConnection::ProcessReceivedDataAsOldPackets(char* errbuf) {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetrIP();
|
||||
CoutTimestamp(true);
|
||||
std::cout << ": Logging incoming TCP OldPacket. OPCode: 0x" << hex << setw(4) << setfill('0') << pack->opcode << dec << ", size: " << setw(5) << setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
std::cout << ": Logging incoming TCP OldPacket. OPCode: 0x" << std::hex << std::setw(4) << std::setfill('0') << pack->opcode << std::dec << ", size: " << std::setw(5) << std::setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
#if TCPN_LOG_PACKETS == 2
|
||||
if (pack->size >= 32)
|
||||
DumpPacket(pack->pBuffer, 32);
|
||||
|
||||
@@ -539,7 +539,7 @@ bool TCPConnection::Process() {
|
||||
if (!RecvData(errbuf)) {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetrIP();
|
||||
//cout << inet_ntoa(in) << ":" << GetrPort() << ": " << errbuf << endl;
|
||||
//std::cout << inet_ntoa(in) << ":" << GetrPort() << ": " << errbuf << std::endl;
|
||||
return false;
|
||||
}
|
||||
/* we break to do the send */
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ protected:
|
||||
T *data = *cur;
|
||||
if (data->IsFree() && (!data->CheckNetActive())) {
|
||||
#if EQN_DEBUG >= 4
|
||||
cout << "TCPConnection Connection deleted." << endl;
|
||||
std::cout << "TCPConnection Connection deleted." << std::endl;
|
||||
#endif
|
||||
delete data;
|
||||
cur = m_list.erase(cur);
|
||||
|
||||
+3
-3
@@ -199,18 +199,18 @@ bool Database::CheckBannedIPs(const char* loginIP)
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
//cout << "Checking against Banned IPs table."<< endl; //Lieka: Debugging
|
||||
//std::cout << "Checking against Banned IPs table."<< std::endl; //Lieka: Debugging
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT ip_address FROM Banned_IPs WHERE ip_address='%s'", loginIP), errbuf, &result)) {
|
||||
safe_delete_array(query);
|
||||
if (mysql_num_rows(result) != 0)
|
||||
{
|
||||
//cout << loginIP << " was present in the banned IPs table" << endl; //Lieka: Debugging
|
||||
//std::cout << loginIP << " was present in the banned IPs table" << std::endl; //Lieka: Debugging
|
||||
mysql_free_result(result);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//cout << loginIP << " was not present in the banned IPs table." << endl; //Lieka: Debugging
|
||||
//std::cout << loginIP << " was not present in the banned IPs table." << std::endl; //Lieka: Debugging
|
||||
mysql_free_result(result);
|
||||
return false;
|
||||
}
|
||||
|
||||
+2
-2
@@ -144,7 +144,7 @@ bool EQTime::saveFile(const char *filename)
|
||||
return false;
|
||||
}
|
||||
//Enable for debugging
|
||||
//cout << "SAVE: day=" << (long)eqTime.start_eqtime.day << ";hour=" << (long)eqTime.start_eqtime.hour << ";min=" << (long)eqTime.start_eqtime.minute << ";mon=" << (long)eqTime.start_eqtime.month << ";yr=" << eqTime.start_eqtime.year << ";timet=" << eqTime.start_realtime << endl;
|
||||
//std::cout << "SAVE: day=" << (long)eqTime.start_eqtime.day << ";hour=" << (long)eqTime.start_eqtime.hour << ";min=" << (long)eqTime.start_eqtime.minute << ";mon=" << (long)eqTime.start_eqtime.month << ";yr=" << eqTime.start_eqtime.year << ";timet=" << eqTime.start_realtime << std::endl;
|
||||
of << EQT_VERSION << std::endl;
|
||||
of << (long)eqTime.start_eqtime.day << std::endl;
|
||||
of << (long)eqTime.start_eqtime.hour << std::endl;
|
||||
@@ -194,7 +194,7 @@ bool EQTime::loadFile(const char *filename)
|
||||
in.ignore(80, '\n');
|
||||
in >> eqTime.start_realtime;
|
||||
//Enable for debugging...
|
||||
//cout << "LOAD: day=" << (long)eqTime.start_eqtime.day << ";hour=" << (long)eqTime.start_eqtime.hour << ";min=" << (long)eqTime.start_eqtime.minute << ";mon=" << (long)eqTime.start_eqtime.month << ";yr=" << eqTime.start_eqtime.year << ";timet=" << eqTime.start_realtime << endl;
|
||||
//std::cout << "LOAD: day=" << (long)eqTime.start_eqtime.day << ";hour=" << (long)eqTime.start_eqtime.hour << ";min=" << (long)eqTime.start_eqtime.minute << ";mon=" << (long)eqTime.start_eqtime.month << ";yr=" << eqTime.start_eqtime.year << ";timet=" << eqTime.start_realtime << std::endl;
|
||||
in.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ ListElement<TYPE>::ListElement(const TYPE& d)
|
||||
template<class TYPE>
|
||||
ListElement<TYPE>::~ListElement()
|
||||
{
|
||||
// cout << "ListElement<TYPE>::~ListElement()" << endl;
|
||||
// std::cout << "ListElement<TYPE>::~ListElement()" << std::endl;
|
||||
|
||||
if (data != 0)
|
||||
safe_delete(data);
|
||||
|
||||
@@ -78,7 +78,7 @@ void DumpPacketHex(const uchar* buf, uint32 size, uint32 cols, uint32 skip) {
|
||||
else {
|
||||
ascii[j++] = '.';
|
||||
}
|
||||
// cout << setfill(0) << setw(2) << hex << (int)buf[i] << " ";
|
||||
// std::cout << std::setfill(0) << std::setw(2) << std::hex << (int)buf[i] << " "; // unknown intent [CODEBUG]
|
||||
}
|
||||
uint32 k = ((i-skip)-1)%cols;
|
||||
if (k < 8)
|
||||
|
||||
@@ -80,7 +80,7 @@ void oldFileDumpPacketHex(const char* filename, const uchar* buf, uint32 size, u
|
||||
}
|
||||
sprintf(output, "%02X ",(unsigned char)buf[i]);
|
||||
logfile << output;
|
||||
// logfile << setfill(0) << setw(2) << hex << (int)buf[i] << " ";
|
||||
//logfile << std::setfill(0) << std::setw(2) << std::hex << (int)buf[i] << " "; // unknown intent [CODEBUG]
|
||||
}
|
||||
logfile << std::endl << std::endl;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ void FileDumpPacketHex(const char* filename, const uchar* buf, uint32 size, uint
|
||||
else {
|
||||
ascii[j++] = '.';
|
||||
}
|
||||
// logfile << setfill(0) << setw(2) << hex << (int)buf[i] << " ";
|
||||
//logfile << std::setfill(0) << std::setw(2) << std::hex << (int)buf[i] << " "; // unknown intent [CODEBUG]
|
||||
}
|
||||
uint32 k = ((i-skip)-1)%cols;
|
||||
if (k < 8)
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ public:
|
||||
return;
|
||||
|
||||
for (i=0; i<len; i++) {
|
||||
// cout << i << ": 0x" << hex << (int) message[i] << dec << " " << message[i] << endl;
|
||||
// std::cout << i << ": 0x" << std::hex << (int) message[i] << std::dec << " " << message[i] << std::endl; // undefined cout [CODEBUG]
|
||||
if (inarg) {
|
||||
if ((inquote == false && (message[i] == div || message[i] == div2 || message[i] == div3)) || (inquote && (message[i] == '\'' || message[i] == '\"') && (message[i+1] == div || message[i+1] == div2 || message[i+1] == div3 || message[i+1] == 0))) {
|
||||
inquote = false;
|
||||
|
||||
Reference in New Issue
Block a user