citra-emu
/
citra
Archived
1
0
Fork 0

web_service: Change endpoint to `/lobby`.

Preparation for shipping.
This commit is contained in:
zhupengfei 2018-12-16 10:48:15 +08:00
parent 13ec2abbf6
commit 4574bd1e5c
No known key found for this signature in database
GPG Key ID: DD129E108BD09378
1 changed files with 4 additions and 4 deletions

View File

@ -114,12 +114,12 @@ Common::WebResult RoomJson::Update() {
return Common::WebResult{Common::WebResult::Code::LibError, "Room is not registered"}; return Common::WebResult{Common::WebResult::Code::LibError, "Room is not registered"};
} }
nlohmann::json json{{"players", room.members}}; nlohmann::json json{{"players", room.members}};
return client.PostJson(fmt::format("/lobby2/{}", room_id), json.dump(), false); return client.PostJson(fmt::format("/lobby/{}", room_id), json.dump(), false);
} }
std::string RoomJson::Register() { std::string RoomJson::Register() {
nlohmann::json json = room; nlohmann::json json = room;
auto reply = client.PostJson("/lobby2", json.dump(), false).returned_data; auto reply = client.PostJson("/lobby", json.dump(), false).returned_data;
if (reply.empty()) { if (reply.empty()) {
return ""; return "";
} }
@ -134,7 +134,7 @@ void RoomJson::ClearPlayers() {
} }
AnnounceMultiplayerRoom::RoomList RoomJson::GetRoomList() { AnnounceMultiplayerRoom::RoomList RoomJson::GetRoomList() {
auto reply = client.GetJson("/lobby2", true).returned_data; auto reply = client.GetJson("/lobby", true).returned_data;
if (reply.empty()) { if (reply.empty()) {
return {}; return {};
} }
@ -149,7 +149,7 @@ void RoomJson::Delete() {
Common::DetachedTasks::AddTask( Common::DetachedTasks::AddTask(
[host{this->host}, username{this->username}, token{this->token}, room_id{this->room_id}]() { [host{this->host}, username{this->username}, token{this->token}, room_id{this->room_id}]() {
// create a new client here because the this->client might be destroyed. // create a new client here because the this->client might be destroyed.
Client{host, username, token}.DeleteJson(fmt::format("/lobby2/{}", room_id), "", false); Client{host, username, token}.DeleteJson(fmt::format("/lobby/{}", room_id), "", false);
}); });
} }