@ -30,7 +30,7 @@ namespace demonware
|
||||
uint64_t file_id;
|
||||
uint32_t create_time;
|
||||
uint32_t modified_time;
|
||||
bool priv;
|
||||
bool visibility;
|
||||
uint64_t owner_id;
|
||||
std::string filename;
|
||||
uint32_t file_size;
|
||||
@ -41,7 +41,7 @@ namespace demonware
|
||||
buffer->write_uint64(this->file_id);
|
||||
buffer->write_uint32(this->create_time);
|
||||
buffer->write_uint32(this->modified_time);
|
||||
buffer->write_bool(this->priv);
|
||||
buffer->write_bool(this->visibility);
|
||||
buffer->write_uint64(this->owner_id);
|
||||
buffer->write_string(this->filename);
|
||||
}
|
||||
@ -52,7 +52,7 @@ namespace demonware
|
||||
buffer->read_uint64(&this->file_id);
|
||||
buffer->read_uint32(&this->create_time);
|
||||
buffer->read_uint32(&this->modified_time);
|
||||
buffer->read_bool(&this->priv);
|
||||
buffer->read_bool(&this->visibility);
|
||||
buffer->read_uint64(&this->owner_id);
|
||||
buffer->read_string(&this->filename);
|
||||
}
|
||||
|
@ -10,19 +10,35 @@ namespace demonware
|
||||
this->register_service(4, &bdGroup::get_groups);
|
||||
}
|
||||
|
||||
void bdGroup::set_groups(i_server* server, byte_buffer* /*buffer*/) const
|
||||
void bdGroup::set_groups(i_server* server, byte_buffer* buffer)
|
||||
{
|
||||
//uint32_t groupCount;
|
||||
// TODO: Implement array reading
|
||||
uint32_t entries_count{};
|
||||
buffer->read_array_header(game::BD_BB_UNSIGNED_INTEGER32_TYPE, &entries_count);
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
|
||||
buffer->set_use_data_types(false);
|
||||
|
||||
for (uint32_t i = 0; i < entries_count; ++i)
|
||||
{
|
||||
uint32_t group_id{};
|
||||
buffer->read_uint32(&group_id);
|
||||
|
||||
if (group_id < ARRAYSIZE(this->groups))
|
||||
{
|
||||
this->groups[group_id] = 999;
|
||||
}
|
||||
}
|
||||
|
||||
buffer->set_use_data_types(true);
|
||||
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdGroup::get_groups(i_server* server, byte_buffer* buffer)
|
||||
{
|
||||
uint32_t group_count;
|
||||
buffer->read_array_header(8, &group_count);
|
||||
buffer->read_array_header(game::BD_BB_UNSIGNED_INTEGER32_TYPE, &group_count);
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
|
||||
|
@ -9,7 +9,7 @@ namespace demonware
|
||||
bdGroup();
|
||||
|
||||
private:
|
||||
void set_groups(i_server* server, byte_buffer* buffer) const;
|
||||
void set_groups(i_server* server, byte_buffer* buffer);
|
||||
void get_groups(i_server* server, byte_buffer* buffer);
|
||||
|
||||
uint32_t groups[512]{};
|
||||
|
@ -119,11 +119,11 @@ namespace demonware
|
||||
|
||||
void bdStorage::set_legacy_user_file(i_server* server, byte_buffer* buffer) const
|
||||
{
|
||||
bool priv;
|
||||
bool visibility;
|
||||
std::string filename, data;
|
||||
|
||||
buffer->read_string(&filename);
|
||||
buffer->read_bool(&priv);
|
||||
buffer->read_bool(&visibility);
|
||||
buffer->read_blob(&data);
|
||||
|
||||
const auto id = *reinterpret_cast<const uint64_t*>(utils::cryptography::sha1::compute(filename).data());
|
||||
@ -139,11 +139,11 @@ namespace demonware
|
||||
|
||||
info->file_id = id;
|
||||
info->filename = filename;
|
||||
info->create_time = uint32_t(time(nullptr));
|
||||
info->create_time = static_cast<uint32_t>(std::time(nullptr));
|
||||
info->modified_time = info->create_time;
|
||||
info->file_size = uint32_t(data.size());
|
||||
info->file_size = static_cast<uint32_t>(data.size());
|
||||
info->owner_id = 0;
|
||||
info->priv = priv;
|
||||
info->visibility = visibility;
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->add(info);
|
||||
@ -170,11 +170,11 @@ namespace demonware
|
||||
|
||||
info->file_id = id;
|
||||
info->filename = "<>";
|
||||
info->create_time = uint32_t(time(nullptr));
|
||||
info->create_time = static_cast<uint32_t>(std::time(nullptr));
|
||||
info->modified_time = info->create_time;
|
||||
info->file_size = uint32_t(data.size());
|
||||
info->file_size = static_cast<uint32_t>(data.size());
|
||||
info->owner_id = 0;
|
||||
info->priv = false;
|
||||
info->visibility = false;
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->add(info);
|
||||
@ -207,12 +207,12 @@ namespace demonware
|
||||
|
||||
void bdStorage::list_legacy_user_files(i_server* server, byte_buffer* buffer) const
|
||||
{
|
||||
uint64_t unk;
|
||||
uint64_t owner;
|
||||
uint32_t date;
|
||||
uint16_t num_results, offset;
|
||||
std::string filename, data;
|
||||
|
||||
buffer->read_uint64(&unk);
|
||||
buffer->read_uint64(&owner);
|
||||
buffer->read_uint32(&date);
|
||||
buffer->read_uint16(&num_results);
|
||||
buffer->read_uint16(&offset);
|
||||
@ -229,9 +229,9 @@ namespace demonware
|
||||
info->filename = filename;
|
||||
info->create_time = 0;
|
||||
info->modified_time = info->create_time;
|
||||
info->file_size = uint32_t(data.size());
|
||||
info->owner_id = 0;
|
||||
info->priv = false;
|
||||
info->file_size = static_cast<uint32_t>(data.size());
|
||||
info->owner_id = owner;
|
||||
info->visibility = false;
|
||||
|
||||
reply->add(info);
|
||||
}
|
||||
@ -260,9 +260,9 @@ namespace demonware
|
||||
info->filename = filename;
|
||||
info->create_time = 0;
|
||||
info->modified_time = info->create_time;
|
||||
info->file_size = uint32_t(data.size());
|
||||
info->file_size = static_cast<uint32_t>(data.size());
|
||||
info->owner_id = 0;
|
||||
info->priv = false;
|
||||
info->visibility = false;
|
||||
|
||||
reply->add(info);
|
||||
}
|
||||
@ -312,13 +312,13 @@ namespace demonware
|
||||
|
||||
void bdStorage::set_user_file(i_server* server, byte_buffer* buffer) const
|
||||
{
|
||||
bool priv;
|
||||
bool visibility;
|
||||
uint64_t owner;
|
||||
std::string game, filename, data;
|
||||
|
||||
buffer->read_string(&game);
|
||||
buffer->read_string(&filename);
|
||||
buffer->read_bool(&priv);
|
||||
buffer->read_bool(&visibility);
|
||||
buffer->read_blob(&data);
|
||||
buffer->read_uint64(&owner);
|
||||
|
||||
@ -329,11 +329,11 @@ namespace demonware
|
||||
|
||||
info->file_id = *reinterpret_cast<const uint64_t*>(utils::cryptography::sha1::compute(filename).data());
|
||||
info->filename = filename;
|
||||
info->create_time = uint32_t(time(nullptr));
|
||||
info->create_time = static_cast<uint32_t>(std::time(nullptr));
|
||||
info->modified_time = info->create_time;
|
||||
info->file_size = uint32_t(data.size());
|
||||
info->file_size = static_cast<uint32_t>(data.size());
|
||||
info->owner_id = owner;
|
||||
info->priv = priv;
|
||||
info->visibility = visibility;
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->add(info);
|
||||
|
@ -641,6 +641,33 @@ namespace game
|
||||
BD_MAX_ERROR_CODE = 0x27E2,
|
||||
};
|
||||
|
||||
enum bdBitBufferDataType
|
||||
{
|
||||
BD_BB_NO_TYPE = 0x0,
|
||||
BD_BB_BOOL_TYPE = 0x1,
|
||||
BD_BB_SIGNED_CHAR8_TYPE = 0x2,
|
||||
BD_BB_UNSIGNED_CHAR8_TYPE = 0x3,
|
||||
BD_BB_WCHAR16_TYPE = 0x4,
|
||||
BD_BB_SIGNED_INTEGER16_TYPE = 0x5,
|
||||
BD_BB_UNSIGNED_INTEGER16_TYPE = 0x6,
|
||||
BD_BB_SIGNED_INTEGER32_TYPE = 0x7,
|
||||
BD_BB_UNSIGNED_INTEGER32_TYPE = 0x8,
|
||||
BD_BB_SIGNED_INTEGER64_TYPE = 0x9,
|
||||
BD_BB_UNSIGNED_INTEGER64_TYPE = 0xA,
|
||||
BD_BB_RANGED_SIGNED_INTEGER32_TYPE = 0xB,
|
||||
BD_BB_RANGED_UNSIGNED_INTEGER32_TYPE = 0xC,
|
||||
BD_BB_FLOAT32_TYPE = 0xD,
|
||||
BD_BB_FLOAT64_TYPE = 0xE,
|
||||
BD_BB_RANGED_FLOAT32_TYPE = 0xF,
|
||||
BD_BB_SIGNED_CHAR8_STRING_TYPE = 0x10,
|
||||
BD_BB_UNSIGNED_CHAR8_STRING_TYPE = 0x11,
|
||||
BD_BB_MBSTRING_TYPE = 0x12,
|
||||
BD_BB_BLOB_TYPE = 0x13,
|
||||
BD_BB_NAN_TYPE = 0x14,
|
||||
BD_BB_FULL_TYPE = 0x15,
|
||||
BD_BB_MAX_TYPE = 0x20,
|
||||
};
|
||||
|
||||
enum bdNATType : uint8_t
|
||||
{
|
||||
BD_NAT_UNKNOWN = 0x0,
|
||||
|
@ -108,6 +108,7 @@ namespace game
|
||||
WEAK symbol<game_hudelem_s*(int clientNum, int teamNum)> HudElem_Alloc{0x0, 0x1403997E0};
|
||||
|
||||
WEAK symbol<char*(char* string)> I_CleanStr{0x140432460, 0x1404F63C0};
|
||||
WEAK symbol<void(char* dest, const char* src, int destsize)> I_strncpyz{0x140432810, 0x1404F67A0};
|
||||
|
||||
WEAK symbol<char*(GfxImage* image, uint32_t width, uint32_t height, uint32_t depth, uint32_t mipCount,
|
||||
uint32_t imageFlags, DXGI_FORMAT imageFormat, const char* name, const void* initData)>
|
||||
@ -243,6 +244,7 @@ namespace game
|
||||
|
||||
WEAK symbol<const char*(const char*)> UI_LocalizeMapname{0, 0x1404B96D0};
|
||||
WEAK symbol<const char*(const char*)> UI_LocalizeGametype{0, 0x1404B90F0};
|
||||
WEAK symbol<void(int localClientNum, const char* srcString, char* dstString, int dstBufferSize)> UI_ReplaceDirective{0x0, 0x1404D8A00};
|
||||
|
||||
WEAK symbol<DWOnlineStatus(int)> dwGetLogOnStatus{0, 0x140589490};
|
||||
|
||||
|
Reference in New Issue
Block a user