Minor changes here and there:

- Cosmetic changes
- 'Engrish fix'
- Initialization of some vars
- Remove some not needed includes
This commit is contained in:
Spp
2011-10-18 14:59:23 +02:00
parent b5e8a192b1
commit e3f8588a22
21 changed files with 142 additions and 143 deletions
@@ -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);
}
}
}
@@ -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;
}