Skip to content

Commit 93e9d47

Browse files
authored
Apply format (#182)
* Update private for new native ws * Apply format
1 parent de97d0a commit 93e9d47

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3987
-4584
lines changed

core/common/BaseClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#include <nakama-cpp/log/NLogger.h>
2222
#include <nakama-cpp/realtime/NWebsocketsFactory.h>
2323

24-
#include <optional>
2524
#include <future>
25+
#include <optional>
2626
#include <vector>
2727

2828
namespace Nakama {

core/common/BaseClient.h

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,17 @@ class BaseClient : public NClientInterface {
7777
bool create,
7878
const NStringMap& vars) override;
7979

80-
std::future<NSessionPtr> authenticateAppleAsync(
81-
const std::string& token,
82-
const std::string& username,
83-
bool create,
84-
const NStringMap& vars) override;
80+
std::future<NSessionPtr>
81+
authenticateAppleAsync(const std::string& token, const std::string& username, bool create, const NStringMap& vars)
82+
override;
8583

86-
std::future<NSessionPtr> authenticateCustomAsync(
87-
const std::string& id,
88-
const std::string& username,
89-
bool create,
90-
const NStringMap& vars) override;
84+
std::future<NSessionPtr>
85+
authenticateCustomAsync(const std::string& id, const std::string& username, bool create, const NStringMap& vars)
86+
override;
9187

92-
std::future<NSessionPtr> authenticateSteamAsync(
93-
const std::string& token,
94-
const std::string& username,
95-
bool create,
96-
const NStringMap& vars) override;
88+
std::future<NSessionPtr>
89+
authenticateSteamAsync(const std::string& token, const std::string& username, bool create, const NStringMap& vars)
90+
override;
9791

9892
std::future<NSessionPtr> authenticateRefreshAsync(NSessionPtr session, const NStringMap& vars) override;
9993

@@ -149,10 +143,8 @@ class BaseClient : public NClientInterface {
149143

150144
std::future<void> unlinkCustomAsync(NSessionPtr session, const std::string& id) override;
151145

152-
std::future<void> importFacebookFriendsAsync(
153-
NSessionPtr session,
154-
const std::string& token,
155-
const std::optional<bool>& reset) override;
146+
std::future<void>
147+
importFacebookFriendsAsync(NSessionPtr session, const std::string& token, const std::optional<bool>& reset) override;
156148

157149
std::future<NAccount> getAccountAsync(NSessionPtr session) override;
158150

@@ -225,8 +217,7 @@ class BaseClient : public NClientInterface {
225217
std::future<void> leaveGroupAsync(NSessionPtr session, const std::string& groupId) override;
226218

227219
std::future<NGroupListPtr>
228-
listGroupsAsync(NSessionPtr session, const std::string& name, int32_t limit, const std::string& cursor)
229-
override;
220+
listGroupsAsync(NSessionPtr session, const std::string& name, int32_t limit, const std::string& cursor) override;
230221

231222
std::future<NUserGroupListPtr> listUserGroupsAsync(
232223
NSessionPtr session,
@@ -355,15 +346,11 @@ class BaseClient : public NClientInterface {
355346
std::future<void>
356347
deleteStorageObjectsAsync(NSessionPtr session, const std::vector<NDeleteStorageObjectId>& objectIds) override;
357348

358-
std::future<NRpc> rpcAsync(
359-
NSessionPtr session,
360-
const std::string& id,
361-
const std::optional<std::string>& payload) override;
349+
std::future<NRpc>
350+
rpcAsync(NSessionPtr session, const std::string& id, const std::optional<std::string>& payload) override;
362351

363-
std::future<NRpc> rpcAsync(
364-
const std::string& http_key,
365-
const std::string& id,
366-
const std::optional<std::string>& payload) override;
352+
std::future<NRpc>
353+
rpcAsync(const std::string& http_key, const std::string& id, const std::optional<std::string>& payload) override;
367354

368355
protected:
369356
int _port = -1;

core/common/StrUtil.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
#include "StrUtil.h"
1818
#include <google/protobuf/stubs/strutil.h>
1919

20-
#include <sstream>
21-
#include <regex>
2220
#include <optional>
21+
#include <regex>
22+
#include <sstream>
2323

2424
namespace Nakama {
2525

core/core-rest/RestClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
#include <rapidjson/stringbuffer.h>
2828
#include <rapidjson/writer.h>
2929

30+
#include <functional>
3031
#include <optional>
3132
#include <string>
3233
#include <vector>
33-
#include <functional>
3434

3535
#undef NMODULE_NAME
3636
#define NMODULE_NAME "Nakama::RestClient"

core/core-rest/RestClient.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
#include "../common/BaseClient.h"
2020
#include <google/protobuf/message.h>
21-
#include <set>
2221
#include <optional>
23-
#include <vector>
22+
#include <set>
2423
#include <string>
24+
#include <vector>
2525

2626
namespace Nakama {
2727

core/core-rt/NRtClientProtocolInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
#pragma once
1818

19-
#include <google/protobuf/message.h>
2019
#include "nakama-cpp/NTypes.h"
20+
#include <google/protobuf/message.h>
2121

2222
namespace Nakama {
2323

core/src/log/NConsoleLogSink.cpp

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,64 +14,67 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include <nakama-cpp/log/NConsoleLogSink.h>
1817
#include <iostream>
18+
#include <nakama-cpp/log/NConsoleLogSink.h>
1919
#ifdef __ANDROID__
2020
#include <android/log.h>
2121
#endif
2222

2323
#ifdef WIN32
24-
#include <Windows.h>
24+
#include <Windows.h>
2525
#endif
2626

2727
namespace Nakama {
2828

29-
using namespace std;
29+
using namespace std;
3030

3131
#ifdef __ANDROID__
32-
static android_LogPriority androidLogPrio(NLogLevel level) {
33-
switch (level) {
34-
case NLogLevel::Fatal: return ANDROID_LOG_FATAL;
35-
case NLogLevel::Error: return ANDROID_LOG_ERROR;
36-
case NLogLevel::Warn: return ANDROID_LOG_WARN;
37-
case NLogLevel::Info: return ANDROID_LOG_INFO;
38-
case NLogLevel::Debug: return ANDROID_LOG_DEBUG;
39-
default: return ANDROID_LOG_UNKNOWN;
40-
}
41-
}
32+
static android_LogPriority androidLogPrio(NLogLevel level) {
33+
switch (level) {
34+
case NLogLevel::Fatal:
35+
return ANDROID_LOG_FATAL;
36+
case NLogLevel::Error:
37+
return ANDROID_LOG_ERROR;
38+
case NLogLevel::Warn:
39+
return ANDROID_LOG_WARN;
40+
case NLogLevel::Info:
41+
return ANDROID_LOG_INFO;
42+
case NLogLevel::Debug:
43+
return ANDROID_LOG_DEBUG;
44+
default:
45+
return ANDROID_LOG_UNKNOWN;
46+
}
47+
}
4248
#endif
4349

44-
void NConsoleLogSink::log(NLogLevel level, const std::string& message, const char* func)
45-
{
46-
std::string tmp;
50+
void NConsoleLogSink::log(NLogLevel level, const std::string& message, const char* func) {
51+
std::string tmp;
4752

48-
if (func && func[0])
49-
{
50-
tmp.append("[").append(func).append("] ");
51-
}
53+
if (func && func[0]) {
54+
tmp.append("[").append(func).append("] ");
55+
}
5256

53-
tmp.append(message).append("\n");
57+
tmp.append(message).append("\n");
5458

5559
#ifdef __ANDROID__
56-
__android_log_print(androidLogPrio(level), "nakama", "%s", message.c_str());
60+
__android_log_print(androidLogPrio(level), "nakama", "%s", message.c_str());
5761
#else
58-
// write to console
59-
std::ostream& os = (level >= NLogLevel::Error) ? std::cerr : std::cout;
60-
os << tmp;
62+
// write to console
63+
std::ostream& os = (level >= NLogLevel::Error) ? std::cerr : std::cout;
64+
os << tmp;
6165
#endif
6266

6367
#ifdef WIN32
64-
// write debug string so Visual Studio and DebugView will catch it
65-
OutputDebugStringA(tmp.c_str());
68+
// write debug string so Visual Studio and DebugView will catch it
69+
OutputDebugStringA(tmp.c_str());
6670
#endif
67-
}
71+
}
6872

69-
void NConsoleLogSink::flush()
70-
{
73+
void NConsoleLogSink::flush() {
7174
#if !defined(__ANDROID__)
72-
std::cout.flush();
73-
std::cerr.flush();
75+
std::cout.flush();
76+
std::cerr.flush();
7477
#endif
75-
}
76-
7778
}
79+
80+
} // namespace Nakama

0 commit comments

Comments
 (0)