forked from opentibia-xx/otserv
/
definitions.h
141 lines (120 loc) · 3.32 KB
/
definitions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
//////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
//////////////////////////////////////////////////////////////////////
// various definitions needed by most files
//////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//////////////////////////////////////////////////////////////////////
#ifndef __OTSERV_DEFINITIONS_H__
#define __OTSERV_DEFINITIONS_H__
#define OTSERV_VERSION "0.6.3_SVN"
#define OTSERV_NAME "OTServ"
#define OTSERV_CLIENT_VERSION "8.61"
#define CURRENT_SCHEMA_VERSION 24
#ifdef __USE_SQLITE__
#define SINGLE_SQL_DRIVER
#endif
//This is an code fully tested and shouldn't cause weird errors but marked it under flag for easier removing.
#ifndef __GLOBALEVENTS__
#define __GLOBALEVENTS__
#endif
#ifdef __USE_MYSQL__
#ifdef SINGLE_SQL_DRIVER
#define MULTI_SQL_DRIVERS
#else
#define SINGLE_SQL_DRIVER
#endif
#endif
#ifdef __USE_ODBC__
#ifdef SINGLE_SQL_DRIVER
#define MULTI_SQL_DRIVERS
#else
#define SINGLE_SQL_DRIVER
#endif
#endif
#ifdef __USE_PGSQL__
#ifdef SINGLE_SQL_DRIVER
#define MULTI_SQL_DRIVERS
#else
#define SINGLE_SQL_DRIVER
#endif
#endif
//Default sql driver
#if !defined(SINGLE_SQL_DRIVER) && !defined(MULTI_SQL_DRIVERS)
#define __USE_SQLITE__
#define SINGLE_SQL_DRIVER
#endif
enum passwordType_t{
PASSWORD_TYPE_PLAIN = 0,
PASSWORD_TYPE_MD5,
PASSWORD_TYPE_SHA1
};
// Boost won't complain about non-working function
#define BOOST_ASIO_ENABLE_CANCELIO 1
#ifndef __FUNCTION__
#define __FUNCTION__ __func__
#endif
#define xmake_str(str) #str
#define make_str(str) xmake_str(str)
/*
Compiler setup
*/
#if defined __GNUC__
#include "compiler/gcc.h"
#elif defined(_MSC_VER)
#include "compiler/msvc.h"
#endif
/*
If the compiler supports the upcoming standard,
call some of the useful headers.
*/
#ifdef __OTSERV_CXX0X__
#include <cstdint>
#include <unordered_map>
#include <unordered_set>
#else
#include "compiler/workarounds.h"
#endif
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
//Windows 2000 0x0500
//Windows Xp 0x0501
//Windows 2003 0x0502
//Windows Vista 0x0600
//Windows Seven 0x0601
#define _WIN32_WINNT 0x0501
#define __MIN_PVP_LEVEL_APPLIES_TO_SUMMONS__
// OpenTibia configuration
#if !defined(__NO_SKULLSYSTEM__) && !defined(__SKULLSYSTEM__)
#define __SKULLSYSTEM__
#endif
// Boost exception handling must be enabled
#ifdef BOOST_NO_EXCEPTIONS
#error "Boost exception handling must be enabled."
#endif
//Enable multi-byte character set under MSVC
#ifdef _MSC_VER
#ifndef _MBCS
#define _MBCS
#endif
#ifdef _UNICODE
#undef _UNICODE
#endif
#ifdef UNICODE
#undef UNICODE
#endif
#endif
#endif