aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2011-10-18 14:59:23 +0200
committerSpp <spp@jorge.gr>2011-10-18 14:59:23 +0200
commite3f8588a227cbf9108f396131a199d75868bf539 (patch)
tree7af85d79ae50f08a965cd5f601542ea6959519ed /src/server/worldserver
parentb5e8a192b121b8ec297885e04566758c236d9191 (diff)
Minor changes here and there:
- Cosmetic changes - 'Engrish fix' - Initialization of some vars - Remove some not needed includes
Diffstat (limited to 'src/server/worldserver')
-rwxr-xr-xsrc/server/worldserver/CommandLine/CliRunnable.cpp34
-rw-r--r--src/server/worldserver/RemoteAccess/RARunnable.cpp11
2 files changed, 20 insertions, 25 deletions
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp
index cf5ad79f878..564f6028eca 100755
--- a/src/server/worldserver/CommandLine/CliRunnable.cpp
+++ b/src/server/worldserver/CommandLine/CliRunnable.cpp
@@ -115,6 +115,7 @@ void commandFinished(void*, bool /*success*/)
printf("TC> ");
fflush(stdout);
}
+
/**
* Collects all GUIDs (and related info) from deleted characters which are still in the database.
*
@@ -562,10 +563,11 @@ void CliRunnable::run()
{
///- Display the list of available CLI functions then beep
//sLog->outString("");
- #if PLATFORM != PLATFORM_WINDOWS
+#if PLATFORM != PLATFORM_WINDOWS
rl_attempted_completion_function = cli_completion;
rl_event_hook = cli_hook_func;
- #endif
+#endif
+
if (ConfigMgr::GetBoolDefault("BeepAtStart", true))
printf("\a"); // \a = Alert
@@ -580,49 +582,49 @@ void CliRunnable::run()
char *command_str ; // = fgets(commandbuf, sizeof(commandbuf), stdin);
- #if PLATFORM == PLATFORM_WINDOWS
+#if PLATFORM == PLATFORM_WINDOWS
char commandbuf[256];
command_str = fgets(commandbuf, sizeof(commandbuf), stdin);
- #else
+#else
command_str = readline("TC>");
rl_bind_key('\t', rl_complete);
- #endif
+#endif
+
if (command_str != NULL)
{
- for (int x=0; command_str[x]; x++)
- if (command_str[x]=='\r'||command_str[x]=='\n')
+ for (int x=0; command_str[x]; ++x)
+ if (command_str[x] == '\r' || command_str[x] == '\n')
{
- command_str[x]=0;
+ command_str[x] = 0;
break;
}
if (!*command_str)
{
- #if PLATFORM == PLATFORM_WINDOWS
+#if PLATFORM == PLATFORM_WINDOWS
printf("TC>");
- #endif
+#endif
continue;
}
std::string command;
if (!consoleToUtf8(command_str, command)) // convert from console encoding to utf8
{
- #if PLATFORM == PLATFORM_WINDOWS
+#if PLATFORM == PLATFORM_WINDOWS
printf("TC>");
- #endif
+#endif
continue;
}
+
fflush(stdout);
sWorld->QueueCliCommand(new CliCommandHolder(NULL, command.c_str(), &utf8print, &commandFinished));
- #if PLATFORM != PLATFORM_WINDOWS
+#if PLATFORM != PLATFORM_WINDOWS
add_history(command.c_str());
- #endif
-
+#endif
}
else if (feof(stdin))
{
World::StopNow(SHUTDOWN_EXIT_CODE);
}
-
}
}
diff --git a/src/server/worldserver/RemoteAccess/RARunnable.cpp b/src/server/worldserver/RemoteAccess/RARunnable.cpp
index d7cee88b994..60145cf99aa 100644
--- a/src/server/worldserver/RemoteAccess/RARunnable.cpp
+++ b/src/server/worldserver/RemoteAccess/RARunnable.cpp
@@ -33,22 +33,17 @@
#include "RASocket.h"
-RARunnable::RARunnable() : m_Reactor(NULL)
+RARunnable::RARunnable()
{
- ACE_Reactor_Impl* imp = 0;
+ ACE_Reactor_Impl* imp = NULL;
#if defined (ACE_HAS_EVENT_POLL) || defined (ACE_HAS_DEV_POLL)
-
imp = new ACE_Dev_Poll_Reactor();
-
imp->max_notify_iterations (128);
imp->restart (1);
-
#else
-
imp = new ACE_TP_Reactor();
imp->max_notify_iterations (128);
-
#endif
m_Reactor = new ACE_Reactor (imp, 1);
@@ -68,7 +63,6 @@ void RARunnable::run()
uint16 raport = ConfigMgr::GetIntDefault("Ra.Port", 3443);
std::string stringip = ConfigMgr::GetStringDefault("Ra.IP", "0.0.0.0");
-
ACE_INET_Addr listen_addr(raport, stringip.c_str());
if (acceptor.open(listen_addr, m_Reactor) == -1)
@@ -84,7 +78,6 @@ void RARunnable::run()
// don't be too smart to move this outside the loop
// the run_reactor_event_loop will modify interval
ACE_Time_Value interval(0, 100000);
-
if (m_Reactor->run_reactor_event_loop(interval) == -1)
break;
}