Demonware stuff 2

This commit is contained in:
quaK 2022-09-21 02:57:39 +03:00
parent 01e2d305d7
commit bb9b64d2fb
3 changed files with 33 additions and 29 deletions

View File

@ -144,32 +144,30 @@ namespace demonware
}
};
// made up name
class bdFile final : public bdTaskResult
struct bdFileQueryResult final : public bdTaskResult
{
public:
uint64_t owner_id;
uint64_t user_id;
std::string platform;
std::string filename;
uint32_t unk;
std::string data;
uint32_t errorcode;
std::string filedata;
void serialize(byte_buffer* buffer) override
void serialize(byte_buffer* data) override
{
buffer->write_uint64(this->owner_id);
buffer->write_string(this->platform);
buffer->write_string(this->filename);
buffer->write_uint32(this->unk);
buffer->write_blob(this->data);
data->write_uint64(user_id);
data->write_string(platform);
data->write_string(filename);
data->write_uint32(errorcode);
data->write_blob(filedata);
}
void deserialize(byte_buffer* buffer) override
void deserialize(byte_buffer* data) override
{
buffer->read_uint64(&this->owner_id);
buffer->read_string(&this->platform);
buffer->read_string(&this->filename);
buffer->read_uint32(&this->unk);
buffer->read_blob(&this->data);
data->read_uint64(&user_id);
data->read_string(&platform);
data->read_string(&filename);
data->read_uint32(&errorcode);
data->read_blob(&filedata);
}
};

View File

@ -1,13 +1,17 @@
#include <std_include.hpp>
#include "../services.hpp"
#include "game/game.hpp"
#include <utils/io.hpp>
namespace demonware
{
bdMarketingComms::bdMarketingComms() : service(104, "bdMarketingComms")
{
this->register_task(1, &bdMarketingComms::getMessages);
this->register_task(4, &bdMarketingComms::reportFullMessagesViewed);
this->register_task(6, &bdMarketingComms::reportFullMessagesViewed);
this->register_task(6, &bdMarketingComms::unk6);
}
void bdMarketingComms::getMessages(service_server* server, byte_buffer* /*buffer*/) const
@ -24,10 +28,12 @@ namespace demonware
reply->send();
}
void bdMarketingComms::unk6(service_server* server, byte_buffer* /*buffer*/) const
void bdMarketingComms::unk6(service_server* server, byte_buffer* buffer) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
#ifdef DEBUG
utils::io::write_file("demonware/bdMarketingComms/unk6", buffer->get_buffer());
#endif
server->create_reply(this->task_id(), game::BD_NO_FILE)->send();
}
}

View File

@ -203,7 +203,7 @@ namespace demonware
std::string platform;
uint32_t numunk;
uint32_t numfiles;
uint64_t owner = 0;
uint64_t user_id = 0;
std::string game;
buffer->read_string(&platform);
@ -211,7 +211,7 @@ namespace demonware
for (uint32_t i = 0; i < numunk; i++)
{
buffer->read_uint64(&owner);
buffer->read_uint64(&user_id);
buffer->read_string(&game);
}
@ -234,12 +234,12 @@ namespace demonware
continue;
}
auto response = new bdFile;
response->owner_id = owner;
response->unk = 0;
auto response = new bdFileQueryResult;
response->user_id = user_id;
response->platform = platform;
response->filename = filename;
response->data = data;
response->errorcode = 0;
response->filedata = data;
reply->add(response);
++count;