mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-16 18:08:22 +00:00
Loginserver conversion to new Logging system
This commit is contained in:
+23
-23
@@ -16,12 +16,12 @@
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "client.h"
|
||||
#include "error_log.h"
|
||||
#include "login_server.h"
|
||||
#include "login_structures.h"
|
||||
#include "../common/misc_functions.h"
|
||||
#include "../common/eqemu_logsys.h"
|
||||
|
||||
extern ErrorLog *server_log;
|
||||
extern EQEmuLogSys Log;
|
||||
extern LoginServer server;
|
||||
|
||||
Client::Client(std::shared_ptr<EQStream> c, LSClientVersion v)
|
||||
@@ -41,7 +41,7 @@ bool Client::Process()
|
||||
{
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
server_log->Log(log_network, "Application packet received from client (size %u)", app->Size());
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Application packet received from client (size %u)", app->Size());
|
||||
}
|
||||
|
||||
if(server.options.IsDumpInPacketsOn())
|
||||
@@ -55,7 +55,7 @@ bool Client::Process()
|
||||
{
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
server_log->Log(log_network, "Session ready received from client.");
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Session ready received from client.");
|
||||
}
|
||||
Handle_SessionReady((const char*)app->pBuffer, app->Size());
|
||||
break;
|
||||
@@ -64,13 +64,13 @@ bool Client::Process()
|
||||
{
|
||||
if(app->Size() < 20)
|
||||
{
|
||||
server_log->Log(log_network_error, "Login received but it is too small, discarding.");
|
||||
Log.Out(Logs::General, Logs::Error, "Login received but it is too small, discarding.");
|
||||
break;
|
||||
}
|
||||
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
server_log->Log(log_network, "Login received from client.");
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Login received from client.");
|
||||
}
|
||||
|
||||
Handle_Login((const char*)app->pBuffer, app->Size());
|
||||
@@ -80,7 +80,7 @@ bool Client::Process()
|
||||
{
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
server_log->Log(log_network, "Server list request received from client.");
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Server list request received from client.");
|
||||
}
|
||||
|
||||
SendServerListPacket();
|
||||
@@ -90,7 +90,7 @@ bool Client::Process()
|
||||
{
|
||||
if(app->Size() < sizeof(PlayEverquestRequest_Struct))
|
||||
{
|
||||
server_log->Log(log_network_error, "Play received but it is too small, discarding.");
|
||||
Log.Out(Logs::General, Logs::Error, "Play received but it is too small, discarding.");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ bool Client::Process()
|
||||
{
|
||||
char dump[64];
|
||||
app->build_header_dump(dump);
|
||||
server_log->Log(log_network_error, "Recieved unhandled application packet from the client: %s.", dump);
|
||||
Log.Out(Logs::General, Logs::Error, "Recieved unhandled application packet from the client: %s.", dump);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,20 +116,20 @@ void Client::Handle_SessionReady(const char* data, unsigned int size)
|
||||
{
|
||||
if(status != cs_not_sent_session_ready)
|
||||
{
|
||||
server_log->Log(log_network_error, "Session ready received again after already being received.");
|
||||
Log.Out(Logs::General, Logs::Error, "Session ready received again after already being received.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(size < sizeof(unsigned int))
|
||||
{
|
||||
server_log->Log(log_network_error, "Session ready was too small.");
|
||||
Log.Out(Logs::General, Logs::Error, "Session ready was too small.");
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int mode = *((unsigned int*)data);
|
||||
if(mode == (unsigned int)lm_from_world)
|
||||
{
|
||||
server_log->Log(log_network, "Session ready indicated logged in from world(unsupported feature), disconnecting.");
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Session ready indicated logged in from world(unsupported feature), disconnecting.");
|
||||
connection->Close();
|
||||
return;
|
||||
}
|
||||
@@ -177,13 +177,13 @@ void Client::Handle_Login(const char* data, unsigned int size)
|
||||
{
|
||||
if(status != cs_waiting_for_login)
|
||||
{
|
||||
server_log->Log(log_network_error, "Login received after already having logged in.");
|
||||
Log.Out(Logs::General, Logs::Error, "Login received after already having logged in.");
|
||||
return;
|
||||
}
|
||||
|
||||
if((size - 12) % 8 != 0)
|
||||
{
|
||||
server_log->Log(log_network_error, "Login received packet of size: %u, this would cause a block corruption, discarding.", size);
|
||||
Log.Out(Logs::General, Logs::Error, "Login received packet of size: %u, this would cause a block corruption, discarding.", size);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -204,8 +204,8 @@ void Client::Handle_Login(const char* data, unsigned int size)
|
||||
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
server_log->Log(log_client, "User: %s", e_user.c_str());
|
||||
server_log->Log(log_client, "Hash: %s", e_hash.c_str());
|
||||
Log.Out(Logs::General, Logs::Debug, "User: %s", e_user.c_str());
|
||||
Log.Out(Logs::General, Logs::Debug, "Hash: %s", e_hash.c_str());
|
||||
}
|
||||
|
||||
server.eq_crypto->DeleteHeap(e_buffer);
|
||||
@@ -218,8 +218,8 @@ void Client::Handle_Login(const char* data, unsigned int size)
|
||||
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
server_log->Log(log_client, "User: %s", e_user.c_str());
|
||||
server_log->Log(log_client, "Hash: %s", e_hash.c_str());
|
||||
Log.Out(Logs::General, Logs::Debug, "User: %s", e_user.c_str());
|
||||
Log.Out(Logs::General, Logs::Debug, "Hash: %s", e_hash.c_str());
|
||||
}
|
||||
|
||||
_HeapDeleteCharBuffer(e_buffer);
|
||||
@@ -228,7 +228,7 @@ void Client::Handle_Login(const char* data, unsigned int size)
|
||||
bool result;
|
||||
if(server.db->GetLoginDataFromAccountName(e_user, d_pass_hash, d_account_id) == false)
|
||||
{
|
||||
server_log->Log(log_client_error, "Error logging in, user %s does not exist in the database.", e_user.c_str());
|
||||
Log.Out(Logs::General, Logs::Error, "Error logging in, user %s does not exist in the database.", e_user.c_str());
|
||||
result = false;
|
||||
}
|
||||
else
|
||||
@@ -331,7 +331,7 @@ void Client::Handle_Play(const char* data)
|
||||
{
|
||||
if(status != cs_logged_in)
|
||||
{
|
||||
server_log->Log(log_client_error, "Client sent a play request when they either were not logged in, discarding.");
|
||||
Log.Out(Logs::General, Logs::Error, "Client sent a play request when they either were not logged in, discarding.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ void Client::Handle_Play(const char* data)
|
||||
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
server_log->Log(log_network, "Play received from client, server number %u sequence %u.", server_id_in, sequence_in);
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Play received from client, server number %u sequence %u.", server_id_in, sequence_in);
|
||||
}
|
||||
|
||||
this->play_server_id = (unsigned int)play->ServerNumber;
|
||||
@@ -367,8 +367,8 @@ void Client::SendPlayResponse(EQApplicationPacket *outapp)
|
||||
{
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
server_log->Log(log_network_trace, "Sending play response for %s.", GetAccountName().c_str());
|
||||
server_log->LogPacket(log_network_trace, (const char*)outapp->pBuffer, outapp->size);
|
||||
Log.Out(Logs::General, Logs::Netcode, "Sending play response for %s.", GetAccountName().c_str());
|
||||
// server_log->LogPacket(log_network_trace, (const char*)outapp->pBuffer, outapp->size);
|
||||
}
|
||||
connection->QueuePacket(outapp);
|
||||
status = cs_logged_in;
|
||||
|
||||
Reference in New Issue
Block a user