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 sConfigMgr
Definition: Config.h:92
std::int32_t int32
Definition: Define.h:104
std::uint8_t uint8
Definition: Define.h:110
std::uint32_t uint32
Definition: Define.h:108
std::int8_t int8
Definition: Define.h:106
#define LOG_INFO(filterType__,...)
Definition: Log.h:167
#define LOG_ERROR(filterType__,...)
Definition: Log.h:159
#define LOG_WARN(filterType__,...)
Definition: Log.h:163
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:131
uint32 getMSTime()
Definition: Timer.h:103
DatabaseWorkerPool< LoginDatabaseConnection > LoginDatabase
Accessor to the realm/login database.
Definition: DatabaseEnv.cpp:22
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: DatabaseEnvFwd.h:46
@ LOGIN_SEL_AUTOBROADCAST
Definition: LoginDatabase.h:98
AnnounceType
Definition: AutobroadcastMgr.h:25
@ CONFIG_AUTOBROADCAST_CENTER
Definition: IWorld.h:351
#define sWorld
Definition: World.h:451
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