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,13 +22,19 @@ Comment: All wp related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Creature.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Language.h"
|
||||
#include "Map.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "RBAC.h"
|
||||
#include "WaypointManager.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class wp_commandscript : public CommandScript
|
||||
{
|
||||
@@ -49,7 +55,7 @@ public:
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "wp", rbac::RBAC_PERM_COMMAND_WP, false, NULL, "", wpCommandTable },
|
||||
{ "wp", rbac::RBAC_PERM_COMMAND_WP, false, nullptr, "", wpCommandTable },
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
@@ -70,14 +76,14 @@ public:
|
||||
* -> adds a waypoint to the currently selected creature
|
||||
*
|
||||
*
|
||||
* @param args if the user did not provide a GUID, it is NULL
|
||||
* @param args if the user did not provide a GUID, it is nullptr
|
||||
*
|
||||
* @return true - command did succeed, false - something went wrong
|
||||
*/
|
||||
static bool HandleWpAddCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleWpAddCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
// optional
|
||||
char* path_number = NULL;
|
||||
char* path_number = nullptr;
|
||||
uint32 pathid = 0;
|
||||
|
||||
if (*args)
|
||||
@@ -137,13 +143,13 @@ public:
|
||||
return true;
|
||||
} // HandleWpAddCommand
|
||||
|
||||
static bool HandleWpLoadCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleWpLoadCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
// optional
|
||||
char* path_number = NULL;
|
||||
char* path_number = nullptr;
|
||||
|
||||
if (*args)
|
||||
path_number = strtok((char*)args, " ");
|
||||
@@ -218,7 +224,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWpReloadCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleWpReloadCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -233,11 +239,11 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWpUnLoadCommand(ChatHandler* handler, const char* /*args*/)
|
||||
static bool HandleWpUnLoadCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
PreparedStatement* stmt = NULL;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
|
||||
if (!target)
|
||||
{
|
||||
@@ -278,20 +284,20 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWpEventCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleWpEventCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
char* show_str = strtok((char*)args, " ");
|
||||
std::string show = show_str;
|
||||
PreparedStatement* stmt = NULL;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
|
||||
// Check
|
||||
if ((show != "add") && (show != "mod") && (show != "del") && (show != "listid"))
|
||||
return false;
|
||||
|
||||
char* arg_id = strtok(NULL, " ");
|
||||
char* arg_id = strtok(nullptr, " ");
|
||||
uint32 id = 0;
|
||||
|
||||
if (show == "add")
|
||||
@@ -420,7 +426,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
char* arg_2 = strtok(NULL, " ");
|
||||
char* arg_2 = strtok(nullptr, " ");
|
||||
|
||||
if (!arg_2)
|
||||
{
|
||||
@@ -440,7 +446,7 @@ public:
|
||||
|
||||
char* arg_3;
|
||||
std::string arg_str_2 = arg_2;
|
||||
arg_3 = strtok(NULL, " ");
|
||||
arg_3 = strtok(nullptr, " ");
|
||||
|
||||
if (!arg_3)
|
||||
{
|
||||
@@ -535,7 +541,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWpModifyCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleWpModifyCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -558,7 +564,7 @@ public:
|
||||
}
|
||||
|
||||
// Next arg is: <PATHID> <WPNUM> <ARGUMENT>
|
||||
char* arg_str = NULL;
|
||||
char* arg_str = nullptr;
|
||||
|
||||
// Did user provide a GUID
|
||||
// or did the user select a creature?
|
||||
@@ -566,7 +572,7 @@ public:
|
||||
uint32 pathid = 0;
|
||||
uint32 point = 0;
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
PreparedStatement* stmt = NULL;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
|
||||
// User did select a visual waypoint?
|
||||
if (!target || target->GetEntry() != VISUAL_WAYPOINT)
|
||||
@@ -617,10 +623,10 @@ public:
|
||||
|
||||
// We have the waypoint number and the GUID of the "master npc"
|
||||
// Text is enclosed in "<>", all other arguments not
|
||||
arg_str = strtok((char*)NULL, " ");
|
||||
arg_str = strtok((char*)nullptr, " ");
|
||||
|
||||
// Check for argument
|
||||
if (show != "del" && show != "move" && arg_str == NULL)
|
||||
if (show != "del" && show != "move" && arg_str == nullptr)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_ARGUMENTREQ, show_str);
|
||||
return false;
|
||||
@@ -697,7 +703,7 @@ public:
|
||||
if (text == 0)
|
||||
{
|
||||
// show_str check for present in list of correct values, no sql injection possible
|
||||
WorldDatabase.PExecute("UPDATE waypoint_data SET %s=NULL WHERE id='%u' AND point='%u'", show_str, pathid, point); // Query can't be a prepared statement
|
||||
WorldDatabase.PExecute("UPDATE waypoint_data SET %s=nullptr WHERE id='%u' AND point='%u'", show_str, pathid, point); // Query can't be a prepared statement
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -711,7 +717,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWpShowCommand(ChatHandler* handler, const char* args)
|
||||
static bool HandleWpShowCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -722,11 +728,11 @@ public:
|
||||
return false;
|
||||
|
||||
// second arg: GUID (optional, if a creature is selected)
|
||||
char* guid_str = strtok((char*)NULL, " ");
|
||||
char* guid_str = strtok((char*)nullptr, " ");
|
||||
|
||||
uint32 pathid = 0;
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
PreparedStatement* stmt = NULL;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
|
||||
// Did player provide a PathID?
|
||||
|
||||
|
||||
Reference in new issue
Block a user