Core: header cleanup, split realmlist, boost compatibility, cotire, remove stormlib/zlib and stormlib/bzip2 and instead use dep sources
This commit is contained in:
1 parent
7fff6c424f
commit
5ff847159c
1243 files changed
+29780
-36517
No files matched your search
@@ -22,14 +22,18 @@ Comment: All ban related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class ban_commandscript : public CommandScript
|
||||
{
|
||||
@@ -66,10 +70,10 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "ban", rbac::RBAC_PERM_COMMAND_BAN, true, NULL, "", banCommandTable },
|
||||
{ "baninfo", rbac::RBAC_PERM_COMMAND_BANINFO, true, NULL, "", baninfoCommandTable },
|
||||
{ "banlist", rbac::RBAC_PERM_COMMAND_BANLIST, true, NULL, "", banlistCommandTable },
|
||||
{ "unban", rbac::RBAC_PERM_COMMAND_UNBAN, true, NULL, "", unbanCommandTable },
|
||||
{ "ban", rbac::RBAC_PERM_COMMAND_BAN, true, nullptr, "", banCommandTable },
|
||||
{ "baninfo", rbac::RBAC_PERM_COMMAND_BANINFO, true, nullptr, "", baninfoCommandTable },
|
||||
{ "banlist", rbac::RBAC_PERM_COMMAND_BANLIST, true, nullptr, "", banlistCommandTable },
|
||||
{ "unban", rbac::RBAC_PERM_COMMAND_UNBAN, true, nullptr, "", unbanCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -90,11 +94,11 @@ public:
|
||||
|
||||
std::string name = nameStr;
|
||||
|
||||
char* durationStr = strtok(NULL, " ");
|
||||
char* durationStr = strtok(nullptr, " ");
|
||||
if (!durationStr || !atoi(durationStr))
|
||||
return false;
|
||||
|
||||
char* reasonStr = strtok(NULL, "");
|
||||
char* reasonStr = strtok(nullptr, "");
|
||||
if (!reasonStr)
|
||||
return false;
|
||||
|
||||
@@ -161,11 +165,11 @@ public:
|
||||
|
||||
std::string nameOrIP = cnameOrIP;
|
||||
|
||||
char* durationStr = strtok(NULL, " ");
|
||||
char* durationStr = strtok(nullptr, " ");
|
||||
if (!durationStr || !atoi(durationStr))
|
||||
return false;
|
||||
|
||||
char* reasonStr = strtok(NULL, "");
|
||||
char* reasonStr = strtok(nullptr, "");
|
||||
if (!reasonStr)
|
||||
return false;
|
||||
|
||||
@@ -281,7 +285,7 @@ public:
|
||||
|
||||
time_t unbanDate = time_t(fields[3].GetUInt32());
|
||||
bool active = false;
|
||||
if (fields[2].GetBool() && (fields[1].GetUInt64() == uint64(0) || unbanDate >= time(NULL)))
|
||||
if (fields[2].GetBool() && (fields[1].GetUInt64() == uint64(0) || unbanDate >= time(nullptr)))
|
||||
active = true;
|
||||
bool permanent = (fields[1].GetUInt64() == uint64(0));
|
||||
std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
|
||||
@@ -339,7 +343,7 @@ public:
|
||||
Field* fields = result->Fetch();
|
||||
time_t unbanDate = time_t(fields[3].GetUInt32());
|
||||
bool active = false;
|
||||
if (fields[2].GetUInt8() && (!fields[1].GetUInt32() || unbanDate >= time(NULL)))
|
||||
if (fields[2].GetUInt8() && (!fields[1].GetUInt32() || unbanDate >= time(nullptr)))
|
||||
active = true;
|
||||
bool permanent = (fields[1].GetUInt32() == uint32(0));
|
||||
std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt32(), true);
|
||||
@@ -385,7 +389,7 @@ public:
|
||||
|
||||
static bool HandleBanListAccountCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
PreparedStatement* stmt = NULL;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
|
||||
LoginDatabase.Execute(stmt);
|
||||
|
||||
Reference in new issue
Block a user