Skip to content

Commit

Permalink
More logs!
Browse files Browse the repository at this point in the history
Added even more logs
  • Loading branch information
Curve committed Jun 20, 2020
1 parent 3373b59 commit 9c89b7c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Lobby.cpp
Original file line number Diff line number Diff line change
@@ -317,17 +317,17 @@ void Lobby::addDeck(std::string id)

futures.push_back(std::async([&](std::string id)
{
linfo("ID ", this->id, ": Adding Deck ", id);
linfo(this->id, ": Adding Deck ", id);
auto res = cpr::Get(
cpr::Url{ "https://cds:8020/deck/" + id + "/json" }
);
if (res.status_code == 200)
{
linfo(this->id, ": Deck ", id, " returned 200 OK!");
auto js = UnsafeJson::getUnsafeJson(res.text);
linfo("Deck ", id, " returned 200 OK!");
if (js.valid)
{
linfo("Deck ", id, " json is valid!");
linfo(this->id, ": Deck ", id, " json is valid!");
auto& j = js.json;

Deck deck;
@@ -338,11 +338,17 @@ void Lobby::addDeck(std::string id)
decks->push_back(deck);
sendGameUpdate();
}
else
{
lerror(this->id, ": Deck ", id, " json is invalid!");
}
}
else
{
lerror(this->id, ": Deck fetching failed: ", id, " fetch returned: ", res.status_code, " raw: ", res.text);
}

linfo(this->id, ": Deck fetching for ", id, " finished!");
}, id));
}

0 comments on commit 9c89b7c

Please sign in to comment.