mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
@@ -9,6 +9,17 @@
|
|||||||
|
|
||||||
#include "BindingMap.h"
|
#include "BindingMap.h"
|
||||||
|
|
||||||
|
#ifdef AZEROTHCORE
|
||||||
|
#include "BanManager.h"
|
||||||
|
enum BanMode
|
||||||
|
{
|
||||||
|
BAN_ACCOUNT = 1,
|
||||||
|
BAN_CHARACTER = 2,
|
||||||
|
BAN_IP = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* These functions can be used anywhere at any time, including at start-up.
|
* These functions can be used anywhere at any time, including at start-up.
|
||||||
*/
|
*/
|
||||||
@@ -1968,10 +1979,22 @@ namespace LuaGlobalFunctions
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef AZEROTHCORE
|
#ifndef AZEROTHCORE
|
||||||
eWorld->BanAccount((BanMode)banMode, nameOrIP, duration, reason, whoBanned);
|
eWorld->BanAccount((BanMode)banMode, nameOrIP, duration, reason, whoBanned);
|
||||||
#else
|
#else
|
||||||
eWorld->BanAccount((BanMode)banMode, nameOrIP, std::to_string(duration) + "s", reason, whoBanned);
|
switch (banMode)
|
||||||
|
{
|
||||||
|
case BAN_ACCOUNT:
|
||||||
|
sBan->BanAccount(nameOrIP, std::to_string(duration) + "s", reason, whoBanned);
|
||||||
|
break;
|
||||||
|
case BAN_CHARACTER:
|
||||||
|
sBan->BanAccountByPlayerName(nameOrIP, std::to_string(duration) + "s", reason, whoBanned);
|
||||||
|
break;
|
||||||
|
case BAN_IP:
|
||||||
|
sBan->BanIP(nameOrIP, std::to_string(duration) + "s", reason, whoBanned);
|
||||||
|
break;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user