diff options
Diffstat (limited to 'src/web_service')
| -rw-r--r-- | src/web_service/announce_room_json.cpp | 8 | ||||
| -rw-r--r-- | src/web_service/announce_room_json.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/web_service/announce_room_json.cpp b/src/web_service/announce_room_json.cpp index 32249f28e..984a59f77 100644 --- a/src/web_service/announce_room_json.cpp +++ b/src/web_service/announce_room_json.cpp | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | namespace AnnounceMultiplayerRoom { | 12 | namespace AnnounceMultiplayerRoom { |
| 13 | 13 | ||
| 14 | void to_json(nlohmann::json& json, const Room::Member& member) { | 14 | static void to_json(nlohmann::json& json, const Room::Member& member) { |
| 15 | if (!member.username.empty()) { | 15 | if (!member.username.empty()) { |
| 16 | json["username"] = member.username; | 16 | json["username"] = member.username; |
| 17 | } | 17 | } |
| @@ -23,7 +23,7 @@ void to_json(nlohmann::json& json, const Room::Member& member) { | |||
| 23 | json["gameId"] = member.game_id; | 23 | json["gameId"] = member.game_id; |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | void from_json(const nlohmann::json& json, Room::Member& member) { | 26 | static void from_json(const nlohmann::json& json, Room::Member& member) { |
| 27 | member.nickname = json.at("nickname").get<std::string>(); | 27 | member.nickname = json.at("nickname").get<std::string>(); |
| 28 | member.game_name = json.at("gameName").get<std::string>(); | 28 | member.game_name = json.at("gameName").get<std::string>(); |
| 29 | member.game_id = json.at("gameId").get<u64>(); | 29 | member.game_id = json.at("gameId").get<u64>(); |
| @@ -36,7 +36,7 @@ void from_json(const nlohmann::json& json, Room::Member& member) { | |||
| 36 | } | 36 | } |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | void to_json(nlohmann::json& json, const Room& room) { | 39 | static void to_json(nlohmann::json& json, const Room& room) { |
| 40 | json["port"] = room.port; | 40 | json["port"] = room.port; |
| 41 | json["name"] = room.name; | 41 | json["name"] = room.name; |
| 42 | if (!room.description.empty()) { | 42 | if (!room.description.empty()) { |
| @@ -53,7 +53,7 @@ void to_json(nlohmann::json& json, const Room& room) { | |||
| 53 | } | 53 | } |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | void from_json(const nlohmann::json& json, Room& room) { | 56 | static void from_json(const nlohmann::json& json, Room& room) { |
| 57 | room.verify_UID = json.at("externalGuid").get<std::string>(); | 57 | room.verify_UID = json.at("externalGuid").get<std::string>(); |
| 58 | room.ip = json.at("address").get<std::string>(); | 58 | room.ip = json.at("address").get<std::string>(); |
| 59 | room.name = json.at("name").get<std::string>(); | 59 | room.name = json.at("name").get<std::string>(); |
diff --git a/src/web_service/announce_room_json.h b/src/web_service/announce_room_json.h index ac02af5b1..f65c93214 100644 --- a/src/web_service/announce_room_json.h +++ b/src/web_service/announce_room_json.h | |||
| @@ -17,8 +17,8 @@ namespace WebService { | |||
| 17 | */ | 17 | */ |
| 18 | class RoomJson : public AnnounceMultiplayerRoom::Backend { | 18 | class RoomJson : public AnnounceMultiplayerRoom::Backend { |
| 19 | public: | 19 | public: |
| 20 | RoomJson(const std::string& host, const std::string& username, const std::string& token) | 20 | RoomJson(const std::string& host_, const std::string& username_, const std::string& token_) |
| 21 | : client(host, username, token), host(host), username(username), token(token) {} | 21 | : client(host_, username_, token_), host(host_), username(username_), token(token_) {} |
| 22 | ~RoomJson() = default; | 22 | ~RoomJson() = default; |
| 23 | void SetRoomInformation(const std::string& name, const std::string& description, const u16 port, | 23 | void SetRoomInformation(const std::string& name, const std::string& description, const u16 port, |
| 24 | const u32 max_player, const u32 net_version, const bool has_password, | 24 | const u32 max_player, const u32 net_version, const bool has_password, |