mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[12069] Cleanup comment style
This commit is contained in:
parent
5efb3867f5
commit
835d1c7479
205 changed files with 2835 additions and 2835 deletions
|
|
@ -137,7 +137,7 @@ World::~World()
|
|||
VMAP::VMapFactory::clear();
|
||||
MMAP::MMapFactory::clear();
|
||||
|
||||
//TODO free addSessQueue
|
||||
// TODO free addSessQueue
|
||||
}
|
||||
|
||||
/// Find a player in a specified zone
|
||||
|
|
@ -198,7 +198,7 @@ World::AddSession_(WorldSession* s)
|
|||
{
|
||||
MANGOS_ASSERT(s);
|
||||
|
||||
//NOTE - Still there is race condition in WorldSession* being used in the Sockets
|
||||
// NOTE - Still there is race condition in WorldSession* being used in the Sockets
|
||||
|
||||
///- kick already loaded player with same account (if any) and remove session
|
||||
///- if player is in loading and want to load again, return
|
||||
|
|
@ -231,10 +231,10 @@ World::AddSession_(WorldSession* s)
|
|||
|
||||
uint32 Sessions = GetActiveAndQueuedSessionCount();
|
||||
uint32 pLimit = GetPlayerAmountLimit();
|
||||
uint32 QueueSize = GetQueuedSessionCount(); //number of players in the queue
|
||||
uint32 QueueSize = GetQueuedSessionCount(); // number of players in the queue
|
||||
|
||||
//so we don't count the user trying to
|
||||
//login as a session and queue the socket that we are using
|
||||
// so we don't count the user trying to
|
||||
// login as a session and queue the socket that we are using
|
||||
if (decrease_session)
|
||||
--Sessions;
|
||||
|
||||
|
|
@ -797,7 +797,7 @@ void World::LoadConfigSettings(bool reload)
|
|||
m_VisibleObjectGreyDistance = MAX_VISIBILITY_DISTANCE;
|
||||
}
|
||||
|
||||
//visibility on continents
|
||||
// visibility on continents
|
||||
m_MaxVisibleDistanceOnContinents = sConfig.GetFloatDefault("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE);
|
||||
if (m_MaxVisibleDistanceOnContinents < 45 * getConfig(CONFIG_FLOAT_RATE_CREATURE_AGGRO))
|
||||
{
|
||||
|
|
@ -810,7 +810,7 @@ void World::LoadConfigSettings(bool reload)
|
|||
m_MaxVisibleDistanceOnContinents = MAX_VISIBILITY_DISTANCE - m_VisibleUnitGreyDistance;
|
||||
}
|
||||
|
||||
//visibility in instances
|
||||
// visibility in instances
|
||||
m_MaxVisibleDistanceInInstances = sConfig.GetFloatDefault("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE);
|
||||
if (m_MaxVisibleDistanceInInstances < 45 * getConfig(CONFIG_FLOAT_RATE_CREATURE_AGGRO))
|
||||
{
|
||||
|
|
@ -823,7 +823,7 @@ void World::LoadConfigSettings(bool reload)
|
|||
m_MaxVisibleDistanceInInstances = MAX_VISIBILITY_DISTANCE - m_VisibleUnitGreyDistance;
|
||||
}
|
||||
|
||||
//visibility in BG/Arenas
|
||||
// visibility in BG/Arenas
|
||||
m_MaxVisibleDistanceInBGArenas = sConfig.GetFloatDefault("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS);
|
||||
if (m_MaxVisibleDistanceInBGArenas < 45 * getConfig(CONFIG_FLOAT_RATE_CREATURE_AGGRO))
|
||||
{
|
||||
|
|
@ -938,7 +938,7 @@ void World::SetInitialWorldSettings()
|
|||
}
|
||||
|
||||
///- Update the realm entry in the database with the realm type from the config file
|
||||
//No SQL injection as values are treated as integers
|
||||
// No SQL injection as values are treated as integers
|
||||
|
||||
// not send custom type REALM_FFA_PVP to realm list
|
||||
uint32 server_type = IsFFAPvPRealm() ? REALM_TYPE_PVP : getConfig(CONFIG_UINT32_GAME_TYPE);
|
||||
|
|
@ -1204,7 +1204,7 @@ void World::SetInitialWorldSettings()
|
|||
sLog.outString(">>> Achievements loaded");
|
||||
sLog.outString();
|
||||
|
||||
sLog.outString("Loading Instance encounters data..."); // must be after Creature loading
|
||||
sLog.outString("Loading Instance encounters data..."); // must be after Creature loading
|
||||
sObjectMgr.LoadInstanceEncounters();
|
||||
|
||||
sLog.outString("Loading Npc Text Id...");
|
||||
|
|
@ -1285,12 +1285,12 @@ void World::SetInitialWorldSettings()
|
|||
///- Load and initialize scripts
|
||||
sLog.outString("Loading Scripts...");
|
||||
sLog.outString();
|
||||
sScriptMgr.LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
|
||||
sScriptMgr.LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
|
||||
sScriptMgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sScriptMgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sScriptMgr.LoadGameObjectTemplateScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sScriptMgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sScriptMgr.LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
|
||||
sScriptMgr.LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
|
||||
sScriptMgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sScriptMgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sScriptMgr.LoadGameObjectTemplateScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sScriptMgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sLog.outString(">>> Scripts loaded");
|
||||
sLog.outString();
|
||||
|
||||
|
|
@ -1342,16 +1342,16 @@ void World::SetInitialWorldSettings()
|
|||
m_timers[WUPDATE_WEATHERS].SetInterval(1 * IN_MILLISECONDS);
|
||||
m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE * IN_MILLISECONDS);
|
||||
m_timers[WUPDATE_UPTIME].SetInterval(getConfig(CONFIG_UINT32_UPTIME_UPDATE)*MINUTE * IN_MILLISECONDS);
|
||||
//Update "uptime" table based on configuration entry in minutes.
|
||||
// Update "uptime" table based on configuration entry in minutes.
|
||||
m_timers[WUPDATE_CORPSES].SetInterval(20 * MINUTE * IN_MILLISECONDS);
|
||||
m_timers[WUPDATE_DELETECHARS].SetInterval(DAY * IN_MILLISECONDS); // check for chars to delete every day
|
||||
|
||||
// for AhBot
|
||||
m_timers[WUPDATE_AHBOT].SetInterval(20 * IN_MILLISECONDS); // every 20 sec
|
||||
|
||||
//to set mailtimer to return mails every day between 4 and 5 am
|
||||
//mailtimer is increased when updating auctions
|
||||
//one second is 1000 -(tested on win system)
|
||||
// to set mailtimer to return mails every day between 4 and 5 am
|
||||
// mailtimer is increased when updating auctions
|
||||
// one second is 1000 -(tested on win system)
|
||||
mail_timer = uint32((((localtime(&m_gameTime)->tm_hour + 20) % 24) * HOUR * IN_MILLISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval());
|
||||
//1440
|
||||
mail_timer_expires = uint32((DAY * IN_MILLISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval()));
|
||||
|
|
@ -1370,7 +1370,7 @@ void World::SetInitialWorldSettings()
|
|||
sBattleGroundMgr.CreateInitialBattleGrounds();
|
||||
sBattleGroundMgr.InitAutomaticArenaPointDistribution();
|
||||
|
||||
//Not sure if this can be moved up in the sequence (with static data loading) as it uses MapManager
|
||||
// Not sure if this can be moved up in the sequence (with static data loading) as it uses MapManager
|
||||
sLog.outString("Loading Transports...");
|
||||
sMapMgr.LoadTransports();
|
||||
|
||||
|
|
@ -1388,7 +1388,7 @@ void World::SetInitialWorldSettings()
|
|||
|
||||
sLog.outString("Starting Game Event system...");
|
||||
uint32 nextGameEvent = sGameEventMgr.Initialize();
|
||||
m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event
|
||||
m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); // depend on next event
|
||||
|
||||
// Delete all characters which have been deleted X days before
|
||||
Player::DeleteOldCharacters();
|
||||
|
|
@ -1512,7 +1512,7 @@ void World::Update(uint32 diff)
|
|||
for (WeatherMap::iterator itr = m_weathers.begin(); itr != m_weathers.end();)
|
||||
{
|
||||
///- and remove Weather objects for zones with no player
|
||||
//As interval > WorldTick
|
||||
// As interval > WorldTick
|
||||
if (!itr->second->Update(m_timers[WUPDATE_WEATHERS].GetInterval()))
|
||||
{
|
||||
delete itr->second;
|
||||
|
|
@ -1576,7 +1576,7 @@ void World::Update(uint32 diff)
|
|||
// And last, but not least handle the issued cli commands
|
||||
ProcessCliCommands();
|
||||
|
||||
//cleanup unused GridMap objects as well as VMaps
|
||||
// cleanup unused GridMap objects as well as VMaps
|
||||
sTerrainMgr.Update(diff);
|
||||
}
|
||||
|
||||
|
|
@ -1635,11 +1635,11 @@ namespace MaNGOS
|
|||
|
||||
uint32 lineLength = (line ? strlen(line) : 0) + 1;
|
||||
|
||||
data->Initialize(SMSG_MESSAGECHAT, 100); // guess size
|
||||
data->Initialize(SMSG_MESSAGECHAT, 100);// guess size
|
||||
*data << uint8(CHAT_MSG_SYSTEM);
|
||||
*data << uint32(LANG_UNIVERSAL);
|
||||
*data << uint64(0);
|
||||
*data << uint32(0); // can be chat msg group or something
|
||||
*data << uint32(0); // can be chat msg group or something
|
||||
*data << uint64(0);
|
||||
*data << uint32(lineLength);
|
||||
*data << line;
|
||||
|
|
@ -1744,22 +1744,22 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, uint32 duration_
|
|||
std::string safe_author = author;
|
||||
LoginDatabase.escape_string(safe_author);
|
||||
|
||||
QueryResult* resultAccounts = NULL; //used for kicking
|
||||
QueryResult* resultAccounts = NULL; // used for kicking
|
||||
|
||||
///- Update the database with ban information
|
||||
switch (mode)
|
||||
{
|
||||
case BAN_IP:
|
||||
//No SQL injection as strings are escaped
|
||||
// No SQL injection as strings are escaped
|
||||
resultAccounts = LoginDatabase.PQuery("SELECT id FROM account WHERE last_ip = '%s'", nameOrIP.c_str());
|
||||
LoginDatabase.PExecute("INSERT INTO ip_banned VALUES ('%s',UNIX_TIMESTAMP(),UNIX_TIMESTAMP()+%u,'%s','%s')", nameOrIP.c_str(), duration_secs, safe_author.c_str(), reason.c_str());
|
||||
break;
|
||||
case BAN_ACCOUNT:
|
||||
//No SQL injection as string is escaped
|
||||
// No SQL injection as string is escaped
|
||||
resultAccounts = LoginDatabase.PQuery("SELECT id FROM account WHERE username = '%s'", nameOrIP.c_str());
|
||||
break;
|
||||
case BAN_CHARACTER:
|
||||
//No SQL injection as string is escaped
|
||||
// No SQL injection as string is escaped
|
||||
resultAccounts = CharacterDatabase.PQuery("SELECT account FROM characters WHERE name = '%s'", nameOrIP.c_str());
|
||||
break;
|
||||
default:
|
||||
|
|
@ -1771,7 +1771,7 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, uint32 duration_
|
|||
if (mode == BAN_IP)
|
||||
return BAN_SUCCESS; // ip correctly banned but nobody affected (yet)
|
||||
else
|
||||
return BAN_NOTFOUND; // Nobody to ban
|
||||
return BAN_NOTFOUND; // Nobody to ban
|
||||
}
|
||||
|
||||
///- Disconnect all affected players (for IP it can be several)
|
||||
|
|
@ -1782,7 +1782,7 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, uint32 duration_
|
|||
|
||||
if (mode != BAN_IP)
|
||||
{
|
||||
//No SQL injection as strings are escaped
|
||||
// No SQL injection as strings are escaped
|
||||
LoginDatabase.PExecute("INSERT INTO account_banned VALUES ('%u', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+%u, '%s', '%s', '1')",
|
||||
account, duration_secs, safe_author.c_str(), reason.c_str());
|
||||
}
|
||||
|
|
@ -1816,7 +1816,7 @@ bool World::RemoveBanAccount(BanMode mode, std::string nameOrIP)
|
|||
if (!account)
|
||||
return false;
|
||||
|
||||
//NO SQL injection as account is uint32
|
||||
// NO SQL injection as account is uint32
|
||||
LoginDatabase.PExecute("UPDATE account_banned SET active = '0' WHERE id = '%u'", account);
|
||||
}
|
||||
return true;
|
||||
|
|
@ -1867,7 +1867,7 @@ void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode)
|
|||
if (!(options & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount() == 0)
|
||||
m_stopEvent = true; // exist code already set
|
||||
else
|
||||
m_ShutdownTimer = 1; //So that the session count is re-evaluated at next world tick
|
||||
m_ShutdownTimer = 1; // So that the session count is re-evaluated at next world tick
|
||||
}
|
||||
///- Else set the shutdown timer and warn users
|
||||
else
|
||||
|
|
@ -1983,7 +1983,7 @@ void World::InitResultQueue()
|
|||
|
||||
void World::UpdateResultQueue()
|
||||
{
|
||||
//process async result queues
|
||||
// process async result queues
|
||||
CharacterDatabase.ProcessResultQueue();
|
||||
WorldDatabase.ProcessResultQueue();
|
||||
LoginDatabase.ProcessResultQueue();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue