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
28{
29 MINUTE = 60,
31 DAY = HOUR*24,
32 WEEK = DAY*7,
33 MONTH = DAY*30,
34 YEAR = DAY*365,
35 IN_MILLISECONDS = 1000
36};
37
39{
44 SEC_CONSOLE = 4 // must be always last in list, accounts must have less security level always also
45};
46
61
62#define DEFAULT_LOCALE LOCALE_enUS
63
64#define MAX_LOCALES 8
65#define MAX_ACCOUNT_TUTORIAL_VALUES 8
66
67TC_COMMON_API extern char const* localeNames[TOTAL_LOCALES];
68
69TC_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
Definition Common.h:48
@ LOCALE_zhCN
Definition Common.h:53
@ LOCALE_deDE
Definition Common.h:52
@ LOCALE_zhTW
Definition Common.h:54
@ LOCALE_esES
Definition Common.h:55
@ TOTAL_LOCALES
Definition Common.h:59
@ LOCALE_ruRU
Definition Common.h:57
@ LOCALE_frFR
Definition Common.h:51
@ LOCALE_enUS
Definition Common.h:49
@ LOCALE_koKR
Definition Common.h:50
@ LOCALE_esMX
Definition Common.h:56
TC_COMMON_API char const * localeNames[TOTAL_LOCALES]
Definition Common.cpp:20
TimeConstants
Definition Common.h:28
@ IN_MILLISECONDS
Definition Common.h:35
@ MINUTE
Definition Common.h:29
@ HOUR
Definition Common.h:30
@ DAY
Definition Common.h:31
@ MONTH
Definition Common.h:33
@ WEEK
Definition Common.h:32
@ YEAR
Definition Common.h:34
TC_COMMON_API LocaleConstant GetLocaleByName(std::string const &name)
Definition Common.cpp:33
AccountTypes
Definition Common.h:39
@ SEC_PLAYER
Definition Common.h:40
@ SEC_ADMINISTRATOR
Definition Common.h:43
@ SEC_GAMEMASTER
Definition Common.h:42
@ SEC_MODERATOR
Definition Common.h:41
@ SEC_CONSOLE
Definition Common.h:44
uint8_t uint8
Definition Define.h:135
#define TC_COMMON_API
Definition Define.h:96