31{
33
36
39 stmt->SetData(0, realmId);
41
42 if (!result)
43 {
44 LOG_WARN(
"autobroadcast",
">> Loaded 0 autobroadcasts definitions. DB table `autobroadcast` is empty for this realm!");
46 return;
47 }
48
50
51 if (_announceType < AnnounceType::World || _announceType > AnnounceType::Both)
52 {
53 LOG_ERROR(
"autobroadcast",
"AutobroadcastMgr::LoadAutobroadcasts: Config option AutoBroadcast.Center set to not allowed value {}. Set to default value 0", (
int8)
_announceType);
55 }
56
58
59 do
60 {
61 Field* fields = result->Fetch();
63
66
67 ++count;
68 } while (result->NextRow());
69
72}
#define LOG_INFO(filterType__,...)
Definition: Log.h:164
#define LOG_ERROR(filterType__,...)
Definition: Log.h:156
#define LOG_WARN(filterType__,...)
Definition: Log.h:160
#define sConfigMgr
Definition: Config.h:74
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:131
uint32 getMSTime()
Definition: Timer.h:103
std::int32_t int32
Definition: Define.h:103
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
std::int8_t int8
Definition: Define.h:105
@ CONFIG_AUTOBROADCAST_CENTER
Definition: IWorld.h:359
AnnounceType
Definition: AutobroadcastMgr.h:25
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: DatabaseEnvFwd.h:46
@ LOGIN_SEL_AUTOBROADCAST
Definition: LoginDatabase.h:99
DatabaseWorkerPool< LoginDatabaseConnection > LoginDatabase
Accessor to the realm/login database.
Definition: DatabaseEnv.cpp:22
#define sWorld
Definition: World.h:444
Definition: PreparedStatement.h:158
Class used to access individual fields of database query result.
Definition: Field.h:99
std::enable_if_t< std::is_arithmetic_v< T >, T > Get() const
Definition: Field.h:113
AutobroadcastsMap _autobroadcasts
Definition: AutobroadcastMgr.h:46
AnnounceType _announceType
Definition: AutobroadcastMgr.h:49
AutobroadcastsWeightMap _autobroadcastsWeights
Definition: AutobroadcastMgr.h:47