dw cleanup

This commit is contained in:
quaK 2024-08-10 03:35:36 +03:00
parent 391fd831ab
commit e2a766b661
3 changed files with 5 additions and 21 deletions

View File

@ -508,7 +508,7 @@ namespace demonware
case 70005: // ZombieRareCardPack case 70005: // ZombieRareCardPack
return get_random_loot_ZombieRareCardPack(); return get_random_loot_ZombieRareCardPack();
default: default:
printf("[DW]: Missing LootCrate logic for %d, using CommonCrate\n", lootbox_id); printf("[DW]: Missing LootCrate logic for %d\n", lootbox_id);
return {}; return {};
} }
} }
@ -539,18 +539,6 @@ namespace demonware
field = value; field = value;
} }
template <typename T> void json_add(nlohmann::json& field, T value)
{
if (!field.is_null())
{
field = field.get<T>();
}
else
{
field = value;
}
}
template <typename T> T json_read(nlohmann::json& field) template <typename T> T json_read(nlohmann::json& field)
{ {
if (!field.is_null()) if (!field.is_null())

View File

@ -171,11 +171,6 @@ namespace demonware
this->objects_.emplace_back(std::move(object)); this->objects_.emplace_back(std::move(object));
} }
void set_error(uint32_t err)
{
this->error_ = err;
}
private: private:
uint8_t type_; uint8_t type_;
uint32_t error_; uint32_t error_;

View File

@ -51,6 +51,7 @@ namespace demonware
buffer->read_uint16(&numEvents); buffer->read_uint16(&numEvents);
buffer->read_int32(&rewardEventType); // none 0, json 1 buffer->read_int32(&rewardEventType); // none 0, json 1
assert(rewardEventType == 1);
assert(numEvents == 1); assert(numEvents == 1);
buffer->read_string(&json_buffer); buffer->read_string(&json_buffer);
@ -205,7 +206,7 @@ namespace demonware
send(json_reply); send(json_reply);
} }
else if (action == "StartMission") /*else if (action == "StartMission")
{ {
printf("%s\n", json_buffer.data()); printf("%s\n", json_buffer.data());
//const auto match_id = json["MatchId"].get<int>(); //const auto match_id = json["MatchId"].get<int>();
@ -227,10 +228,10 @@ namespace demonware
else if (action == "ResetMissions") else if (action == "ResetMissions")
{ {
printf("%s\n", json_buffer.data()); printf("%s\n", json_buffer.data());
} }*/
else else
{ {
printf("[DW]: unhandled reward action \"%s\"...\n", action.data()); //printf("[DW]: unhandled reward action \"%s\"...\n", action.data());
} }
server->create_reply(this->task_id(), BD_NO_ERROR).send(); server->create_reply(this->task_id(), BD_NO_ERROR).send();