*Missed some changes

--HG--
branch : trunk
This commit is contained in:
maximius
2009-09-11 13:42:39 -07:00
parent aed229dfe6
commit b4a13eff51
3 changed files with 17 additions and 26 deletions
+10 -16
View File
@@ -127,8 +127,9 @@ World::~World()
m_weathers.clear(); m_weathers.clear();
while (!cliCmdQueue.empty()) CliCommandHolder* command;
delete cliCmdQueue.next(); while (cliCmdQueue.next(command))
delete command;
VMAP::VMapFactory::clear(); VMAP::VMapFactory::clear();
@@ -2359,11 +2360,9 @@ void World::SendServerMessage(ServerMessageType type, const char *text, Player*
void World::UpdateSessions( uint32 diff ) void World::UpdateSessions( uint32 diff )
{ {
///- Add new sessions ///- Add new sessions
while(!addSessQueue.empty()) WorldSession* sess;
{ while(addSessQueue.next(sess))
WorldSession* sess = addSessQueue.next ();
AddSession_ (sess); AddSession_ (sess);
}
///- Then send an update signal to remaining ones ///- Then send an update signal to remaining ones
for (SessionMap::iterator itr = m_sessions.begin(), next; itr != m_sessions.end(); itr = next) for (SessionMap::iterator itr = m_sessions.begin(), next; itr != m_sessions.end(); itr = next)
@@ -2388,25 +2387,20 @@ void World::UpdateSessions( uint32 diff )
// This handles the issued and queued CLI commands // This handles the issued and queued CLI commands
void World::ProcessCliCommands() void World::ProcessCliCommands()
{ {
if (cliCmdQueue.empty()) CliCommandHolder::Print* zprint = NULL;
return;
CliCommandHolder::Print* zprint; CliCommandHolder* command;
while (cliCmdQueue.next(command))
while (!cliCmdQueue.empty())
{ {
sLog.outDebug("CLI command under processing..."); sLog.outDebug("CLI command under processing...");
CliCommandHolder *command = cliCmdQueue.next();
zprint = command->m_print; zprint = command->m_print;
CliHandler(zprint).ParseCommands(command->m_command); CliHandler(zprint).ParseCommands(command->m_command);
delete command; delete command;
} }
// print the console message here so it looks right // print the console message here so it looks right
zprint("TC> "); if (zprint)
zprint("TC> ");
} }
void World::SendRNDBroadcast() void World::SendRNDBroadcast()
+5 -7
View File
@@ -73,11 +73,10 @@ WorldSession::~WorldSession()
} }
///- empty incoming packet queue ///- empty incoming packet queue
while(!_recvQueue.empty()) WorldPacket* packet;
{ while(_recvQueue.next(packet))
WorldPacket *packet = _recvQueue.next ();
delete packet; delete packet;
}
loginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); loginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId());
CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE account = %u;", GetAccountId()); CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE account = %u;", GetAccountId());
} }
@@ -169,10 +168,9 @@ bool WorldSession::Update(uint32 /*diff*/)
{ {
///- Retrieve packets from the receive queue and call the appropriate handlers ///- Retrieve packets from the receive queue and call the appropriate handlers
/// not proccess packets if socket already closed /// not proccess packets if socket already closed
while (!_recvQueue.empty() && m_Socket && !m_Socket->IsClosed ()) WorldPacket* packet;
while (_recvQueue.next(packet) && m_Socket && !m_Socket->IsClosed ())
{ {
WorldPacket *packet = _recvQueue.next();
/*#if 1 /*#if 1
sLog.outError( "MOEP: %s (0x%.4X)", sLog.outError( "MOEP: %s (0x%.4X)",
LookupOpcodeName(packet->GetOpcode()), LookupOpcodeName(packet->GetOpcode()),
+2 -3
View File
@@ -28,7 +28,6 @@ SqlDelayThread::SqlDelayThread(Database* db) : m_dbEngine(db), m_running(true)
void SqlDelayThread::run() void SqlDelayThread::run()
{ {
SqlOperation* s;
#ifndef DO_POSTGRESQL #ifndef DO_POSTGRESQL
mysql_thread_init(); mysql_thread_init();
#endif #endif
@@ -38,9 +37,9 @@ void SqlDelayThread::run()
// if the running state gets turned off while sleeping // if the running state gets turned off while sleeping
// empty the queue before exiting // empty the queue before exiting
ACE_Based::Thread::Sleep(10); ACE_Based::Thread::Sleep(10);
while (!m_sqlQueue.empty()) SqlOperation* s;
while (m_sqlQueue.next(s))
{ {
s = m_sqlQueue.next();
s->Execute(m_dbEngine); s->Execute(m_dbEngine);
delete s; delete s;
} }