TrinityCore
Loading...
Searching...
No Matches
Common.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 TRINITYCORE_COMMON_H
19
#define TRINITYCORE_COMMON_H
20
21
#include "
Define.h
"
22
#include <array>
23
#include <string>
24
25
#define STRINGIZE(a) #a
26
27
enum
TimeConstants
28
{
29
MINUTE
= 60,
30
HOUR
=
MINUTE
*60,
31
DAY
=
HOUR
*24,
32
WEEK
=
DAY
*7,
33
MONTH
=
DAY
*30,
34
YEAR
=
DAY
*365,
35
IN_MILLISECONDS
= 1000
36
};
37
38
enum
AccountTypes
39
{
40
SEC_PLAYER
= 0,
41
SEC_MODERATOR
= 1,
42
SEC_GAMEMASTER
= 2,
43
SEC_ADMINISTRATOR
= 3,
44
SEC_CONSOLE
= 4
// must be always last in list, accounts must have less security level always also
45
};
46
47
enum
LocaleConstant
:
uint8
48
{
49
LOCALE_enUS
= 0,
50
LOCALE_koKR
= 1,
51
LOCALE_frFR
= 2,
52
LOCALE_deDE
= 3,
53
LOCALE_zhCN
= 4,
54
LOCALE_zhTW
= 5,
55
LOCALE_esES
= 6,
56
LOCALE_esMX
= 7,
57
LOCALE_ruRU
= 8,
58
59
TOTAL_LOCALES
60
};
61
62
#define DEFAULT_LOCALE LOCALE_enUS
63
64
#define MAX_LOCALES 8
65
#define MAX_ACCOUNT_TUTORIAL_VALUES 8
66
67
TC_COMMON_API
extern
char
const
*
localeNames
[
TOTAL_LOCALES
];
68
69
TC_COMMON_API
LocaleConstant
GetLocaleByName
(std::string
const
& name);
70
71
#ifndef M_PI
72
#define M_PI 3.14159265358979323846
73
#endif
74
75
#ifndef M_PI_4
76
#define M_PI_4 0.785398163397448309616
77
#endif
78
79
#define MAX_QUERY_LEN 32*1024
80
81
#endif
LocaleConstant
LocaleConstant
Definition
Common.h:48
LOCALE_zhCN
@ LOCALE_zhCN
Definition
Common.h:53
LOCALE_deDE
@ LOCALE_deDE
Definition
Common.h:52
LOCALE_zhTW
@ LOCALE_zhTW
Definition
Common.h:54
LOCALE_esES
@ LOCALE_esES
Definition
Common.h:55
TOTAL_LOCALES
@ TOTAL_LOCALES
Definition
Common.h:59
LOCALE_ruRU
@ LOCALE_ruRU
Definition
Common.h:57
LOCALE_frFR
@ LOCALE_frFR
Definition
Common.h:51
LOCALE_enUS
@ LOCALE_enUS
Definition
Common.h:49
LOCALE_koKR
@ LOCALE_koKR
Definition
Common.h:50
LOCALE_esMX
@ LOCALE_esMX
Definition
Common.h:56
localeNames
TC_COMMON_API char const * localeNames[TOTAL_LOCALES]
Definition
Common.cpp:20
TimeConstants
TimeConstants
Definition
Common.h:28
IN_MILLISECONDS
@ IN_MILLISECONDS
Definition
Common.h:35
MINUTE
@ MINUTE
Definition
Common.h:29
HOUR
@ HOUR
Definition
Common.h:30
DAY
@ DAY
Definition
Common.h:31
MONTH
@ MONTH
Definition
Common.h:33
WEEK
@ WEEK
Definition
Common.h:32
YEAR
@ YEAR
Definition
Common.h:34
GetLocaleByName
TC_COMMON_API LocaleConstant GetLocaleByName(std::string const &name)
Definition
Common.cpp:33
AccountTypes
AccountTypes
Definition
Common.h:39
SEC_PLAYER
@ SEC_PLAYER
Definition
Common.h:40
SEC_ADMINISTRATOR
@ SEC_ADMINISTRATOR
Definition
Common.h:43
SEC_GAMEMASTER
@ SEC_GAMEMASTER
Definition
Common.h:42
SEC_MODERATOR
@ SEC_MODERATOR
Definition
Common.h:41
SEC_CONSOLE
@ SEC_CONSOLE
Definition
Common.h:44
Define.h
uint8
uint8_t uint8
Definition
Define.h:135
TC_COMMON_API
#define TC_COMMON_API
Definition
Define.h:96
common
Common.h
Generated on Sun May 10 2026 02:30:12 for TrinityCore by
1.9.8