Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
Config.h
Go to the documentation of this file.
1//
2// Config.h
3//
4// Library: Foundation
5// Package: Core
6// Module: Foundation
7//
8// Feature configuration for the POCO libraries.
9//
10// Copyright (c) 2006-2016, Applied Informatics Software Engineering GmbH.
11// and Contributors.
12//
13// SPDX-License-Identifier: BSL-1.0
14//
15
16
17#ifndef Foundation_Config_INCLUDED
18#define Foundation_Config_INCLUDED
19
20
21// Define to disable implicit linking
22// #define POCO_NO_AUTOMATIC_LIBS
23
24
25// Define to disable automatic initialization
26// Defining this will disable ALL automatic
27// initialization framework-wide (e.g. Net
28// on Windows, all Data back-ends, etc).
29//
30// #define POCO_NO_AUTOMATIC_LIB_INIT
31
32
33// Define to disable FPEnvironment support
34// #define POCO_NO_FPENVIRONMENT
35
36
37// Define if std::wstring is not available
38// #define POCO_NO_WSTRING
39
40
41// Define to disable shared memory
42// #define POCO_NO_SHAREDMEMORY
43
44
45// Define if no <locale> header is available (such as on WinCE)
46// #define POCO_NO_LOCALE
47
48
49// Define to desired default thread stack size
50// Zero means OS default
51#ifndef POCO_THREAD_STACK_SIZE
52 #define POCO_THREAD_STACK_SIZE 0
53#endif
54
55
56// Define to override system-provided
57// minimum thread priority value on POSIX
58// platforms (returned by Poco::Thread::getMinOSPriority()).
59// #define POCO_THREAD_PRIORITY_MIN 0
60
61
62// Define to override system-provided
63// maximum thread priority value on POSIX
64// platforms (returned by Poco::Thread::getMaxOSPriority()).
65// #define POCO_THREAD_PRIORITY_MAX 31
66
67
68// Define to disable small object optimization. If not
69// defined, Any and Dynamic::Var (and similar optimization
70// candidates) will be auto-allocated on the stack in
71// cases when value holder fits into POCO_SMALL_OBJECT_SIZE
72// (see below).
73//
74// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
75// !!! NOTE: Any/Dynamic::Var SOO will NOT work reliably !!!
76// !!! without C++11 (std::aligned_storage in particular). !!!
77// !!! Only comment this out if your compiler has support !!!
78// !!! for std::aligned_storage. !!!
79// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
80//
81#ifndef POCO_ENABLE_SOO
82#define POCO_NO_SOO
83#endif
84
85
86// Small object size in bytes. When assigned to Any or Var,
87// objects larger than this value will be alocated on the heap,
88// while those smaller will be placement new-ed into an
89// internal buffer.
90#if !defined(POCO_SMALL_OBJECT_SIZE) && !defined(POCO_NO_SOO)
91 #define POCO_SMALL_OBJECT_SIZE 32
92#endif
93
94
95// Define to disable compilation of DirectoryWatcher
96// on platforms with no inotify.
97// #define POCO_NO_INOTIFY
98
99// Define to force the use of PollingDirectoryWatcher
100// #define POCO_DW_FORCE_POLLING
101
102
103// Following are options to remove certain features
104// to reduce library/executable size for smaller
105// embedded platforms. By enabling these options,
106// the size of a statically executable can be
107// reduced by a few 100 Kbytes.
108
109
110// No automatic registration of FileChannel in
111// LoggingFactory - avoids FileChannel and friends
112// being linked to executable.
113// #define POCO_NO_FILECHANNEL
114
115
116// No automatic registration of SplitterChannel in
117// LoggingFactory - avoids SplitterChannel being
118// linked to executable.
119// #define POCO_NO_SPLITTERCHANNEL
120
121
122// No automatic registration of SyslogChannel in
123// LoggingFactory - avoids SyslogChannel being
124// linked to executable on Unix/Linux systems.
125// #define POCO_NO_SYSLOGCHANNEL
126
127
128// Define to enable MSVC secure warnings
129// #define POCO_MSVC_SECURE_WARNINGS
130
131
132// No support for INI file configurations in
133// Poco::Util::Application.
134// #define POCO_UTIL_NO_INIFILECONFIGURATION
135
136
137// No support for JSON configuration in
138// Poco::Util::Application. Avoids linking of JSON
139// library and saves a few 100 Kbytes.
140// #define POCO_UTIL_NO_JSONCONFIGURATION
141
142
143// No support for XML configuration in
144// Poco::Util::Application. Avoids linking of XML
145// library and saves a few 100 Kbytes.
146// #define POCO_UTIL_NO_XMLCONFIGURATION
147
148
149// No IPv6 support
150// Define to disable IPv6
151// #define POCO_NET_NO_IPv6
152
153
154// Windows CE has no locale support
155#if defined(_WIN32_WCE)
156 #define POCO_NO_LOCALE
157#endif
158
159
160// Enable the poco_debug_* and poco_trace_* macros
161// even if the _DEBUG variable is not set.
162// This allows the use of these macros in a release version.
163// #define POCO_LOG_DEBUG
164
165
166// OpenSSL on Windows
167//
168// Poco has its own OpenSSL build system.
169// See <https://github.com/pocoproject/openssl/blob/master/README.md>
170// for details.
171//
172// These options are Windows only.
173//
174// To disable the use of Poco-provided OpenSSL binaries,
175// define POCO_EXTERNAL_OPENSSL.
176//
177// Possible values:
178// POCO_EXTERNAL_OPENSSL_SLPRO:
179// Automatically link OpenSSL libraries from OpenSSL Windows installer provided
180// by Shining Light Productions <http://slproweb.com/products/Win32OpenSSL.html>
181// The (global) library search path must be set accordingly.
182// POCO_EXTERNAL_OPENSSL_DEFAULT:
183// Automatically link OpenSSL libraries from standard OpenSSL Windows build.
184// The (global) library search path must be set accordingly.
185// empty or other value:
186// Do not link any OpenSSL libraries automatically. You will have to edit the
187// Visual C++ project files for Crypto and NetSSL_OpenSSL.
188#ifndef POCO_EXTERNAL_OPENSSL
189 #define POCO_EXTERNAL_OPENSSL POCO_EXTERNAL_OPENSSL_SLPRO
190#endif
191
192
193// Define to prevent changing the suffix for shared libraries
194// to "d.so", "d.dll", etc. for _DEBUG builds in Poco::SharedLibrary.
195// #define POCO_NO_SHARED_LIBRARY_DEBUG_SUFFIX
196
197
198// Disarm POCO_DEPRECATED macro.
199// #define POCO_NO_DEPRECATED
200
201
202#endif // Foundation_Config_INCLUDED
#define ARK_API
Definition Base.h:9
#define POCO_NO_SOO
Definition Config.h:82
#define POCO_DO_JOIN2(X, Y)
Definition Foundation.h:134
#define POCO_DO_JOIN(X, Y)
Definition Foundation.h:133
#define Net_API
Definition Net.h:47
#define NetSSL_API
Definition NetSSL.h:48
#define POCO_OS_ANDROID
Definition Platform.h:41
#define POCO_OS_QNX
Definition Platform.h:37
#define POCO_OS_LINUX
Definition Platform.h:31
#define POCO_OS_SOLARIS
Definition Platform.h:36
#define POCO_EXTERNAL_OPENSSL_SLPRO
Definition Crypto.h:24
virtual std::unique_ptr< ArkApi::ICommands > & GetCommands()=0
std::mutex RequestMutex_
Definition Requests.cpp:47
void WriteRequest(std::function< void(bool, std::string)> callback, bool success, std::string result)
Definition Requests.cpp:73
std::string GetResponse(Poco::Net::HTTPClientSession *session, Poco::Net::HTTPResponse &response)
Definition Requests.cpp:107
Poco::Net::HTTPRequest ConstructRequest(const std::string &url, Poco::Net::HTTPClientSession *&session, const std::vector< std::string > &headers, const std::string &request_type)
Definition Requests.cpp:79
std::vector< RequestData > RequestsVec_
Definition Requests.cpp:46
Requests(Requests &&)=delete
ARK_API bool CreateGetRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, std::vector< std::string > headers={})
Creates an async GET Request that runs in another thread but calls the callback from the main thread.
Definition Requests.cpp:129
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::vector< std::string > &post_ids, const std::vector< std::string > &post_data, std::vector< std::string > headers={})
Creates an async POST Request that runs in another thread but calls the callback from the main thread...
Definition Requests.cpp:238
Requests & operator=(Requests &&)=delete
ARK_API bool CreateDeleteRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, std::vector< std::string > headers={})
Creates an async DELETE Request that runs in another thread but calls the callback from the main thre...
Definition Requests.cpp:292
Requests & operator=(const Requests &)=delete
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::string &post_data, std::vector< std::string > headers={})
Creates an async POST Request with application/x-www-form-urlencoded content type that runs in anothe...
Definition Requests.cpp:162
static ARK_API Requests & Get()
Definition Requests.cpp:67
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::string &post_data, const std::string &content_type, std::vector< std::string > headers={})
Creates an async POST Request that runs in another thread but calls the callback from the main thread...
Definition Requests.cpp:200
std::unique_ptr< impl > pimpl
Definition Requests.h:84
Requests(const Requests &)=delete
virtual void AddOnTickCallback(const FString &id, const std::function< void(float)> &callback)=0
Added function will be called every frame.
virtual bool RemoveOnTickCallback(const FString &id)=0
Removes a on-tick callback.
Definition Logger.h:9
static std::shared_ptr< spdlog::logger > & GetLog()
Definition Logger.h:22
std::string displayText() const
Returns the exception code if defined.
virtual std::istream & receiveResponse(HTTPResponse &response)
virtual std::ostream & sendRequest(HTTPRequest &request)
Returns the connection timeout for HTTP connections.
static const std::string HTTP_1_1
void setContentLength(std::streamsize length)
Returns the HTTP version for this message.
HTTPRequest(const std::string &method, const std::string &uri, const std::string &version)
Creates a HTTP/1.0 request with the given method and URI.
static const std::string HTTP_GET
static const std::string HTTP_DELETE
static const std::string HTTP_POST
const std::string & getReason() const
Sets the HTTP reason phrase.
HTTPResponse(HTTPStatus status)
HTTPStatus getStatus() const
HTTPSClientSession(const std::string &host, Poco::UInt16 port, Context::Ptr pContext, Session::Ptr pSession)
std::string proxyRequestPrefix() const
Sends the given HTTPRequest over an existing connection.
HTTPSClientSession(Context::Ptr pContext, Session::Ptr pSession)
HTTPSClientSession(Context::Ptr pContext)
Creates a HTTPSClientSession using the given host and port.
void proxyAuthenticate(HTTPRequest &request)
Checks if we can reuse a persistent connection.
int read(char *buffer, std::streamsize length)
HTTPSClientSession(const HTTPSClientSession &)
void connect(const SocketAddress &address)
Refills the internal buffer.
HTTPSClientSession(const SecureStreamSocket &socket, Session::Ptr pSession)
X509Certificate serverCertificate()
HTTPSClientSession & operator=(const HTTPSClientSession &)
HTTPSClientSession(const std::string &host, Poco::UInt16 port=HTTPS_PORT)
HTTPSClientSession(const SecureStreamSocket &socket)
Creates an unconnected HTTPSClientSession.
HTTPSClientSession(const std::string &host, Poco::UInt16 port, Context::Ptr pContext)
RejectCertificateHandler(bool handleErrorsOnServerSide)
void initializeClient(PrivateKeyPassphraseHandlerPtr ptrPassphraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext)
static SSLManager & instance()
This stream discards all characters written to it.
Definition NullStream.h:77
static std::streamsize copyStream(std::istream &istr, std::ostream &ostr, std::size_t bufferSize=8192)
const std::string & getHost() const
Sets the user-info part of the URI.
Definition URI.h:385
const std::string & getScheme() const
Definition URI.h:373
URI(const std::string &uri)
Creates an empty URI.
unsigned short getPort() const
Sets the host part of the URI.
std::string getPathAndQuery() const
Returns the encoded path, query and fragment parts of the URI.
void error(const T &)
Definition IBaseApi.h:9
std::unique_ptr< IBaseApi > game_api
Definition IBaseApi.h:25
void NetSSL_API initializeSSL()
void Net_API uninitializeNetwork()
void Net_API initializeNetwork()
void NetSSL_API uninitializeSSL()
Definition format.h:408
Definition json.hpp:4518
std::function< void(bool, std::string)> callback
Definition Requests.cpp:41
static std::string escape(const std::string &s, bool strictJSON=false)