mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-02 07:07:29 +01:00
Core: Removed more operator workarounds for ACE_Singleton (missed previously because of inconsistent naming)
--HG-- branch : trunk
This commit is contained in:
@@ -61,23 +61,23 @@ RARunnable::~RARunnable()
|
||||
|
||||
void RARunnable::run()
|
||||
{
|
||||
if (!sConfig.GetBoolDefault("Ra.Enable", false))
|
||||
if (!sConfig->GetBoolDefault("Ra.Enable", false))
|
||||
return;
|
||||
|
||||
ACE_Acceptor<RASocket, ACE_SOCK_ACCEPTOR> acceptor;
|
||||
|
||||
uint16 raport = sConfig.GetIntDefault("Ra.Port", 3443);
|
||||
std::string stringip = sConfig.GetStringDefault("Ra.IP", "0.0.0.0");
|
||||
uint16 raport = sConfig->GetIntDefault("Ra.Port", 3443);
|
||||
std::string stringip = sConfig->GetStringDefault("Ra.IP", "0.0.0.0");
|
||||
|
||||
ACE_INET_Addr listen_addr(raport, stringip.c_str());
|
||||
|
||||
if (acceptor.open(listen_addr, m_Reactor) == -1)
|
||||
{
|
||||
sLog.outError("Trinity RA can not bind to port %d on %s", raport, stringip.c_str());
|
||||
sLog->outError("Trinity RA can not bind to port %d on %s", raport, stringip.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
sLog.outString("Starting Trinity RA on port %d on %s", raport, stringip.c_str());
|
||||
sLog->outString("Starting Trinity RA on port %d on %s", raport, stringip.c_str());
|
||||
|
||||
while (!World::IsStopped())
|
||||
{
|
||||
@@ -89,5 +89,5 @@ void RARunnable::run()
|
||||
break;
|
||||
}
|
||||
|
||||
sLog.outStaticDebug("Trinity RA thread exiting");
|
||||
sLog->outStaticDebug("Trinity RA thread exiting");
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
RASocket::RASocket()
|
||||
{
|
||||
iMinLevel = sConfig.GetIntDefault("RA.MinLevel", 3);
|
||||
iMinLevel = sConfig->GetIntDefault("RA.MinLevel", 3);
|
||||
}
|
||||
|
||||
RASocket::~RASocket()
|
||||
@@ -45,18 +45,18 @@ int RASocket::open(void *)
|
||||
|
||||
if (peer().get_remote_addr(remote_addr) == -1)
|
||||
{
|
||||
sLog.outError("RASocket::open: peer().get_remote_addr error is %s", ACE_OS::strerror(errno));
|
||||
sLog->outError("RASocket::open: peer().get_remote_addr error is %s", ACE_OS::strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
sLog.outRemote("Incoming connection from %s", remote_addr.get_host_addr());
|
||||
sLog->outRemote("Incoming connection from %s", remote_addr.get_host_addr());
|
||||
|
||||
return activate();
|
||||
}
|
||||
|
||||
int RASocket::handle_close(ACE_HANDLE, ACE_Reactor_Mask)
|
||||
{
|
||||
sLog.outRemote("Closing connection");
|
||||
sLog->outRemote("Closing connection");
|
||||
peer().close_reader();
|
||||
wait();
|
||||
destroy();
|
||||
@@ -122,7 +122,7 @@ int RASocket::recv_line(std::string& out_line)
|
||||
|
||||
if (recv_line(message_block) == -1)
|
||||
{
|
||||
sLog.outRemote("Recv error %s", ACE_OS::strerror(errno));
|
||||
sLog->outRemote("Recv error %s", ACE_OS::strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ int RASocket::process_command(const std::string& command)
|
||||
if (command.length() == 0)
|
||||
return 0;
|
||||
|
||||
sLog.outRemote("Got command: %s", command.c_str());
|
||||
sLog->outRemote("Got command: %s", command.c_str());
|
||||
|
||||
// handle quit, exit and logout commands to terminate connection
|
||||
if (command == "quit" || command == "exit" || command == "logout") {
|
||||
@@ -145,7 +145,7 @@ int RASocket::process_command(const std::string& command)
|
||||
}
|
||||
|
||||
CliCommandHolder* cmd = new CliCommandHolder(this, command.c_str(), &RASocket::zprint, &RASocket::commandFinished);
|
||||
sWorld.QueueCliCommand(cmd);
|
||||
sWorld->QueueCliCommand(cmd);
|
||||
|
||||
// wait for result
|
||||
ACE_Message_Block* mb;
|
||||
@@ -183,7 +183,7 @@ int RASocket::check_access_level(const std::string& user)
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog.outRemote("User %s does not exist in database", user.c_str());
|
||||
sLog->outRemote("User %s does not exist in database", user.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -191,12 +191,12 @@ int RASocket::check_access_level(const std::string& user)
|
||||
|
||||
if (fields[1].GetUInt32() < iMinLevel)
|
||||
{
|
||||
sLog.outRemote("User %s has no privilege to login", user.c_str());
|
||||
sLog->outRemote("User %s has no privilege to login", user.c_str());
|
||||
return -1;
|
||||
}
|
||||
else if (fields[2].GetInt32() != -1)
|
||||
{
|
||||
sLog.outRemote("User %s has to be assigned on all realms (with RealmID = '-1')", user.c_str());
|
||||
sLog->outRemote("User %s has to be assigned on all realms (with RealmID = '-1')", user.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ int RASocket::check_password(const std::string& user, const std::string& pass)
|
||||
|
||||
if (!check)
|
||||
{
|
||||
sLog.outRemote("Wrong password for user: %s", user.c_str());
|
||||
sLog->outRemote("Wrong password for user: %s", user.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ int RASocket::authenticate()
|
||||
if (recv_line(pass) == -1)
|
||||
return -1;
|
||||
|
||||
sLog.outRemote("Login attempt for user: %s", user.c_str());
|
||||
sLog->outRemote("Login attempt for user: %s", user.c_str());
|
||||
|
||||
if (check_access_level(user) == -1)
|
||||
return -1;
|
||||
@@ -252,7 +252,7 @@ int RASocket::authenticate()
|
||||
if (check_password(user, pass) == -1)
|
||||
return -1;
|
||||
|
||||
sLog.outRemote("User login: %s", user.c_str());
|
||||
sLog->outRemote("User login: %s", user.c_str());
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -269,7 +269,7 @@ int RASocket::svc(void)
|
||||
}
|
||||
|
||||
// send motd
|
||||
if (send(std::string(sWorld.GetMotd()) + "\r\n") == -1)
|
||||
if (send(std::string(sWorld->GetMotd()) + "\r\n") == -1)
|
||||
return -1;
|
||||
|
||||
for(;;)
|
||||
@@ -304,7 +304,7 @@ void RASocket::zprint(void* callbackArg, const char * szText)
|
||||
|
||||
if (socket->putq(mb, const_cast<ACE_Time_Value*>(&ACE_Time_Value::zero)) == -1)
|
||||
{
|
||||
sLog.outRemote("Failed to enqueue message, queue is full or closed. Error is %s", ACE_OS::strerror(errno));
|
||||
sLog->outRemote("Failed to enqueue message, queue is full or closed. Error is %s", ACE_OS::strerror(errno));
|
||||
mb->release();
|
||||
}
|
||||
}
|
||||
@@ -325,7 +325,7 @@ void RASocket::commandFinished(void* callbackArg, bool /*success*/)
|
||||
if (socket->putq(mb) == -1)
|
||||
{
|
||||
// getting here is bad, command can't be marked as complete
|
||||
sLog.outRemote("Failed to enqueue command end message. Error is %s", ACE_OS::strerror(errno));
|
||||
sLog->outRemote("Failed to enqueue command end message. Error is %s", ACE_OS::strerror(errno));
|
||||
mb->release();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user