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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
|
diff -ruN pokerth-1.1.2-rc/src/core/common/avatarmanager.cpp pokerth-1.1.2-rc.new/src/core/common/avatarmanager.cpp
--- pokerth-1.1.2-rc/src/core/common/avatarmanager.cpp 2017-08-16 14:24:03.000000000 +0200
+++ pokerth-1.1.2-rc.new/src/core/common/avatarmanager.cpp 2024-08-23 21:01:07.000000000 +0200
@@ -87,20 +87,36 @@
path tmpDataPath(dataDir);
{
boost::mutex::scoped_lock lock(m_cacheDirMutex);
+#if BOOST_VERSION < 108500
m_cacheDir = tmpCachePath.directory_string();
+#else
+ m_cacheDir = tmpCachePath.string();
+#endif
}
{
boost::mutex::scoped_lock lock(m_avatarsMutex);
+#if BOOST_VERSION < 108500
tmpRet = InternalReadDirectory((tmpDataPath / "gfx/avatars/default/people/").directory_string(), m_avatars);
+#else
+ tmpRet = InternalReadDirectory((tmpDataPath / "gfx/avatars/default/people/").string(), m_avatars);
+#endif
retVal = retVal && tmpRet;
+#if BOOST_VERSION < 108500
tmpRet = InternalReadDirectory((tmpDataPath / "gfx/avatars/default/misc/").directory_string(), m_avatars);
+#else
+ tmpRet = InternalReadDirectory((tmpDataPath / "gfx/avatars/default/misc/").string(), m_avatars);
+#endif
retVal = retVal && tmpRet;
}
if (cacheDir.empty() || tmpCachePath.empty())
LOG_ERROR("Cache directory was not set!");
else {
boost::mutex::scoped_lock lock(m_cachedAvatarsMutex);
+#if BOOST_VERSION < 108500
tmpRet = InternalReadDirectory(tmpCachePath.directory_string(), m_cachedAvatars);
+#else
+ tmpRet = InternalReadDirectory(tmpCachePath.string(), m_cachedAvatars);
+#endif
retVal = retVal && tmpRet;
}
@@ -113,7 +129,11 @@
{
bool retVal = false;
path filePath(fileName);
+#if BOOST_VERSION < 108500
string tmpFileName(filePath.file_string());
+#else
+ string tmpFileName(filePath.string());
+#endif
if (!fileName.empty() && !tmpFileName.empty()) {
unsigned outFileSize = 0;
@@ -240,7 +260,11 @@
AvatarFileType fileType;
path filePath(fileName);
+#if BOOST_VERSION < 108500
string ext(extension(filePath));
+#else
+ string ext(filePath.extension().string());
+#endif
if (boost::algorithm::iequals(ext, ".png"))
fileType = AVATAR_FILE_TYPE_PNG;
else if (boost::algorithm::iequals(ext, ".jpg") || boost::algorithm::iequals(ext, ".jpeg"))
@@ -362,7 +386,11 @@
if (IsValidAvatarFileType(avatarFileType, data, size)) {
path tmpPath(cacheDir);
tmpPath /= (md5buf.ToString() + ext);
+#if BOOST_VERSION < 108500
string fileName(tmpPath.file_string());
+#else
+ string fileName(tmpPath.string());
+#endif
std::ofstream o(fileName.c_str(), ios_base::out | ios_base::binary | ios_base::trunc);
if (!o.fail()) {
o.write((const char *)data, size);
@@ -426,7 +454,11 @@
}
try {
path cachePath(cacheDir);
+#if BOOST_VERSION < 108500
cacheDir = cachePath.directory_string();
+#else
+ cacheDir = cachePath.string();
+#endif
// Never delete anything if we do not have a special cache dir set.
if (!cacheDir.empty()) {
boost::mutex::scoped_lock lock(m_cachedAvatarsMutex);
@@ -441,12 +473,20 @@
while (i != end) {
bool keepFile = false;
path filePath(i->second);
+#if BOOST_VERSION < 108500
string fileString(filePath.file_string());
+#else
+ string fileString(filePath.string());
+#endif
// Only consider files which are definitely in the cache dir.
if (fileString.size() > cacheDir.size() && fileString.substr(0, cacheDir.size()) == cacheDir) {
// Only consider files with MD5 as file name.
MD5Buf tmpBuf;
+#if BOOST_VERSION < 108500
if (exists(filePath) && tmpBuf.FromString(basename(filePath))) {
+#else
+ if (exists(filePath) && tmpBuf.FromString(filePath.stem().string())) {
+#endif
timeMap.insert(TimeAvatarMap::value_type(last_write_time(filePath), i->first));
keepFile = true;
}
@@ -520,10 +560,19 @@
directory_iterator end;
while (i != end) {
+#if BOOST_VERSION < 108500
if (is_regular(i->status())) {
string md5sum(basename(i->path()));
+#else
+ if (is_regular_file(i->status())) {
+ string md5sum(i->path().stem().string());
+#endif
MD5Buf md5buf;
+#if BOOST_VERSION < 108500
string fileName(i->path().file_string());
+#else
+ string fileName(i->path().string());
+#endif
if (md5buf.FromString(md5sum)) {
// Only consider files with md5sum as name.
avatars.insert(AvatarMap::value_type(md5buf, fileName));
diff -ruN pokerth-1.1.2-rc/src/core/common/loghelper_server.cpp pokerth-1.1.2-rc.new/src/core/common/loghelper_server.cpp
--- pokerth-1.1.2-rc/src/core/common/loghelper_server.cpp 2017-08-16 14:24:03.000000000 +0200
+++ pokerth-1.1.2-rc.new/src/core/common/loghelper_server.cpp 2024-08-23 21:01:07.000000000 +0200
@@ -59,7 +59,11 @@
path tmpLogFile(logDir);
tmpLogFile /= SERVER_MSG_LOG_FILE_NAME;
+#if BOOST_VERSION < 108500
g_logFile = tmpLogFile.directory_string();
+#else
+ g_logFile = tmpLogFile.string();
+#endif
g_logLevel = logLevel;
}
diff -ruN pokerth-1.1.2-rc/src/engine/log.cpp pokerth-1.1.2-rc.new/src/engine/log.cpp
--- pokerth-1.1.2-rc/src/engine/log.cpp 2017-08-16 14:24:03.000000000 +0200
+++ pokerth-1.1.2-rc.new/src/engine/log.cpp 2024-08-23 21:01:07.000000000 +0200
@@ -84,7 +84,11 @@
mySqliteLogFileName /= string("pokerth-log-") + curDateTime + ".pdb";
// open sqlite-db
+#if BOOST_VERSION < 108500
sqlite3_open(mySqliteLogFileName.directory_string().c_str(), &mySqliteLogDb);
+#else
+ sqlite3_open(mySqliteLogFileName.string().c_str(), &mySqliteLogDb);
+#endif
if( mySqliteLogDb != 0 ) {
int i;
diff -ruN pokerth-1.1.2-rc/src/engine/log.h pokerth-1.1.2-rc.new/src/engine/log.h
--- pokerth-1.1.2-rc/src/engine/log.h 2017-08-16 14:24:03.000000000 +0200
+++ pokerth-1.1.2-rc.new/src/engine/log.h 2024-08-23 21:01:07.000000000 +0200
@@ -73,7 +73,11 @@
std::string getMySqliteLogFileName()
{
+#if BOOST_VERSION < 108500
return mySqliteLogFileName.directory_string();
+#else
+ return mySqliteLogFileName.string();
+#endif
}
private:
diff -ruN pokerth-1.1.2-rc/src/net/common/clientstate.cpp pokerth-1.1.2-rc.new/src/net/common/clientstate.cpp
--- pokerth-1.1.2-rc/src/net/common/clientstate.cpp 2017-08-16 14:24:03.000000000 +0200
+++ pokerth-1.1.2-rc.new/src/net/common/clientstate.cpp 2024-08-23 21:01:07.000000000 +0200
@@ -211,7 +211,11 @@
} else {
// Download the server list.
boost::shared_ptr<DownloadHelper> downloader(new DownloadHelper);
+#if BOOST_VERSION < 108500
downloader->Init(client->GetContext().GetServerListUrl(), tmpServerListPath.directory_string());
+#else
+ downloader->Init(client->GetContext().GetServerListUrl(), tmpServerListPath.string());
+#endif
ClientStateDownloadingServerList::Instance().SetDownloadHelper(downloader);
client->SetState(ClientStateDownloadingServerList::Instance());
}
@@ -303,13 +307,24 @@
path zippedServerListPath(context.GetCacheDir());
zippedServerListPath /= context.GetServerListUrl().substr(context.GetServerListUrl().find_last_of('/') + 1);
path xmlServerListPath;
+#if BOOST_VERSION < 108500
if (extension(zippedServerListPath) == ".z") {
xmlServerListPath = change_extension(zippedServerListPath, "");
+#else
+ if (zippedServerListPath.extension().string() == ".z") {
+ xmlServerListPath = zippedServerListPath;
+ xmlServerListPath.replace_extension("");
+#endif
// Unzip the file using zlib.
try {
+#if BOOST_VERSION < 108500
std::ifstream inFile(zippedServerListPath.directory_string().c_str(), ios_base::in | ios_base::binary);
std::ofstream outFile(xmlServerListPath.directory_string().c_str(), ios_base::out | ios_base::trunc);
+#else
+ std::ifstream inFile(zippedServerListPath.string().c_str(), ios_base::in | ios_base::binary);
+ std::ofstream outFile(xmlServerListPath.string().c_str(), ios_base::out | ios_base::trunc);
+#endif
boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
in.push(boost::iostreams::zlib_decompressor());
in.push(inFile);
@@ -321,7 +336,11 @@
xmlServerListPath = zippedServerListPath;
// Parse the server address.
+#if BOOST_VERSION < 108500
TiXmlDocument doc(xmlServerListPath.directory_string());
+#else
+ TiXmlDocument doc(xmlServerListPath.string());
+#endif
if (doc.LoadFile()) {
client->ClearServerInfoMap();
diff -ruN pokerth-1.1.2-rc/src/net/common/clientthread.cpp pokerth-1.1.2-rc.new/src/net/common/clientthread.cpp
--- pokerth-1.1.2-rc/src/net/common/clientthread.cpp 2024-09-05 15:27:05.953626726 +0200
+++ pokerth-1.1.2-rc.new/src/net/common/clientthread.cpp 2024-08-23 21:01:07.000000000 +0200
@@ -977,7 +977,11 @@
size_t pos = serverListUrl.find_last_of('/');
if (!GetContext().GetCacheDir().empty() && !serverListUrl.empty() && pos != string::npos && ++pos < serverListUrl.length()) {
tmpServerListPath /= serverListUrl.substr(pos);
+#if BOOST_VERSION < 108500
fileName = tmpServerListPath.directory_string();
+#else
+ fileName = tmpServerListPath.string();
+#endif
}
return fileName;
}
@@ -993,6 +997,10 @@
newSock.reset(new boost::asio::ip::tcp::socket(*m_ioService, tcp::v6()));
else
newSock.reset(new boost::asio::ip::tcp::socket(*m_ioService, tcp::v4()));
+
+ // Deprecated non_blocking_io command
+ /*boost::asio::socket_base::non_blocking_io command(true);
+ newSock->io_control(command);*/
newSock->non_blocking(true);
newSock->set_option(tcp::no_delay(true));
newSock->set_option(boost::asio::socket_base::keep_alive(true));
diff -ruN pokerth-1.1.2-rc/src/net/common/downloaderthread.cpp pokerth-1.1.2-rc.new/src/net/common/downloaderthread.cpp
--- pokerth-1.1.2-rc/src/net/common/downloaderthread.cpp 2017-08-16 14:24:03.000000000 +0200
+++ pokerth-1.1.2-rc.new/src/net/common/downloaderthread.cpp 2024-08-23 21:01:07.000000000 +0200
@@ -96,7 +96,11 @@
// Previous download was finished.
if (m_curDownloadData) {
path filepath(m_curDownloadData->filename);
+#if BOOST_VERSION < 108500
std::ifstream instream(filepath.file_string().c_str(), ios_base::in | ios_base::binary);
+#else
+ std::ifstream instream(filepath.string().c_str(), ios_base::in | ios_base::binary);
+#endif
// Find out file size.
// Not fully portable, but works on win/linux/mac.
instream.seekg(0, ios_base::beg);
@@ -132,7 +136,11 @@
}
if (m_curDownloadData && !m_curDownloadData->filename.empty()) {
path filepath(m_curDownloadData->filename);
+#if BOOST_VERSION < 108500
m_downloadHelper->Init(m_curDownloadData->address, filepath.file_string());
+#else
+ m_downloadHelper->Init(m_curDownloadData->address, filepath.string());
+#endif
m_downloadInProgress = true;
}
}
diff -ruN pokerth-1.1.2-rc/src/net/common/serverlobbythread.cpp pokerth-1.1.2-rc.new/src/net/common/serverlobbythread.cpp
--- pokerth-1.1.2-rc/src/net/common/serverlobbythread.cpp 2017-08-16 14:24:03.000000000 +0200
+++ pokerth-1.1.2-rc.new/src/net/common/serverlobbythread.cpp 2024-09-05 15:40:49.913578395 +0200
@@ -275,7 +275,11 @@
boost::filesystem::path logPath(logDir);
if (!logDir.empty()) {
logPath /= SERVER_STATISTICS_FILE_NAME;
- m_statisticsFileName = logPath.directory_string();
+#if BOOST_VERSION < 108500
+ m_statisticsFileName = logPath.directory_string();
+#else
+ m_statisticsFileName = logPath.string();
+#endif
ReadStatisticsFile();
}
}
@@ -1261,7 +1265,11 @@
// Init finished - start session.
EstablishSession(session);
LOG_MSG("Client \"" << session->GetClientAddr() << "\" uploaded avatar \""
- << boost::filesystem::path(avatarFileName).file_string() << "\".");
+#if BOOST_VERSION < 108500
+ << boost::filesystem::path(avatarFileName).file_string() << "\".");
+#else
+ << boost::filesystem::path(avatarFileName).string() << "\".");
+#endif
} else
SessionError(session, ERR_NET_WRONG_AVATAR_SIZE);
}
diff -ruN pokerth-1.1.2-rc/src/net/common/uploaderthread.cpp pokerth-1.1.2-rc.new/src/net/common/uploaderthread.cpp
--- pokerth-1.1.2-rc/src/net/common/uploaderthread.cpp 2017-08-16 14:24:03.000000000 +0200
+++ pokerth-1.1.2-rc.new/src/net/common/uploaderthread.cpp 2024-08-23 21:01:07.000000000 +0200
@@ -94,7 +94,11 @@
url += filepath.filename().string();
#endif
}
+#if BOOST_VERSION < 108500
m_uploadHelper->Init(url, filepath.file_string(), data.user, data.pwd, data.filesize, data.httpPost);
+#else
+ m_uploadHelper->Init(url, filepath.string(), data.user, data.pwd, data.filesize, data.httpPost);
+#endif
m_uploadInProgress = true;
}
}
|