TrinityCore
Loading...
Searching...
No Matches
RealmList.h
Go to the documentation of this file.
1
/*
2
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation; either version 2 of the License, or (at your
7
* option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef _REALMLIST_H
19
#define _REALMLIST_H
20
21
#include "
Define.h
"
22
#include "
Realm.h
"
23
#include <map>
24
25
namespace
boost
26
{
27
namespace
system
28
{
29
class
error_code;
30
}
31
}
32
34
class
TC_SHARED_API
RealmList
35
{
36
public
:
37
typedef
std::map<RealmHandle, Realm>
RealmMap
;
38
39
static
RealmList
*
Instance
();
40
41
~RealmList
();
42
43
void
Initialize(
Trinity::Asio::IoContext
& ioContext,
uint32
updateInterval);
44
void
Close
();
45
46
RealmMap
const
&
GetRealms
()
const
{
return
_realms; }
47
Realm
const
* GetRealm(
RealmHandle
const
&
id
)
const
;
48
49
private
:
50
RealmList
();
51
52
void
UpdateRealms(boost::system::error_code
const
& error);
53
void
UpdateRealm(
RealmHandle
const
&
id
,
uint32
build, std::string
const
& name,
54
boost::asio::ip::address&& address, boost::asio::ip::address&& localAddr, boost::asio::ip::address&& localSubmask,
55
uint16
port,
uint8
icon,
RealmFlags
flag,
uint8
timezone,
AccountTypes
allowedSecurityLevel,
float
population);
56
57
RealmMap
_realms
;
58
uint32
_updateInterval
;
59
std::unique_ptr<Trinity::Asio::DeadlineTimer>
_updateTimer
;
60
std::unique_ptr<Trinity::Asio::Resolver>
_resolver
;
61
};
62
63
#define sRealmList RealmList::Instance()
64
#endif
AccountTypes
AccountTypes
Definition
Common.h:39
Define.h
uint8
uint8_t uint8
Definition
Define.h:135
TC_SHARED_API
#define TC_SHARED_API
Definition
Define.h:108
uint16
uint16_t uint16
Definition
Define.h:134
uint32
uint32_t uint32
Definition
Define.h:133
GameObjectActions::Close
@ Close
HighGuid::Instance
@ Instance
Realm.h
RealmFlags
RealmFlags
Definition
Realm.h:27
RealmList
Storage object for the list of realms on the server.
Definition
RealmList.h:35
RealmList::_resolver
std::unique_ptr< Trinity::Asio::Resolver > _resolver
Definition
RealmList.h:60
RealmList::~RealmList
~RealmList()
RealmList::_realms
RealmMap _realms
Definition
RealmList.h:57
RealmList::RealmMap
std::map< RealmHandle, Realm > RealmMap
Definition
RealmList.h:37
RealmList::_updateInterval
uint32 _updateInterval
Definition
RealmList.h:58
RealmList::_updateTimer
std::unique_ptr< Trinity::Asio::DeadlineTimer > _updateTimer
Definition
RealmList.h:59
RealmList::GetRealms
RealmMap const & GetRealms() const
Definition
RealmList.h:46
Trinity::Asio::IoContext
Definition
IoContext.h:29
boost
Definition
AsioHacksFwd.h:27
RealmHandle
Definition
Realm.h:40
Realm
Definition
Realm.h:66
server
shared
Realm
RealmList.h
Generated on Sun May 10 2026 02:30:26 for TrinityCore by
1.9.8