This repository has been archived by the owner on May 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMSConfig.h
51 lines (42 loc) · 1.86 KB
/
MSConfig.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
/*
This file is part of MasterServer.
MasterServer is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MasterServer 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with MasterServer. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MASTERSERVER_CONFIG_H
#define _MASTERSERVER_CONFIG_H
#include "ModuleManager.h"
#define MAX_INI_BUFFER 100
class CConfig
{
public:
inline static const char *GetDatabaseSocket() { return m_szDBSock; }
inline static const char *GetDefaultIP() { return m_szDBIP; }
inline static const char *GetDatabaseHost() { return m_szDBHost; }
inline static const char *GetDatabasePassword() { return m_szDBPass; }
inline static int GetDatabasePort() { return m_DBPort; }
inline static const char *GetDatabaseName() { return m_szDBName; }
inline static const char *GetDatabaseUsername() { return m_szDBUser; }
inline static bool IsDatabaseEnabled() { return m_bDBEnabled; }
inline static EDatabaseType GetDatabaseType() { return m_eDatabaseType; }
static bool Load(CModuleManager *mngr, const char *name);
private:
static int m_DBPort;
static char m_szDBHost[MAX_INI_BUFFER+1];
static char m_szDBUser[MAX_INI_BUFFER+1];
static char m_szDBPass[MAX_INI_BUFFER+1];
static char m_szDBSock[MAX_INI_BUFFER+1];
static char m_szDBName[MAX_INI_BUFFER+1];
static char m_szDBIP[MAX_INI_BUFFER+1];
static bool m_bDBEnabled;
static EDatabaseType m_eDatabaseType;
};
#endif