mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	fixup! fixup! Add a service to announce multiplayer rooms to web service; Add the abiltiy to receive a list of all announced rooms from web service
This commit is contained in:
		
							parent
							
								
									1485093fd9
								
							
						
					
					
						commit
						93742f17b3
					
				
					 6 changed files with 35 additions and 32 deletions
				
			
		|  | @ -23,7 +23,7 @@ void from_json(const nlohmann::json& json, Room::Member& member) { | |||
| } | ||||
| 
 | ||||
| void to_json(nlohmann::json& json, const Room& room) { | ||||
|     json["id"] = room.GUID; | ||||
|     json["id"] = room.UID; | ||||
|     json["port"] = room.port; | ||||
|     json["name"] = room.name; | ||||
|     json["preferredGameName"] = room.preferred_game; | ||||
|  | @ -58,12 +58,12 @@ void from_json(const nlohmann::json& json, Room& room) { | |||
| 
 | ||||
| namespace WebService { | ||||
| 
 | ||||
| void RoomJson::SetRoomInformation(const std::string& guid, const std::string& name, const u16 port, | ||||
| void RoomJson::SetRoomInformation(const std::string& uid, const std::string& name, const u16 port, | ||||
|                                   const u32 max_player, const u32 net_version, | ||||
|                                   const bool has_password, const std::string& preferred_game, | ||||
|                                   const u64 preferred_game_id) { | ||||
|     room.name = name; | ||||
|     room.GUID = guid; | ||||
|     room.UID = uid; | ||||
|     room.port = port; | ||||
|     room.max_player = max_player; | ||||
|     room.net_version = net_version; | ||||
|  | @ -105,7 +105,7 @@ std::future<AnnounceMultiplayerRoom::RoomList> RoomJson::GetRoomList(std::functi | |||
| 
 | ||||
| void RoomJson::Delete() { | ||||
|     nlohmann::json json; | ||||
|     json["id"] = room.GUID; | ||||
|     json["id"] = room.UID; | ||||
|     DeleteJson(endpoint_url, json.dump(), username, token); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -20,7 +20,7 @@ public: | |||
|     RoomJson(const std::string& endpoint_url, const std::string& username, const std::string& token) | ||||
|         : endpoint_url(endpoint_url), username(username), token(token) {} | ||||
|     ~RoomJson() = default; | ||||
|     void SetRoomInformation(const std::string& guid, const std::string& name, const u16 port, | ||||
|     void SetRoomInformation(const std::string& uid, const std::string& name, const u16 port, | ||||
|                             const u32 max_player, const u32 net_version, const bool has_password, | ||||
|                             const std::string& preferred_game, | ||||
|                             const u64 preferred_game_id) override; | ||||
|  |  | |||
|  | @ -81,9 +81,8 @@ void TelemetryJson::Complete() { | |||
|     SerializeSection(Telemetry::FieldType::UserConfig, "UserConfig"); | ||||
|     SerializeSection(Telemetry::FieldType::UserSystem, "UserSystem"); | ||||
| 
 | ||||
|     // Send the telemetry async but don't handle the errors since the were written to the log
 | ||||
|     static std::future<Common::WebResult> future = | ||||
|         PostJson(endpoint_url, TopSection().dump(), true, username, token); | ||||
|     // Send the telemetry async but don't handle the errors since they were written to the log
 | ||||
|     future = PostJson(endpoint_url, TopSection().dump(), true, username, token); | ||||
| } | ||||
| 
 | ||||
| } // namespace WebService
 | ||||
|  |  | |||
|  | @ -5,8 +5,10 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <array> | ||||
| #include <future> | ||||
| #include <string> | ||||
| #include <json.hpp> | ||||
| #include "common/announce_multiplayer_room.h" | ||||
| #include "common/telemetry.h" | ||||
| 
 | ||||
| namespace WebService { | ||||
|  | @ -54,6 +56,7 @@ private: | |||
|     std::string endpoint_url; | ||||
|     std::string username; | ||||
|     std::string token; | ||||
|     std::future<Common::WebResult> future; | ||||
| }; | ||||
| 
 | ||||
| } // namespace WebService
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue