aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver/RemoteAccess
diff options
context:
space:
mode:
authorShauren <none@none>2010-12-23 23:25:44 +0100
committerShauren <none@none>2010-12-23 23:25:44 +0100
commit928443d8993869dfbf3adceabe4ba0b3cfe0edef (patch)
treeb30f1385e6f2dd8d95357590593aa2988b094593 /src/server/worldserver/RemoteAccess
parent95daf7998fc3b772fdcd70087c12db80bd5a031a (diff)
Core: Removed more operator workarounds for ACE_Singleton (missed previously because of inconsistent naming)
--HG-- branch : trunk
Diffstat (limited to 'src/server/worldserver/RemoteAccess')
-rw-r--r--src/server/worldserver/RemoteAccess/RARunnable.cpp12
-rwxr-xr-xsrc/server/worldserver/RemoteAccess/RASocket.cpp32
2 files changed, 22 insertions, 22 deletions
diff --git a/src/server/worldserver/RemoteAccess/RARunnable.cpp b/src/server/worldserver/RemoteAccess/RARunnable.cpp
index 87ddd4cb43a..2e7c25440ba 100644
--- a/src/server/worldserver/RemoteAccess/RARunnable.cpp
+++ b/src/server/worldserver/RemoteAccess/RARunnable.cpp
@@ -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");
}
diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp
index ba49c9dcf57..4f32d8c0ef2 100755
--- a/src/server/worldserver/RemoteAccess/RASocket.cpp
+++ b/src/server/worldserver/RemoteAccess/RASocket.cpp
@@ -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();
}
}