Format code

This commit is contained in:
momo5502 2021-03-07 20:41:16 +01:00
parent d72d20c6be
commit f84204b065
64 changed files with 2661 additions and 2639 deletions

View File

@ -184,7 +184,8 @@ namespace exception
void write_minidump(const LPEXCEPTION_POINTERS exceptioninfo)
{
const std::string crash_name = utils::string::va("minidumps/s1x-crash-%d-%s.zip",
game::environment::get_real_mode(), get_timestamp().data());
game::environment::get_real_mode(),
get_timestamp().data());
utils::compression::zip::archive zip_file{};
zip_file.add("crash.dmp", create_minidump(exceptioninfo));

View File

@ -6,8 +6,6 @@
#include "command.hpp"
#include "game_console.hpp"
#include <utils/hook.hpp>
namespace stats
{
class component final : public component_interface
@ -29,11 +27,12 @@ namespace stats
}
// SL_FindString
auto lookupString = game::SL_FindString(params.get(1));
auto value = atoi(params.get(2));
const auto lookup_string = game::SL_FindString(params.get(1));
const auto value = atoi(params.get(2));
// SetPlayerDataInt
reinterpret_cast<void(*)(signed int, unsigned int, unsigned int, unsigned int)>(0x1403BF550)(0, lookupString, value, 0);
reinterpret_cast<void(*)(signed int, unsigned int, unsigned int, unsigned int)>(0x1403BF550)(
0, lookup_string, value, 0);
});
command::add("getPlayerDataInt", [](const command::params& params)
@ -45,10 +44,11 @@ namespace stats
}
// SL_FindString
auto lookupString = game::SL_FindString(params.get(1));
const auto lookup_string = game::SL_FindString(params.get(1));
// GetPlayerDataInt
auto result = reinterpret_cast<int(*)(signed int, unsigned int, unsigned int)>(0x1403BE860)(0, lookupString, 0);
const auto result = reinterpret_cast<int(*)(signed int, unsigned int, unsigned int)>(0x1403BE860)(
0, lookup_string, 0);
game_console::print(game_console::con_type_info, "%d\n", result);
});

View File

@ -132,7 +132,7 @@ namespace demonware
}
bool byte_buffer::read_array_header(const unsigned char expected, unsigned int* element_count,
unsigned int* element_size)
unsigned int* element_size)
{
if (element_count) *element_count = 0;
if (element_size) *element_size = 0;
@ -237,7 +237,7 @@ namespace demonware
}
bool byte_buffer::write_array_header(const unsigned char type, const unsigned int element_count,
const unsigned int element_size)
const unsigned int element_size)
{
const auto using_types = this->is_using_data_types();
this->set_use_data_types(false);

View File

@ -4,13 +4,18 @@
namespace demonware
{
class bdTaskResult
{
public:
virtual ~bdTaskResult() = default;
virtual void serialize(byte_buffer*) { }
virtual void deserialize(byte_buffer*) { }
virtual void serialize(byte_buffer*)
{
}
virtual void deserialize(byte_buffer*)
{
}
};
class bdFileData final : public bdTaskResult
@ -136,5 +141,4 @@ namespace demonware
buffer->read_string(&this->timezone);
}
};
}

View File

@ -17,8 +17,8 @@ namespace demonware
std::string packet_buffer;
void calculate_hmacs_s1(const char* data_, unsigned int data_size, const char* key, unsigned int key_size,
char* dst, unsigned int dst_size)
void calculate_hmacs_s1(const char* data_, const unsigned int data_size, const char* key, const unsigned int key_size,
char* dst, const unsigned int dst_size)
{
char buffer[64];
unsigned int pos = 0;

View File

@ -7,7 +7,6 @@
namespace demonware
{
std::string unencrypted_reply::data()
{
byte_buffer result;
@ -29,9 +28,9 @@ namespace demonware
byte_buffer enc_buffer;
enc_buffer.set_use_data_types(false);
enc_buffer.write_uint32(static_cast<unsigned int>(this->buffer_.size())); // service data size CHECKTHIS!!
enc_buffer.write_byte(this->type()); // TASK_REPLY type
enc_buffer.write(this->buffer_); // service data
enc_buffer.write_uint32(static_cast<unsigned int>(this->buffer_.size())); // service data size CHECKTHIS!!
enc_buffer.write_byte(this->type()); // TASK_REPLY type
enc_buffer.write(this->buffer_); // service data
auto aligned_data = enc_buffer.get_buffer();
auto size = aligned_data.size();
@ -45,7 +44,7 @@ namespace demonware
const auto enc_data = utils::cryptography::aes::encrypt(aligned_data, seed, demonware::get_encrypt_key());
// header : encrypted service data : hash
static std::int32_t msg_count = 0;
static auto msg_count = 0;
msg_count++;
byte_buffer response;
@ -60,7 +59,8 @@ namespace demonware
// hash entire packet and append end
unsigned int outlen = 20;
auto hash_data = utils::cryptography::hmac_sha1::process(response.get_buffer(), demonware::get_hmac_key(), &outlen);
auto hash_data = utils::cryptography::hmac_sha1::process(response.get_buffer(), demonware::get_hmac_key(),
&outlen);
hash_data.resize(8);
response.write(8, hash_data.data());
@ -86,5 +86,4 @@ namespace demonware
this->server_->send_reply(reply.get());
}
}

View File

@ -41,7 +41,7 @@ namespace demonware
class typed_reply : public raw_reply
{
public:
typed_reply(uint8_t _type) : type_(_type)
typed_reply(const uint8_t _type) : type_(_type)
{
}
@ -71,12 +71,12 @@ namespace demonware
class unencrypted_reply final : public typed_reply
{
public:
unencrypted_reply(uint8_t _type, bit_buffer* bbuffer) : typed_reply(_type)
unencrypted_reply(const uint8_t _type, bit_buffer* bbuffer) : typed_reply(_type)
{
this->buffer_.append(bbuffer->get_buffer());
}
unencrypted_reply(uint8_t _type, byte_buffer* bbuffer) : typed_reply(_type)
unencrypted_reply(const uint8_t _type, byte_buffer* bbuffer) : typed_reply(_type)
{
this->buffer_.append(bbuffer->get_buffer());
}
@ -106,7 +106,7 @@ namespace demonware
class service_reply final
{
public:
service_reply(service_server* _server, uint8_t _type, uint32_t _error)
service_reply(service_server* _server, const uint8_t _type, const uint32_t _error)
: type_(_type), error_(_error), reply_(_server, 1)
{
}

View File

@ -66,7 +66,9 @@ namespace demonware
std::string packet_1 = buffer.get_remaining();
demonware::queue_packet_to_hash(packet_1);
const std::string packet_2("\x16\x00\x00\x00\xab\x81\xd2\x00\x00\x00\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37", 26);
const std::string packet_2(
"\x16\x00\x00\x00\xab\x81\xd2\x00\x00\x00\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37",
26);
demonware::queue_packet_to_hash(packet_2);
raw_reply reply(packet_2);
@ -121,7 +123,9 @@ namespace demonware
char hash[8];
std::memcpy(hash, &(enc.data()[enc.size() - 8]), 8);
std::string dec = utils::cryptography::aes::decrypt(std::string(enc.data(), enc.size() - 8), std::string(seed, 16), demonware::get_decrypt_key());
std::string dec = utils::cryptography::aes::decrypt(
std::string(enc.data(), enc.size() - 8), std::string(seed, 16),
demonware::get_decrypt_key());
byte_buffer serv(dec);
serv.set_use_data_types(false);
@ -170,5 +174,4 @@ namespace demonware
this->create_reply(task_id)->send();
}
}
}

View File

@ -8,7 +8,7 @@ namespace demonware
{
public:
virtual ~service_server() = default;
virtual std::shared_ptr<remote_reply> create_message(uint8_t type)
{
auto reply = std::make_shared<remote_reply>(this, type);
@ -24,5 +24,4 @@ namespace demonware
virtual void send_reply(reply* data) = 0;
};
} // namespace demonware
}

View File

@ -1,6 +1,8 @@
#include <std_include.hpp>
#include "stun_server.hpp"
#include "../byte_buffer.hpp"
namespace demonware
{
void stun_server::handle(const endpoint_data& endpoint, const std::string& packet)

View File

@ -1,7 +1,6 @@
#pragma once
#include "udp_server.hpp"
#include "../byte_buffer.hpp"
namespace demonware
{

View File

@ -9,14 +9,14 @@ namespace demonware
this->register_task(4, &bdAnticheat::report_console_details);
}
void bdAnticheat::unk2(service_server* server, byte_buffer* buffer) const
void bdAnticheat::unk2(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO: Read data as soon as needed
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdAnticheat::report_console_details(service_server* server, byte_buffer* buffer) const
void bdAnticheat::report_console_details(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO: Read data as soon as needed
auto reply = server->create_reply(this->task_id());

View File

@ -9,14 +9,14 @@ namespace demonware
this->register_task(3, &bdContentStreaming::unk3);
}
void bdContentStreaming::unk2(service_server* server, byte_buffer* buffer) const
void bdContentStreaming::unk2(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdContentStreaming::unk3(service_server* server, byte_buffer* buffer) const
void bdContentStreaming::unk3(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -9,14 +9,14 @@ namespace demonware
this->register_task(2, &bdCounters::unk2);
}
void bdCounters::unk1(service_server* server, byte_buffer* buffer) const
void bdCounters::unk1(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdCounters::unk2(service_server* server, byte_buffer* buffer) const
void bdCounters::unk2(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -8,7 +8,7 @@ namespace demonware
this->register_task(6, &bdEventLog::unk6);
}
void bdEventLog::unk6(service_server* server, byte_buffer* buffer) const
void bdEventLog::unk6(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -11,28 +11,28 @@ namespace demonware
this->register_task(8, &bdFacebook::unk8);
}
void bdFacebook::unk1(service_server* server, byte_buffer* buffer) const
void bdFacebook::unk1(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::unk3(service_server* server, byte_buffer* buffer) const
void bdFacebook::unk3(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::unk7(service_server* server, byte_buffer* buffer) const
void bdFacebook::unk7(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::unk8(service_server* server, byte_buffer* buffer) const
void bdFacebook::unk8(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -9,14 +9,14 @@ namespace demonware
this->register_task(4, &bdGroups::unk4);
}
void bdGroups::set_groups(service_server* server, byte_buffer* buffer) const
void bdGroups::set_groups(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdGroups::unk4(service_server* server, byte_buffer* buffer) const
void bdGroups::unk4(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -9,14 +9,14 @@ namespace demonware
this->register_task(3, &bdMarketing::unk3);
}
void bdMarketing::unk2(service_server* server, byte_buffer* buffer) const
void bdMarketing::unk2(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMarketing::unk3(service_server* server, byte_buffer* buffer) const
void bdMarketing::unk3(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -12,35 +12,35 @@ namespace demonware
this->register_task(16, &bdMatchMaking2::unk16);
}
void bdMatchMaking2::unk1(service_server* server, byte_buffer* buffer) const
void bdMatchMaking2::unk1(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking2::unk2(service_server* server, byte_buffer* buffer) const
void bdMatchMaking2::unk2(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking2::unk3(service_server* server, byte_buffer* buffer) const
void bdMatchMaking2::unk3(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking2::unk5(service_server* server, byte_buffer* buffer) const
void bdMatchMaking2::unk5(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking2::unk16(service_server* server, byte_buffer* buffer) const
void bdMatchMaking2::unk16(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -9,14 +9,14 @@ namespace demonware
this->register_task(3, &bdPresence::unk3);
}
void bdPresence::unk1(service_server* server, byte_buffer* buffer) const
void bdPresence::unk1(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdPresence::unk3(service_server* server, byte_buffer* buffer) const
void bdPresence::unk3(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -8,7 +8,7 @@ namespace demonware
this->register_task(3, &bdProfiles::unk3);
}
void bdProfiles::unk3(service_server* server, byte_buffer* buffer) const
void bdProfiles::unk3(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -9,14 +9,14 @@ namespace demonware
this->register_task(2, &bdRichPresence::unk2);
}
void bdRichPresence::unk1(service_server* server, byte_buffer* buffer) const
void bdRichPresence::unk1(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdRichPresence::unk2(service_server* server, byte_buffer* buffer) const
void bdRichPresence::unk2(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -12,35 +12,35 @@ namespace demonware
this->register_task(11, &bdStats::unk11);
}
void bdStats::unk1(service_server* server, byte_buffer* buffer) const
void bdStats::unk1(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats::unk3(service_server* server, byte_buffer* buffer) const
void bdStats::unk3(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats::unk4(service_server* server, byte_buffer* buffer) const
void bdStats::unk4(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats::unk8(service_server* server, byte_buffer* buffer) const
void bdStats::unk8(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats::unk11(service_server* server, byte_buffer* buffer) const
void bdStats::unk11(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -9,172 +9,172 @@
namespace demonware
{
bdStorage::bdStorage() : service(10, "bdStorage")
{
this->register_task(6, &bdStorage::list_publisher_files);
this->register_task(7, &bdStorage::get_publisher_file);
this->register_task(10, &bdStorage::set_user_file);
this->register_task(12, &bdStorage::get_user_file);
this->register_task(13, &bdStorage::unk13);
bdStorage::bdStorage() : service(10, "bdStorage")
{
this->register_task(6, &bdStorage::list_publisher_files);
this->register_task(7, &bdStorage::get_publisher_file);
this->register_task(10, &bdStorage::set_user_file);
this->register_task(12, &bdStorage::get_user_file);
this->register_task(13, &bdStorage::unk13);
this->map_publisher_resource("motd-.*\\.txt", DW_MOTD);
this->map_publisher_resource("ffotd-.*\\.ff", DW_FASTFILE);
this->map_publisher_resource("playlists(_.+)?\\.aggr", DW_PLAYLISTS);
this->map_publisher_resource("social_[Tt][Uu][0-9]+\\.cfg", DW_SOCIAL_CONFIG);
this->map_publisher_resource("mm\\.cfg", DW_MM_CONFIG);
this->map_publisher_resource("entitlement_config\\.info", DW_ENTITLEMENT_CONFIG);
this->map_publisher_resource("lootConfig_[Tt][Uu][0-9]+\\.csv", DW_LOOT_CONFIG);
this->map_publisher_resource("winStoreConfig_[Tt][Uu][0-9]+\\.csv", DW_STORE_CONFIG);
}
this->map_publisher_resource("motd-.*\\.txt", DW_MOTD);
this->map_publisher_resource("ffotd-.*\\.ff", DW_FASTFILE);
this->map_publisher_resource("playlists(_.+)?\\.aggr", DW_PLAYLISTS);
this->map_publisher_resource("social_[Tt][Uu][0-9]+\\.cfg", DW_SOCIAL_CONFIG);
this->map_publisher_resource("mm\\.cfg", DW_MM_CONFIG);
this->map_publisher_resource("entitlement_config\\.info", DW_ENTITLEMENT_CONFIG);
this->map_publisher_resource("lootConfig_[Tt][Uu][0-9]+\\.csv", DW_LOOT_CONFIG);
this->map_publisher_resource("winStoreConfig_[Tt][Uu][0-9]+\\.csv", DW_STORE_CONFIG);
}
void bdStorage::map_publisher_resource(const std::string& expression, const INT id)
{
auto data = utils::nt::load_resource(id);
this->publisher_resources_.emplace_back(std::regex{ expression }, data);
}
void bdStorage::map_publisher_resource(const std::string& expression, const INT id)
{
auto data = utils::nt::load_resource(id);
this->publisher_resources_.emplace_back(std::regex{expression}, data);
}
bool bdStorage::load_publisher_resource(const std::string& name, std::string& buffer)
{
for (const auto& resource : this->publisher_resources_)
{
if (std::regex_match(name, resource.first))
{
buffer = resource.second;
return true;
}
}
bool bdStorage::load_publisher_resource(const std::string& name, std::string& buffer)
{
for (const auto& resource : this->publisher_resources_)
{
if (std::regex_match(name, resource.first))
{
buffer = resource.second;
return true;
}
}
#ifdef DEBUG
printf("[DW]: [bdStorage]: missing publisher file: %s\n", name.data());
printf("[DW]: [bdStorage]: missing publisher file: %s\n", name.data());
#endif
return false;
}
return false;
}
void bdStorage::list_publisher_files(service_server* server, byte_buffer* buffer)
{
uint32_t date;
uint16_t num_results, offset;
std::string filename, data;
void bdStorage::list_publisher_files(service_server* server, byte_buffer* buffer)
{
uint32_t date;
uint16_t num_results, offset;
std::string filename, data;
buffer->read_uint32(&date);
buffer->read_uint16(&num_results);
buffer->read_uint16(&offset);
buffer->read_string(&filename);
buffer->read_uint32(&date);
buffer->read_uint16(&num_results);
buffer->read_uint16(&offset);
buffer->read_string(&filename);
auto reply = server->create_reply(this->task_id());
auto reply = server->create_reply(this->task_id());
if (this->load_publisher_resource(filename, data))
{
auto* info = new bdFileInfo;
if (this->load_publisher_resource(filename, data))
{
auto* info = new bdFileInfo;
info->file_id = *reinterpret_cast<const uint64_t*>(utils::cryptography::sha1::compute(filename).data());
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_id = *reinterpret_cast<const uint64_t*>(utils::cryptography::sha1::compute(filename).data());
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;
reply->add(info);
}
reply->add(info);
}
reply->send();
}
reply->send();
}
void bdStorage::get_publisher_file(service_server* server, byte_buffer* buffer)
{
std::string filename;
buffer->read_string(&filename);
void bdStorage::get_publisher_file(service_server* server, byte_buffer* buffer)
{
std::string filename;
buffer->read_string(&filename);
#ifdef DEBUG
printf("[DW]: [bdStorage]: loading publisher file: %s\n", filename.data());
printf("[DW]: [bdStorage]: loading publisher file: %s\n", filename.data());
#endif
std::string data;
std::string data;
if (this->load_publisher_resource(filename, data))
{
if (this->load_publisher_resource(filename, data))
{
#ifdef DEBUG
printf("[DW]: [bdStorage]: sending publisher file: %s, size: %lld\n", filename.data(), data.size());
printf("[DW]: [bdStorage]: sending publisher file: %s, size: %lld\n", filename.data(), data.size());
#endif
auto reply = server->create_reply(this->task_id());
reply->add(new bdFileData(data));
reply->send();
}
else
{
server->create_reply(this->task_id(), game::BD_NO_FILE)->send();
}
}
auto reply = server->create_reply(this->task_id());
reply->add(new bdFileData(data));
reply->send();
}
else
{
server->create_reply(this->task_id(), game::BD_NO_FILE)->send();
}
}
std::string bdStorage::get_user_file_path(const std::string& name)
{
return "players2/user/" + name;
}
std::string bdStorage::get_user_file_path(const std::string& name)
{
return "players2/user/" + name;
}
void bdStorage::set_user_file(service_server* server, byte_buffer* buffer) const
{
bool priv;
uint64_t owner;
std::string game, filename, data;
void bdStorage::set_user_file(service_server* server, byte_buffer* buffer) const
{
bool priv;
uint64_t owner;
std::string game, filename, data;
buffer->read_string(&game);
buffer->read_string(&filename);
buffer->read_bool(&priv);
buffer->read_blob(&data);
buffer->read_uint64(&owner);
buffer->read_string(&game);
buffer->read_string(&filename);
buffer->read_bool(&priv);
buffer->read_blob(&data);
buffer->read_uint64(&owner);
const auto path = get_user_file_path(filename);
utils::io::write_file(path, data);
const auto path = get_user_file_path(filename);
utils::io::write_file(path, data);
auto* info = new bdFileInfo;
auto* info = new bdFileInfo;
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->modified_time = info->create_time;
info->file_size = uint32_t(data.size());
info->owner_id = owner;
info->priv = priv;
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->modified_time = info->create_time;
info->file_size = uint32_t(data.size());
info->owner_id = owner;
info->priv = priv;
auto reply = server->create_reply(this->task_id());
reply->add(info);
reply->send();
}
auto reply = server->create_reply(this->task_id());
reply->add(info);
reply->send();
}
void bdStorage::get_user_file(service_server* server, byte_buffer* buffer) const
{
uint64_t owner{};
std::string game, filename, platform, data;
void bdStorage::get_user_file(service_server* server, byte_buffer* buffer) const
{
uint64_t owner{};
std::string game, filename, platform, data;
buffer->read_string(&game);
buffer->read_string(&filename);
buffer->read_uint64(&owner);
buffer->read_string(&platform);
buffer->read_string(&game);
buffer->read_string(&filename);
buffer->read_uint64(&owner);
buffer->read_string(&platform);
#ifdef DEBUG
printf("[DW]: [bdStorage]: user file: %s, %s, %s\n", game.data(), filename.data(), platform.data());
printf("[DW]: [bdStorage]: user file: %s, %s, %s\n", game.data(), filename.data(), platform.data());
#endif
const auto path = get_user_file_path(filename);
if (utils::io::read_file(path, &data))
{
auto reply = server->create_reply(this->task_id());
reply->add(new bdFileData(data));
reply->send();
}
else
{
server->create_reply(this->task_id(), game::BD_NO_FILE)->send();
}
}
const auto path = get_user_file_path(filename);
if (utils::io::read_file(path, &data))
{
auto reply = server->create_reply(this->task_id());
reply->add(new bdFileData(data));
reply->send();
}
else
{
server->create_reply(this->task_id(), game::BD_NO_FILE)->send();
}
}
void bdStorage::unk13(service_server* server, byte_buffer* buffer) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
} // namespace demonware
void bdStorage::unk13(service_server* server, byte_buffer* buffer) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -2,23 +2,23 @@
namespace demonware
{
class bdStorage final : public service
{
public:
bdStorage();
class bdStorage final : public service
{
public:
bdStorage();
private:
std::vector<std::pair<std::regex, std::string>> publisher_resources_;
private:
std::vector<std::pair<std::regex, std::string>> publisher_resources_;
void map_publisher_resource(const std::string& expression, INT id);
bool load_publisher_resource(const std::string& name, std::string& buffer);
void map_publisher_resource(const std::string& expression, INT id);
bool load_publisher_resource(const std::string& name, std::string& buffer);
void list_publisher_files(service_server* server, byte_buffer* buffer);
void get_publisher_file(service_server* server, byte_buffer* buffer);
void set_user_file(service_server* server, byte_buffer* buffer) const;
void get_user_file(service_server* server, byte_buffer* buffer) const;
void unk13(service_server* server, byte_buffer* buffer) const;
void list_publisher_files(service_server* server, byte_buffer* buffer);
void get_publisher_file(service_server* server, byte_buffer* buffer);
void set_user_file(service_server* server, byte_buffer* buffer) const;
void get_user_file(service_server* server, byte_buffer* buffer) const;
void unk13(service_server* server, byte_buffer* buffer) const;
static std::string get_user_file_path(const std::string& name);
};
} // namespace demonware
static std::string get_user_file_path(const std::string& name);
};
}

View File

@ -8,7 +8,7 @@ namespace demonware
this->register_task(1, &bdUNK104::unk1);
}
void bdUNK104::unk1(service_server* server, byte_buffer* buffer) const
void bdUNK104::unk1(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -8,7 +8,7 @@ namespace demonware
//this->register_task(6, "unk6", &bdUNK63::unk6);
}
void bdUNK63::unk(service_server* server, byte_buffer* buffer) const
void bdUNK63::unk(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -13,42 +13,42 @@ namespace demonware
this->register_task(193, &bdUNK80::unk193);
}
void bdUNK80::unk42(service_server* server, byte_buffer* buffer) const
void bdUNK80::unk42(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUNK80::unk49(service_server* server, byte_buffer* buffer) const
void bdUNK80::unk49(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUNK80::unk60(service_server* server, byte_buffer* buffer) const
void bdUNK80::unk60(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUNK80::unk130(service_server* server, byte_buffer* buffer) const
void bdUNK80::unk130(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUNK80::unk165(service_server* server, byte_buffer* buffer) const
void bdUNK80::unk165(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUNK80::unk193(service_server* server, byte_buffer* buffer) const
void bdUNK80::unk193(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -5,127 +5,130 @@
namespace dvars
{
game::dvar_t* aimassist_enabled = nullptr;
game::dvar_t* aimassist_enabled = nullptr;
game::dvar_t* con_inputBoxColor = nullptr;
game::dvar_t* con_inputHintBoxColor = nullptr;
game::dvar_t* con_outputBarColor = nullptr;
game::dvar_t* con_outputSliderColor = nullptr;
game::dvar_t* con_outputWindowColor = nullptr;
game::dvar_t* con_inputDvarMatchColor = nullptr;
game::dvar_t* con_inputDvarValueColor = nullptr;
game::dvar_t* con_inputDvarInactiveValueColor = nullptr;
game::dvar_t* con_inputCmdMatchColor = nullptr;
game::dvar_t* con_inputBoxColor = nullptr;
game::dvar_t* con_inputHintBoxColor = nullptr;
game::dvar_t* con_outputBarColor = nullptr;
game::dvar_t* con_outputSliderColor = nullptr;
game::dvar_t* con_outputWindowColor = nullptr;
game::dvar_t* con_inputDvarMatchColor = nullptr;
game::dvar_t* con_inputDvarValueColor = nullptr;
game::dvar_t* con_inputDvarInactiveValueColor = nullptr;
game::dvar_t* con_inputCmdMatchColor = nullptr;
game::dvar_t* g_playerEjection = nullptr;
game::dvar_t* g_playerCollision = nullptr;
game::dvar_t* g_playerEjection = nullptr;
game::dvar_t* g_playerCollision = nullptr;
game::dvar_t* pm_bouncing = nullptr;
game::dvar_t* pm_bouncing = nullptr;
game::dvar_t* r_fullbright = nullptr;
game::dvar_t* r_fullbright = nullptr;
std::string dvar_get_vector_domain(const int components, const game::dvar_limits& domain)
{
if (domain.vector.min == -FLT_MAX)
{
if (domain.vector.max == FLT_MAX)
{
return utils::string::va("Domain is any %iD vector", components);
}
else
{
return utils::string::va("Domain is any %iD vector with components %g or smaller", components, domain.vector.max);
}
}
else if (domain.vector.max == FLT_MAX)
{
return utils::string::va("Domain is any %iD vector with components %g or bigger", components, domain.vector.min);
}
else
{
return utils::string::va("Domain is any %iD vector with components from %g to %g", components, domain.vector.min, domain.vector.max);
}
}
std::string dvar_get_vector_domain(const int components, const game::dvar_limits& domain)
{
if (domain.vector.min == -FLT_MAX)
{
if (domain.vector.max == FLT_MAX)
{
return utils::string::va("Domain is any %iD vector", components);
}
else
{
return utils::string::va("Domain is any %iD vector with components %g or smaller", components,
domain.vector.max);
}
}
else if (domain.vector.max == FLT_MAX)
{
return utils::string::va("Domain is any %iD vector with components %g or bigger", components,
domain.vector.min);
}
else
{
return utils::string::va("Domain is any %iD vector with components from %g to %g", components,
domain.vector.min, domain.vector.max);
}
}
std::string dvar_get_domain(const game::dvar_type type, const game::dvar_limits& domain)
{
std::string str;
std::string dvar_get_domain(const game::dvar_type type, const game::dvar_limits& domain)
{
std::string str;
switch (type)
{
case game::dvar_type::boolean:
return "Domain is 0 or 1"s;
switch (type)
{
case game::dvar_type::boolean:
return "Domain is 0 or 1"s;
case game::dvar_type::value:
if (domain.value.min == -FLT_MAX)
{
if (domain.value.max == FLT_MAX)
{
return "Domain is any number"s;
}
else
{
return utils::string::va("Domain is any number %g or smaller", domain.value.max);
}
}
else if (domain.value.max == FLT_MAX)
{
return utils::string::va("Domain is any number %g or bigger", domain.value.min);
}
else
{
return utils::string::va("Domain is any number from %g to %g", domain.value.min, domain.value.max);
}
case game::dvar_type::value:
if (domain.value.min == -FLT_MAX)
{
if (domain.value.max == FLT_MAX)
{
return "Domain is any number"s;
}
else
{
return utils::string::va("Domain is any number %g or smaller", domain.value.max);
}
}
else if (domain.value.max == FLT_MAX)
{
return utils::string::va("Domain is any number %g or bigger", domain.value.min);
}
else
{
return utils::string::va("Domain is any number from %g to %g", domain.value.min, domain.value.max);
}
case game::dvar_type::vec2:
return dvar_get_vector_domain(2, domain);
case game::dvar_type::vec2:
return dvar_get_vector_domain(2, domain);
case game::dvar_type::rgb:
case game::dvar_type::vec3:
return dvar_get_vector_domain(3, domain);
case game::dvar_type::rgb:
case game::dvar_type::vec3:
return dvar_get_vector_domain(3, domain);
case game::dvar_type::vec4:
return dvar_get_vector_domain(4, domain);
case game::dvar_type::vec4:
return dvar_get_vector_domain(4, domain);
case game::dvar_type::integer:
if (domain.enumeration.stringCount == INT_MIN)
{
if (domain.integer.max == INT_MAX)
{
return "Domain is any integer"s;
}
else
{
return utils::string::va("Domain is any integer %i or smaller", domain.integer.max);
}
}
else if (domain.integer.max == INT_MAX)
{
return utils::string::va("Domain is any integer %i or bigger", domain.integer.min);
}
else
{
return utils::string::va("Domain is any integer from %i to %i", domain.integer.min, domain.integer.max);
}
case game::dvar_type::integer:
if (domain.enumeration.stringCount == INT_MIN)
{
if (domain.integer.max == INT_MAX)
{
return "Domain is any integer"s;
}
else
{
return utils::string::va("Domain is any integer %i or smaller", domain.integer.max);
}
}
else if (domain.integer.max == INT_MAX)
{
return utils::string::va("Domain is any integer %i or bigger", domain.integer.min);
}
else
{
return utils::string::va("Domain is any integer from %i to %i", domain.integer.min, domain.integer.max);
}
case game::dvar_type::color:
return "Domain is any 4-component color, in RGBA format"s;
case game::dvar_type::color:
return "Domain is any 4-component color, in RGBA format"s;
case game::dvar_type::enumeration:
str = "Domain is one of the following:"s;
case game::dvar_type::enumeration:
str = "Domain is one of the following:"s;
for (auto stringIndex = 0; stringIndex < domain.enumeration.stringCount; ++stringIndex)
{
str += utils::string::va("\n %2i: %s", stringIndex, domain.enumeration.strings[stringIndex]);
}
for (auto string_index = 0; string_index < domain.enumeration.stringCount; ++string_index)
{
str += utils::string::va("\n %2i: %s", string_index, domain.enumeration.strings[string_index]);
}
return str;
return str;
case game::dvar_type::string:
return "Domain is any text"s;
case game::dvar_type::string:
return "Domain is any text"s;
default:
return utils::string::va("unhandled dvar type '%i'", type);
}
}
default:
return utils::string::va("unhandled dvar type '%i'", type);
}
}
}

View File

@ -29,7 +29,7 @@ namespace game
public:
symbol(const size_t sp_address, const size_t mp_address)
: sp_object_(reinterpret_cast<T*>(sp_address))
, mp_object_(reinterpret_cast<T*>(mp_address))
, mp_object_(reinterpret_cast<T*>(mp_address))
{
}
@ -43,7 +43,7 @@ namespace game
return mp_object_;
}
operator T* () const
operator T*() const
{
return this->get();
}

View File

@ -676,7 +676,7 @@ namespace game
{
cmd_function_s* next;
const char* name;
void(__cdecl* function)();
void (__cdecl* function)();
};
enum DvarSetSource : std::uint32_t
@ -850,7 +850,8 @@ namespace game
ASSET_TYPE_REVERB_CURVE,
ASSET_TYPE_SOUND_CONTEXT,
ASSET_TYPE_LOADED_SOUND,
ASSET_TYPE_CLIPMAP, // col_map
ASSET_TYPE_CLIPMAP,
// col_map
ASSET_TYPE_COMWORLD,
ASSET_TYPE_GLASSWORLD,
ASSET_TYPE_PATHDATA,
@ -1080,7 +1081,6 @@ namespace game
struct playerState_s
{
};
struct clientHeader_t
@ -1119,7 +1119,6 @@ namespace game
struct playerState_s
{
};
}
@ -1128,4 +1127,4 @@ namespace game
sp::playerState_s* sp;
mp::playerState_s* mp;
};
}
}

View File

@ -8,191 +8,211 @@ namespace game
* Functions
**************************************************************/
WEAK symbol<void(void*, void*)> AimAssist_AddToTargetList{ 0, 0x140001730 };
WEAK symbol<void(void*, void*)> AimAssist_AddToTargetList{0, 0x140001730};
WEAK symbol<void(errorParm code, const char* message, ...)> Com_Error{ 0x1402F7570, 0x1403CE480 };
WEAK symbol<void()> Com_Frame_Try_Block_Function{ 0x1402F7E10, 0x1403CEF30 };
WEAK symbol<CodPlayMode()> Com_GetCurrentCoDPlayMode{ 0, 0x1404C9690 };
WEAK symbol<void()> Com_Quit_f{ 0x1402F9390, 0x1403D08C0 };
WEAK symbol<void(errorParm code, const char* message, ...)> Com_Error{0x1402F7570, 0x1403CE480};
WEAK symbol<void()> Com_Frame_Try_Block_Function{0x1402F7E10, 0x1403CEF30};
WEAK symbol<CodPlayMode()> Com_GetCurrentCoDPlayMode{0, 0x1404C9690};
WEAK symbol<void()> Com_Quit_f{0x1402F9390, 0x1403D08C0};
WEAK symbol<void(const char* cmdName, void(), cmd_function_s* allocedCmd)> Cmd_AddCommandInternal{ 0x1402EDDB0, 0x1403AF2C0 };
WEAK symbol<void(int localClientNum, int controllerIndex, const char* text)> Cmd_ExecuteSingleCommand{ 0x1402EE350, 0x1403AF900 };
WEAK symbol<void(const char*)> Cmd_RemoveCommand{ 0x1402EE910, 0x1403AFEF0 };
WEAK symbol<void(const char* text_in)> Cmd_TokenizeString{ 0x1402EEA30, 0x1403B0020 };
WEAK symbol<void()> Cmd_EndTokenizeString{ 0x1402EE000, 0x1403AF5B0 };
WEAK symbol<void(const char* cmdName, void (), cmd_function_s* allocedCmd)> Cmd_AddCommandInternal{
0x1402EDDB0, 0x1403AF2C0
};
WEAK symbol<void(int localClientNum, int controllerIndex, const char* text)> Cmd_ExecuteSingleCommand{
0x1402EE350, 0x1403AF900
};
WEAK symbol<void(const char*)> Cmd_RemoveCommand{0x1402EE910, 0x1403AFEF0};
WEAK symbol<void(const char* text_in)> Cmd_TokenizeString{0x1402EEA30, 0x1403B0020};
WEAK symbol<void()> Cmd_EndTokenizeString{0x1402EE000, 0x1403AF5B0};
WEAK symbol<void(const char* message)> Conbuf_AppendText{ 0x14038F220, 0x1404D9040 };
WEAK symbol<void(const char* message)> Conbuf_AppendText{0x14038F220, 0x1404D9040};
WEAK symbol<void(int localClientNum, void (*)(int localClientNum))> Cbuf_AddCall{ 0x1402ED820, 0x1403AECF0 };
WEAK symbol<void(int localClientNum, const char* text)> Cbuf_AddText{ 0x1402ED890, 0x1403AED70 };
WEAK symbol<void(int localClientNum, void (*)(int localClientNum))> Cbuf_AddCall{0x1402ED820, 0x1403AECF0};
WEAK symbol<void(int localClientNum, const char* text)> Cbuf_AddText{0x1402ED890, 0x1403AED70};
WEAK symbol<void(int localClientNum, int controllerIndex, const char* buffer,
void(int, int, const char*))> Cbuf_ExecuteBufferInternal{ 0x1402ED9A0, 0x1403AEE80 };
void (int, int, const char*))> Cbuf_ExecuteBufferInternal{0x1402ED9A0, 0x1403AEE80};
WEAK symbol<bool()> CL_IsCgameInitialized{ 0x140136560, 0x1401FD510 };
WEAK symbol<bool()> CL_IsCgameInitialized{0x140136560, 0x1401FD510};
WEAK symbol<void(int localClientNum, const char* message)> CG_GameMessage{ 0x1400EE500, 0x1401A3050 };
WEAK symbol<void(int localClientNum, /*mp::cg_s**/void* cg, const char* dvar, const char* value)> CG_SetClientDvarFromServer
{ 0, 0x1401BF0A0 };
WEAK symbol<void(int localClientNum, const char* message)> CG_GameMessage{0x1400EE500, 0x1401A3050};
WEAK symbol<void(int localClientNum, /*mp::cg_s**/void* cg, const char* dvar, const char* value)>
CG_SetClientDvarFromServer
{0, 0x1401BF0A0};
WEAK symbol<void(XAssetType type, void(__cdecl* func)(XAssetHeader, void*), void* inData, bool includeOverride)> DB_EnumXAssets_FastFile{ 0x14017D7C0, 0x14026EC10 };
WEAK symbol<int(XAssetType type)> DB_GetXAssetTypeSize{ 0x140151C20, 0x140240DF0 };
WEAK symbol<void(XZoneInfo* zoneInfo, unsigned int zoneCount, DBSyncMode syncMode)> DB_LoadXAssets{ 0x1402F8B50, 0x140270F30 };
WEAK symbol<void(XAssetType type, void (__cdecl* func)(XAssetHeader, void*), void* inData, bool includeOverride)>
DB_EnumXAssets_FastFile{0x14017D7C0, 0x14026EC10};
WEAK symbol<int(XAssetType type)> DB_GetXAssetTypeSize{0x140151C20, 0x140240DF0};
WEAK symbol<void(XZoneInfo* zoneInfo, unsigned int zoneCount, DBSyncMode syncMode)> DB_LoadXAssets{
0x1402F8B50, 0x140270F30
};
WEAK symbol<dvar_t* (const char* name)> Dvar_FindVar{ 0x140370860, 0x1404BF8B0 };
WEAK symbol<void(const dvar_t* dvar)> Dvar_ClearModified{ 0x140370700, 0x1404BF690 };
WEAK symbol<void(char* buffer, int index)> Dvar_GetCombinedString{ 0x1402FB590, 0x1403D3290 };
WEAK symbol<bool(const char* name)> Dvar_IsValidName{ 0x140370CB0, 0x1404BFF70 };
WEAK symbol<void(dvar_t* dvar, DvarSetSource source)> Dvar_Reset{ 0x140372950, 0x1404C1DB0 };
WEAK symbol<void(const char* dvar, const char* buffer)> Dvar_SetCommand{ 0x1403730D0, 0x1404C2520 };
WEAK symbol<void(dvar_t* dvar, const char* string)> Dvar_SetString{ 0x140373DE0, 0x1404C3610 };
WEAK symbol<void(const char*, const char*, DvarSetSource)> Dvar_SetFromStringByNameFromSource{ 0x1403737D0, 0x1404C2E40 };
WEAK symbol<const char* (dvar_t* dvar, dvar_value value)> Dvar_ValueToString{ 0x140374E10, 0x1404C47B0 };
WEAK symbol<dvar_t*(const char* name)> Dvar_FindVar{0x140370860, 0x1404BF8B0};
WEAK symbol<void(const dvar_t* dvar)> Dvar_ClearModified{0x140370700, 0x1404BF690};
WEAK symbol<void(char* buffer, int index)> Dvar_GetCombinedString{0x1402FB590, 0x1403D3290};
WEAK symbol<bool(const char* name)> Dvar_IsValidName{0x140370CB0, 0x1404BFF70};
WEAK symbol<void(dvar_t* dvar, DvarSetSource source)> Dvar_Reset{0x140372950, 0x1404C1DB0};
WEAK symbol<void(const char* dvar, const char* buffer)> Dvar_SetCommand{0x1403730D0, 0x1404C2520};
WEAK symbol<void(dvar_t* dvar, const char* string)> Dvar_SetString{0x140373DE0, 0x1404C3610};
WEAK symbol<void(const char*, const char*, DvarSetSource)> Dvar_SetFromStringByNameFromSource{
0x1403737D0, 0x1404C2E40
};
WEAK symbol<const char*(dvar_t* dvar, dvar_value value)> Dvar_ValueToString{0x140374E10, 0x1404C47B0};
WEAK symbol<dvar_t* (const char* dvarName, bool value, unsigned int flags, const char* description)>
Dvar_RegisterBool{ 0x140371850, 0x1404C0BE0 };
WEAK symbol<dvar_t* (const char* dvarName, const char** valueList, int defaultIndex, unsigned int flags,
const char* description)> Dvar_RegisterEnum{ 0x140371B30, 0x1404C0EC0 };
WEAK symbol<dvar_t* (const char* dvarName, float value, float min, float max, unsigned int flags,
const char* description)> Dvar_RegisterFloat{ 0x140371C20, 0x1404C0FB0 };
WEAK symbol<dvar_t* (const char* dvarName, int value, int min, int max, unsigned int flags, const char* desc)>
Dvar_RegisterInt{ 0x140371CF0, 0x1404C1080 };
WEAK symbol<dvar_t* (const char* dvarName, const char* value, unsigned int flags, const char* description)>
Dvar_RegisterString{ 0x140372050, 0x1404C1450 };
WEAK symbol<dvar_t* (const char* dvarName, float x, float y, float z, float w, float min, float max,
unsigned int flags, const char* description)> Dvar_RegisterVec4{ 0x140372430, 0x1404C1800 };
WEAK symbol<dvar_t*(const char* dvarName, bool value, unsigned int flags, const char* description)>
Dvar_RegisterBool{0x140371850, 0x1404C0BE0};
WEAK symbol<dvar_t*(const char* dvarName, const char** valueList, int defaultIndex, unsigned int flags,
const char* description)> Dvar_RegisterEnum{0x140371B30, 0x1404C0EC0};
WEAK symbol<dvar_t*(const char* dvarName, float value, float min, float max, unsigned int flags,
const char* description)> Dvar_RegisterFloat{0x140371C20, 0x1404C0FB0};
WEAK symbol<dvar_t*(const char* dvarName, int value, int min, int max, unsigned int flags, const char* desc)>
Dvar_RegisterInt{0x140371CF0, 0x1404C1080};
WEAK symbol<dvar_t*(const char* dvarName, const char* value, unsigned int flags, const char* description)>
Dvar_RegisterString{0x140372050, 0x1404C1450};
WEAK symbol<dvar_t*(const char* dvarName, float x, float y, float z, float w, float min, float max,
unsigned int flags, const char* description)> Dvar_RegisterVec4{0x140372430, 0x1404C1800};
WEAK symbol<DWOnlineStatus()> dwGetLogOnStatus{ 0, 0x14053CCB0 };
WEAK symbol<DWOnlineStatus()> dwGetLogOnStatus{0, 0x14053CCB0};
WEAK symbol<long long(const char* qpath, char** buffer)> FS_ReadFile{ 0x140362390, 0x1404AF380 };
WEAK symbol<void(void* buffer)> FS_FreeFile{ 0x140362380, 0x1404AF370 };
WEAK symbol<long long(const char* qpath, char** buffer)> FS_ReadFile{0x140362390, 0x1404AF380};
WEAK symbol<void(void* buffer)> FS_FreeFile{0x140362380, 0x1404AF370};
WEAK symbol<void()> G_Glass_Update{ 0x14021D540, 0x1402EDEE0 };
WEAK symbol<void()> G_Glass_Update{0x14021D540, 0x1402EDEE0};
WEAK symbol<unsigned int(const char* name)> G_GetWeaponForName{ 0x140274590, 0x14033FF60 };
WEAK symbol<int(playerState_s* ps, unsigned int weapon, int dualWield, int startInAltMode, int, int, int, char, ...)>
G_GivePlayerWeapon{ 0x1402749B0, 0x140340470 };
WEAK symbol<void(playerState_s* ps, unsigned int weapon, int hadWeapon)> G_InitializeAmmo{ 0x1402217F0, 0x1402F22B0 };
WEAK symbol<void(int clientNum, unsigned int weapon)> G_SelectWeapon{ 0x140275380, 0x140340D50 };
WEAK symbol<int(playerState_s* ps, unsigned int weapon)> G_TakePlayerWeapon{ 0x1402754E0, 0x1403411D0 };
WEAK symbol<unsigned int(const char* name)> G_GetWeaponForName{0x140274590, 0x14033FF60};
WEAK symbol<int(playerState_s* ps, unsigned int weapon, int dualWield, int startInAltMode, int, int, int, char,
...)>
G_GivePlayerWeapon{0x1402749B0, 0x140340470};
WEAK symbol<void(playerState_s* ps, unsigned int weapon, int hadWeapon)> G_InitializeAmmo{0x1402217F0, 0x1402F22B0};
WEAK symbol<void(int clientNum, unsigned int weapon)> G_SelectWeapon{0x140275380, 0x140340D50};
WEAK symbol<int(playerState_s* ps, unsigned int weapon)> G_TakePlayerWeapon{0x1402754E0, 0x1403411D0};
WEAK symbol<char* (char* string)> I_CleanStr{ 0x140379010, 0x1404C99A0 };
WEAK symbol<char*(char* string)> I_CleanStr{0x140379010, 0x1404C99A0};
WEAK symbol<const char* (int, int, int)> Key_KeynumToString{ 0x14013F380, 0x140207C50 };
WEAK symbol<const char*(int, int, int)> Key_KeynumToString{0x14013F380, 0x140207C50};
WEAK symbol<unsigned int(int)> Live_SyncOnlineDataFlags{ 0x1404459A0, 0x140562830 };
WEAK symbol<unsigned int(int)> Live_SyncOnlineDataFlags{0x1404459A0, 0x140562830};
WEAK symbol<void(int clientNum, const char* menu, int a3, int a4, unsigned int a5)> LUI_OpenMenu{ 0, 0x14048E450 };
WEAK symbol<void(int clientNum, const char* menu, int a3, int a4, unsigned int a5)> LUI_OpenMenu{0, 0x14048E450};
WEAK symbol<bool(int clientNum, const char* menu)> Menu_IsMenuOpenAndVisible{ 0, 0x140488570 };
WEAK symbol<bool(int clientNum, const char* menu)> Menu_IsMenuOpenAndVisible{0, 0x140488570};
WEAK symbol<Material* (const char* material)> Material_RegisterHandle{ 0x1404919D0, 0x1405AFBE0 };
WEAK symbol<Material*(const char* material)> Material_RegisterHandle{0x1404919D0, 0x1405AFBE0};
WEAK symbol<void(netadr_s*, sockaddr*)> NetadrToSockadr{ 0, 0x1404B6F10 };
WEAK symbol<void(netadr_s*, sockaddr*)> NetadrToSockadr{0, 0x1404B6F10};
WEAK symbol<void(netsrc_t, netadr_s*, const char*)> NET_OutOfBandPrint{ 0, 0x1403DADC0 };
WEAK symbol<void(netsrc_t sock, int length, const void* data, const netadr_s* to)> NET_SendLoopPacket{ 0, 0x1403DAF80 };
WEAK symbol<bool(const char* s, netadr_s* a)> NET_StringToAdr{ 0, 0x1403DB070 };
WEAK symbol<void(netsrc_t, netadr_s*, const char*)> NET_OutOfBandPrint{0, 0x1403DADC0};
WEAK symbol<void(netsrc_t sock, int length, const void* data, const netadr_s* to)> NET_SendLoopPacket{
0, 0x1403DAF80
};
WEAK symbol<bool(const char* s, netadr_s* a)> NET_StringToAdr{0, 0x1403DB070};
WEAK symbol<void(float x, float y, float width, float height, float s0, float t0, float s1, float t1,
float* color, Material* material)> R_AddCmdDrawStretchPic{ 0x1404A2580, 0x1405C0CB0 };
WEAK symbol<void(const char*, int, Font_s*, float, float, float, float, float, float*, int)> R_AddCmdDrawText{ 0x1404A2BF0, 0x1405C1320 };
float* color, Material* material)> R_AddCmdDrawStretchPic{0x1404A2580, 0x1405C0CB0};
WEAK symbol<void(const char*, int, Font_s*, float, float, float, float, float, float*, int)> R_AddCmdDrawText{
0x1404A2BF0, 0x1405C1320
};
WEAK symbol<void(const char*, int, Font_s*, float, float, float, float, float, const float*, int, int, char)>
R_AddCmdDrawTextWithCursor{ 0x1404A35E0, 0x1405C1D10 };
WEAK symbol<Font_s* (const char* font)> R_RegisterFont{ 0x140481F90, 0x14059F3C0 };
WEAK symbol<void()> R_SyncRenderThread{ 0x1404A4D60, 0x1405C34F0 };
WEAK symbol<int(const char* text, int maxChars, Font_s* font)> R_TextWidth{ 0x140482270, 0x14059F6B0 };
R_AddCmdDrawTextWithCursor{0x1404A35E0, 0x1405C1D10};
WEAK symbol<Font_s*(const char* font)> R_RegisterFont{0x140481F90, 0x14059F3C0};
WEAK symbol<void()> R_SyncRenderThread{0x1404A4D60, 0x1405C34F0};
WEAK symbol<int(const char* text, int maxChars, Font_s* font)> R_TextWidth{0x140482270, 0x14059F6B0};
WEAK symbol<ScreenPlacement* ()> ScrPlace_GetViewPlacement{ 0x14014FA70, 0x14023CB50 };
WEAK symbol<ScreenPlacement*()> ScrPlace_GetViewPlacement{0x14014FA70, 0x14023CB50};
WEAK symbol<unsigned int()> Scr_AllocArray{ 0x140317C50, 0x1403F4280 };
WEAK symbol<const float* (const float* v)> Scr_AllocVector{ 0x140317D10, 0x1403F4370 };
WEAK symbol<const char* (int index)> Scr_GetString{ 0x14031C570, 0x1403F8C50 };
WEAK symbol<unsigned int()> Scr_GetInt{ 0x14031C1F0, 0x1403F88D0 };
WEAK symbol<float(int index)> Scr_GetFloat{ 0x14031C090, 0x1403F8820 };
WEAK symbol<int()> Scr_GetNumParam{ 0x14031C2A0, 0x1403F8980 };
WEAK symbol<void()> Scr_ClearOutParams{ 0x14031B7C0, 0x1403F8040 };
WEAK symbol<unsigned int()> Scr_AllocArray{0x140317C50, 0x1403F4280};
WEAK symbol<const float*(const float* v)> Scr_AllocVector{0x140317D10, 0x1403F4370};
WEAK symbol<const char*(int index)> Scr_GetString{0x14031C570, 0x1403F8C50};
WEAK symbol<unsigned int()> Scr_GetInt{0x14031C1F0, 0x1403F88D0};
WEAK symbol<float(int index)> Scr_GetFloat{0x14031C090, 0x1403F8820};
WEAK symbol<int()> Scr_GetNumParam{0x14031C2A0, 0x1403F8980};
WEAK symbol<void()> Scr_ClearOutParams{0x14031B7C0, 0x1403F8040};
WEAK symbol<scr_string_t(const char* str)> SL_FindString{ 0x140314AF0, 0x1403F11C0 };
WEAK symbol<scr_string_t(const char* str)> SL_FindString{0x140314AF0, 0x1403F11C0};
WEAK symbol<void(const char* text_in)> SV_Cmd_TokenizeString{ 0, 0x1403B0640 };
WEAK symbol<void()> SV_Cmd_EndTokenizedString{ 0, 0x1403B0600 };
WEAK symbol<void(const char* text_in)> SV_Cmd_TokenizeString{0, 0x1403B0640};
WEAK symbol<void()> SV_Cmd_EndTokenizedString{0, 0x1403B0600};
WEAK symbol<mp::gentity_s* (const char* name)> SV_AddBot{ 0, 0x140438EC0 };
WEAK symbol<bool(int clientNum)> SV_BotIsBot{ 0, 0x140427300 };
WEAK symbol<mp::gentity_s* (int)> SV_AddTestClient{ 0, 0x140439190 };
WEAK symbol<bool(mp::gentity_s*)> SV_CanSpawnTestClient{ 0, 0x140439460 };
WEAK symbol<int(mp::gentity_s* ent)> SV_SpawnTestClient{ 0, 0x14043C750 };
WEAK symbol<mp::gentity_s*(const char* name)> SV_AddBot{0, 0x140438EC0};
WEAK symbol<bool(int clientNum)> SV_BotIsBot{0, 0x140427300};
WEAK symbol<mp::gentity_s*(int)> SV_AddTestClient{0, 0x140439190};
WEAK symbol<bool(mp::gentity_s*)> SV_CanSpawnTestClient{0, 0x140439460};
WEAK symbol<int(mp::gentity_s* ent)> SV_SpawnTestClient{0, 0x14043C750};
WEAK symbol<void(mp::gentity_s*)> SV_AddEntity{ 0, 0x1403388B0 };
WEAK symbol<void(mp::gentity_s*)> SV_AddEntity{0, 0x1403388B0};
WEAK symbol<void(netadr_s* from)> SV_DirectConnect{ 0, 0x1404397A0 };
WEAK symbol<void(mp::client_t* client)> SV_DropClient{ 0, 0x140438A30 };
WEAK symbol<void(mp::client_t*, const char*, int)> SV_ExecuteClientCommand{ 0, 0x15121D8E6 };
WEAK symbol<void(int localClientNum)> SV_FastRestart{ 0, 0x1404374E0 };
WEAK symbol<void(int clientNum, svscmd_type type, const char* text)> SV_GameSendServerCommand{ 0x1403F3A70, 0x14043E120 };
WEAK symbol<const char* (int clientNum)> SV_GetGuid{ 0, 0x14043E1E0 };
WEAK symbol<playerState_s* (int num)> SV_GetPlayerstateForClientNum{ 0x1403F3AB0, 0x14043E260 };
WEAK symbol<void(int clientNum, const char* reason)> SV_KickClientNum{ 0, 0x1404377A0 };
WEAK symbol<bool()> SV_Loaded{ 0x1403F42C0, 0x14043FA50 };
WEAK symbol<bool(const char* map) >SV_MapExists{ 0, 0x140437800 };
WEAK symbol<void(int localClientNum, const char* map, bool mapIsPreloaded)> SV_StartMap{ 0, 0x140438320 };
WEAK symbol<void(int localClientNum, const char* map, bool mapIsPreloaded, bool migrate)> SV_StartMapForParty{ 0, 0x140438490 };
WEAK symbol<void(netadr_s* from)> SV_DirectConnect{0, 0x1404397A0};
WEAK symbol<void(mp::client_t* client)> SV_DropClient{0, 0x140438A30};
WEAK symbol<void(mp::client_t*, const char*, int)> SV_ExecuteClientCommand{0, 0x15121D8E6};
WEAK symbol<void(int localClientNum)> SV_FastRestart{0, 0x1404374E0};
WEAK symbol<void(int clientNum, svscmd_type type, const char* text)> SV_GameSendServerCommand{
0x1403F3A70, 0x14043E120
};
WEAK symbol<const char*(int clientNum)> SV_GetGuid{0, 0x14043E1E0};
WEAK symbol<playerState_s*(int num)> SV_GetPlayerstateForClientNum{0x1403F3AB0, 0x14043E260};
WEAK symbol<void(int clientNum, const char* reason)> SV_KickClientNum{0, 0x1404377A0};
WEAK symbol<bool()> SV_Loaded{0x1403F42C0, 0x14043FA50};
WEAK symbol<bool(const char* map)> SV_MapExists{0, 0x140437800};
WEAK symbol<void(int localClientNum, const char* map, bool mapIsPreloaded)> SV_StartMap{0, 0x140438320};
WEAK symbol<void(int localClientNum, const char* map, bool mapIsPreloaded, bool migrate)> SV_StartMapForParty{
0, 0x140438490
};
WEAK symbol<void(char* path, int pathSize, Sys_Folder folder, const char* filename, const char* ext)> Sys_BuildAbsPath{ 0x14037BBE0, 0x1404CC7E0 };
WEAK symbol<HANDLE(int folder, const char* baseFileName)> Sys_CreateFile{ 0x14037BCA0, 0x1404CC8A0 };
WEAK symbol<void(const char* error, ...)> Sys_Error{ 0x14038C770, 0x1404D6260 };
WEAK symbol<bool(const char* path)> Sys_FileExists{ 0x14038C810, 0x1404D6310 };
WEAK symbol<bool()> Sys_IsDatabaseReady2{ 0x1402FF980, 0x1403E1840 };
WEAK symbol<int()> Sys_Milliseconds{ 0x14038E9F0, 0x1404D8730 };
WEAK symbol<bool(int, void const*, const netadr_s*)> Sys_SendPacket{ 0x14038E720, 0x1404D8460 };
WEAK symbol<void(Sys_Folder, const char* path)> Sys_SetFolder{ 0x14037BDD0, 0x1404CCA10 };
WEAK symbol<void()> Sys_ShowConsole{ 0x14038FA90, 0x1404D98B0 };
WEAK symbol<void(char* path, int pathSize, Sys_Folder folder, const char* filename, const char* ext)>
Sys_BuildAbsPath{0x14037BBE0, 0x1404CC7E0};
WEAK symbol<HANDLE(int folder, const char* baseFileName)> Sys_CreateFile{0x14037BCA0, 0x1404CC8A0};
WEAK symbol<void(const char* error, ...)> Sys_Error{0x14038C770, 0x1404D6260};
WEAK symbol<bool(const char* path)> Sys_FileExists{0x14038C810, 0x1404D6310};
WEAK symbol<bool()> Sys_IsDatabaseReady2{0x1402FF980, 0x1403E1840};
WEAK symbol<int()> Sys_Milliseconds{0x14038E9F0, 0x1404D8730};
WEAK symbol<bool(int, void const*, const netadr_s*)> Sys_SendPacket{0x14038E720, 0x1404D8460};
WEAK symbol<void(Sys_Folder, const char* path)> Sys_SetFolder{0x14037BDD0, 0x1404CCA10};
WEAK symbol<void()> Sys_ShowConsole{0x14038FA90, 0x1404D98B0};
WEAK symbol<const char* (const char*)> UI_GetMapDisplayName{ 0, 0x1403B1CD0 };
WEAK symbol<const char* (const char*)> UI_GetGameTypeDisplayName{ 0, 0x1403B1670 };
WEAK symbol<void(unsigned int localClientNum, const char** args)> UI_RunMenuScript { 0, 0x140490060 };
WEAK symbol<int(const char* text, int maxChars, Font_s* font, float scale)> UI_TextWidth{ 0, 0x140492380 };
WEAK symbol<const char*(const char*)> UI_GetMapDisplayName{0, 0x1403B1CD0};
WEAK symbol<const char*(const char*)> UI_GetGameTypeDisplayName{0, 0x1403B1670};
WEAK symbol<void(unsigned int localClientNum, const char** args)> UI_RunMenuScript{0, 0x140490060};
WEAK symbol<int(const char* text, int maxChars, Font_s* font, float scale)> UI_TextWidth{0, 0x140492380};
/***************************************************************
* Variables
**************************************************************/
WEAK symbol<int> keyCatchers{ 0x1413D5B00, 0x1417E168C };
WEAK symbol<PlayerKeyState> playerKeys{ 0x1413BC5DC, 0x1417DA46C };
WEAK symbol<int> keyCatchers{0x1413D5B00, 0x1417E168C};
WEAK symbol<PlayerKeyState> playerKeys{0x1413BC5DC, 0x1417DA46C};
WEAK symbol<CmdArgs> cmd_args{ 0x1492EC6F0, 0x1479ECB00 };
WEAK symbol<CmdArgs> sv_cmd_args{ 0x1492EC7A0, 0x1479ECBB0 };
WEAK symbol<cmd_function_s*> cmd_functions{ 0x1492EC848, 0x1479ECC58 };
WEAK symbol<CmdArgs> cmd_args{0x1492EC6F0, 0x1479ECB00};
WEAK symbol<CmdArgs> sv_cmd_args{0x1492EC7A0, 0x1479ECBB0};
WEAK symbol<cmd_function_s*> cmd_functions{0x1492EC848, 0x1479ECC58};
WEAK symbol<int> dvarCount{ 0x14A7BFF34, 0x14B32AA30 };
WEAK symbol<dvar_t*> sortedDvars{ 0x14A7BFF50, 0x14B32AA50 };
WEAK symbol<int> dvarCount{0x14A7BFF34, 0x14B32AA30};
WEAK symbol<dvar_t*> sortedDvars{0x14A7BFF50, 0x14B32AA50};
WEAK symbol<const char*> command_whitelist{ 0x140808EF0, 0x1409B8DC0 };
WEAK symbol<const char*> command_whitelist{0x140808EF0, 0x1409B8DC0};
WEAK symbol<SOCKET> query_socket{ 0, 0x14B5B9180 };
WEAK symbol<SOCKET> query_socket{0, 0x14B5B9180};
WEAK symbol<void*> DB_XAssetPool{ 0x140804690, 0x1409B40D0 };
WEAK symbol<int> g_poolSize{ 0x140804140, 0x1409B4B90 };
WEAK symbol<const char*> g_assetNames{ 0x140803C90 , 0x1409B3180 };
WEAK symbol<void*> DB_XAssetPool{0x140804690, 0x1409B40D0};
WEAK symbol<int> g_poolSize{0x140804140, 0x1409B4B90};
WEAK symbol<const char*> g_assetNames{0x140803C90, 0x1409B3180};
WEAK symbol<DWORD> threadIds{ 0x149632EC0, 0x147DCEA30 };
WEAK symbol<DWORD> threadIds{0x149632EC0, 0x147DCEA30};
WEAK symbol<GfxDrawMethod_s> gfxDrawMethod{ 0x14CDFAFE8, 0x14D80FD98 };
WEAK symbol<GfxDrawMethod_s> gfxDrawMethod{0x14CDFAFE8, 0x14D80FD98};
namespace mp
{
WEAK symbol<gentity_s> g_entities{ 0, 0x144758C70 };
WEAK symbol<client_t> svs_clients{ 0, 0x1496C4B10 };
WEAK symbol<int> svs_numclients{ 0, 0x1496C4B0C };
WEAK symbol<gentity_s> g_entities{0, 0x144758C70};
WEAK symbol<client_t> svs_clients{0, 0x1496C4B10};
WEAK symbol<int> svs_numclients{0, 0x1496C4B0C};
WEAK symbol<int> sv_serverId_value{ 0, 0x1488A9A60 };
WEAK symbol<int> sv_serverId_value{0, 0x1488A9A60};
WEAK symbol<char> virtualLobby_loaded{ 0, 0x1417E161D };
WEAK symbol<char> virtualLobby_loaded{0, 0x1417E161D};
}
namespace sp
{
WEAK symbol<gentity_s> g_entities{ 0x143C26DC0, 0 };
WEAK symbol<gentity_s> g_entities{0x143C26DC0, 0};
}
}

View File

@ -139,7 +139,7 @@ LRESULT window::processor(const UINT message, const WPARAM w_param, const LPARAM
{
const utils::nt::library user32{"user32.dll"};
const auto get_dpi = user32 ? user32.get_proc<UINT(WINAPI *)(HWND)>("GetDpiForWindow") : nullptr;
if (get_dpi)
{
const auto dpi = get_dpi(*this);
@ -192,7 +192,7 @@ LRESULT CALLBACK window::static_processor(HWND hwnd, UINT message, WPARAM w_para
auto data = reinterpret_cast<LPCREATESTRUCT>(l_param);
SetWindowLongPtrA(hwnd, GWLP_USERDATA, LONG_PTR(data->lpCreateParams));
reinterpret_cast<window*>(data->lpCreateParams)->handle_ = hwnd;
static_cast<window*>(data->lpCreateParams)->handle_ = hwnd;
}
const auto self = reinterpret_cast<window*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));

View File

@ -76,10 +76,10 @@ void component_loader::pre_destroy()
void component_loader::clean()
{
auto& components = get_components();
for(auto i = components.begin(); i != components.end();)
auto& components = get_components();
for (auto i = components.begin(); i != components.end();)
{
if(!(*i)->is_supported())
if (!(*i)->is_supported())
{
(*i)->pre_destroy();
i = components.erase(i);
@ -118,10 +118,10 @@ std::vector<std::unique_ptr<component_interface>>& component_loader::get_compone
using component_vector_container = std::unique_ptr<component_vector, std::function<void(component_vector*)>>;
static component_vector_container components(new component_vector, [](component_vector* component_vector)
{
pre_destroy();
delete component_vector;
});
{
pre_destroy();
delete component_vector;
});
return *components;
}

View File

@ -10,7 +10,7 @@ namespace tls
{
utils::binary_resource tls_dll_file(TLS_DLL, "s1x_tlsdll.dll");
}
PIMAGE_TLS_DIRECTORY allocate_tls_index()
{
static auto already_allocated = false;

View File

@ -8,7 +8,7 @@ extern "C"
__declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 1;
};
extern "C"
extern "C"
{
int s_read_arc4random(void*, size_t)
{
@ -29,4 +29,4 @@ extern "C"
{
return -1;
}
}
}

View File

@ -95,4 +95,4 @@
#include "resource.hpp"
using namespace std::literals;
using namespace std::literals;

View File

@ -81,12 +81,12 @@ namespace steam
const auto* operand = ud_insn_opr(&ud, 1);
if (operand && operand->type == UD_OP_MEM && operand->base == UD_R_RIP)
{
auto* operand_ptr = reinterpret_cast<char*>(ud_insn_len(&ud) + ud_insn_off(&ud) + operand->lval.sdword);
auto* operand_ptr = reinterpret_cast<char*>(ud_insn_len(&ud) + ud_insn_off(&ud) + operand->lval.
sdword);
if (!utils::memory::is_bad_read_ptr(operand_ptr) && utils::memory::is_rdata_ptr(operand_ptr))
{
return operand_ptr;
}
}
}

View File

@ -69,7 +69,8 @@ namespace steam
throw std::runtime_error("Invalid interface pointer");
}
return static_cast<T(__thiscall*)(void*, Args ...)>((*this->interface_ptr_)[table_entry])(this->interface_ptr_, args...);
return static_cast<T(__thiscall*)(void*, Args ...)>((*this->interface_ptr_)[table_entry])(
this->interface_ptr_, args...);
}
private:

View File

@ -3,103 +3,102 @@
namespace steam
{
bool apps::BIsSubscribed()
{
return true;
}
bool apps::BIsSubscribed()
{
return true;
}
bool apps::BIsLowViolence()
{
return false;
}
bool apps::BIsLowViolence()
{
return false;
}
bool apps::BIsCybercafe()
{
return false;
}
bool apps::BIsCybercafe()
{
return false;
}
bool apps::BIsVACBanned()
{
return false;
}
bool apps::BIsVACBanned()
{
return false;
}
const char* apps::GetCurrentGameLanguage()
{
return "english";
}
const char* apps::GetCurrentGameLanguage()
{
return "english";
}
const char* apps::GetAvailableGameLanguages()
{
return "english";
}
const char* apps::GetAvailableGameLanguages()
{
return "english";
}
bool apps::BIsSubscribedApp(unsigned int appID)
{
return true;
}
bool apps::BIsSubscribedApp(unsigned int appID)
{
return true;
}
bool apps::BIsDlcInstalled(unsigned int appID)
{
return true;
}
bool apps::BIsDlcInstalled(unsigned int appID)
{
return true;
}
unsigned int apps::GetEarliestPurchaseUnixTime(unsigned int nAppID)
{
return 0;
}
unsigned int apps::GetEarliestPurchaseUnixTime(unsigned int nAppID)
{
return 0;
}
bool apps::BIsSubscribedFromFreeWeekend()
{
return false;
}
bool apps::BIsSubscribedFromFreeWeekend()
{
return false;
}
int apps::GetDLCCount()
{
return 0;
}
int apps::GetDLCCount()
{
return 0;
}
bool apps::BGetDLCDataByIndex(int iDLC, unsigned int* pAppID, bool* pbAvailable, char* pchName,
int cchNameBufferSize)
{
return false;
}
bool apps::BGetDLCDataByIndex(int iDLC, unsigned int* pAppID, bool* pbAvailable, char* pchName, int cchNameBufferSize)
{
return false;
}
void apps::InstallDLC(unsigned int nAppID)
{
}
void apps::InstallDLC(unsigned int nAppID)
{
}
void apps::UninstallDLC(unsigned int nAppID)
{
}
void apps::UninstallDLC(unsigned int nAppID)
{
}
void apps::RequestAppProofOfPurchaseKey(unsigned int nAppID)
{
}
void apps::RequestAppProofOfPurchaseKey(unsigned int nAppID)
{
}
bool apps::GetCurrentBetaName(char* pchName, int cchNameBufferSize)
{
strncpy_s(pchName, cchNameBufferSize, "public", cchNameBufferSize);
return true;
}
bool apps::GetCurrentBetaName(char* pchName, int cchNameBufferSize)
{
strncpy_s(pchName, cchNameBufferSize, "public", cchNameBufferSize);
return true;
}
bool apps::MarkContentCorrupt(bool bMissingFilesOnly)
{
return false;
}
bool apps::MarkContentCorrupt(bool bMissingFilesOnly)
{
return false;
}
unsigned int apps::GetInstalledDepots(int* pvecDepots, unsigned int cMaxDepots)
{
return 0;
}
unsigned int apps::GetInstalledDepots(int* pvecDepots, unsigned int cMaxDepots)
{
return 0;
}
unsigned int apps::GetAppInstallDir(unsigned int appID, char* pchFolder, unsigned int cchFolderBufferSize)
{
return 0;
}
unsigned int apps::GetAppInstallDir(unsigned int appID, char* pchFolder, unsigned int cchFolderBufferSize)
{
return 0;
}
bool apps::BIsAppInstalled(unsigned int appID)
{
return false;
}
} // namespace steam
bool apps::BIsAppInstalled(unsigned int appID)
{
return false;
}
}

View File

@ -2,32 +2,31 @@
namespace steam
{
class apps
{
public:
~apps() = default;
class apps
{
public:
~apps() = default;
virtual bool BIsSubscribed();
virtual bool BIsLowViolence();
virtual bool BIsCybercafe();
virtual bool BIsVACBanned();
virtual const char* GetCurrentGameLanguage();
virtual const char* GetAvailableGameLanguages();
virtual bool BIsSubscribedApp(unsigned int appID);
virtual bool BIsDlcInstalled(unsigned int appID);
virtual unsigned int GetEarliestPurchaseUnixTime(unsigned int nAppID);
virtual bool BIsSubscribedFromFreeWeekend();
virtual int GetDLCCount();
virtual bool BGetDLCDataByIndex(int iDLC, unsigned int* pAppID, bool* pbAvailable, char* pchName, int cchNameBufferSize);
virtual void InstallDLC(unsigned int nAppID);
virtual void UninstallDLC(unsigned int nAppID);
virtual void RequestAppProofOfPurchaseKey(unsigned int nAppID);
virtual bool GetCurrentBetaName(char* pchName, int cchNameBufferSize);
virtual bool MarkContentCorrupt(bool bMissingFilesOnly);
virtual unsigned int GetInstalledDepots(int* pvecDepots, unsigned int cMaxDepots);
virtual unsigned int GetAppInstallDir(unsigned int appID, char* pchFolder, unsigned int cchFolderBufferSize);
virtual bool BIsAppInstalled(unsigned int appID);
};
} // namespace steam
virtual bool BIsSubscribed();
virtual bool BIsLowViolence();
virtual bool BIsCybercafe();
virtual bool BIsVACBanned();
virtual const char* GetCurrentGameLanguage();
virtual const char* GetAvailableGameLanguages();
virtual bool BIsSubscribedApp(unsigned int appID);
virtual bool BIsDlcInstalled(unsigned int appID);
virtual unsigned int GetEarliestPurchaseUnixTime(unsigned int nAppID);
virtual bool BIsSubscribedFromFreeWeekend();
virtual int GetDLCCount();
virtual bool BGetDLCDataByIndex(int iDLC, unsigned int* pAppID, bool* pbAvailable, char* pchName,
int cchNameBufferSize);
virtual void InstallDLC(unsigned int nAppID);
virtual void UninstallDLC(unsigned int nAppID);
virtual void RequestAppProofOfPurchaseKey(unsigned int nAppID);
virtual bool GetCurrentBetaName(char* pchName, int cchNameBufferSize);
virtual bool MarkContentCorrupt(bool bMissingFilesOnly);
virtual unsigned int GetInstalledDepots(int* pvecDepots, unsigned int cMaxDepots);
virtual unsigned int GetAppInstallDir(unsigned int appID, char* pchFolder, unsigned int cchFolderBufferSize);
virtual bool BIsAppInstalled(unsigned int appID);
};
}

View File

@ -3,311 +3,311 @@
namespace steam
{
const char* friends::GetPersonaName()
{
return "1337";
}
const char* friends::GetPersonaName()
{
return "1337";
}
unsigned long long friends::SetPersonaName(const char* pchPersonaName)
{
return 0;
}
unsigned long long friends::SetPersonaName(const char* pchPersonaName)
{
return 0;
}
int friends::GetPersonaState()
{
return 1;
}
int friends::GetPersonaState()
{
return 1;
}
int friends::GetFriendCount(int eFriendFlags)
{
return 0;
}
int friends::GetFriendCount(int eFriendFlags)
{
return 0;
}
steam_id friends::GetFriendByIndex(int iFriend, int iFriendFlags)
{
return steam_id();
}
steam_id friends::GetFriendByIndex(int iFriend, int iFriendFlags)
{
return steam_id();
}
int friends::GetFriendRelationship(steam_id steamIDFriend)
{
return 0;
}
int friends::GetFriendRelationship(steam_id steamIDFriend)
{
return 0;
}
int friends::GetFriendPersonaState(steam_id steamIDFriend)
{
return 0;
}
int friends::GetFriendPersonaState(steam_id steamIDFriend)
{
return 0;
}
const char* friends::GetFriendPersonaName(steam_id steamIDFriend)
{
return "";
}
const char* friends::GetFriendPersonaName(steam_id steamIDFriend)
{
return "";
}
bool friends::GetFriendGamePlayed(steam_id steamIDFriend, void* pFriendGameInfo)
{
return false;
}
bool friends::GetFriendGamePlayed(steam_id steamIDFriend, void* pFriendGameInfo)
{
return false;
}
const char* friends::GetFriendPersonaNameHistory(steam_id steamIDFriend, int iPersonaName)
{
return "";
}
const char* friends::GetFriendPersonaNameHistory(steam_id steamIDFriend, int iPersonaName)
{
return "";
}
bool friends::HasFriend(steam_id steamIDFriend, int eFriendFlags)
{
return false;
}
bool friends::HasFriend(steam_id steamIDFriend, int eFriendFlags)
{
return false;
}
int friends::GetClanCount()
{
return 0;
}
int friends::GetClanCount()
{
return 0;
}
steam_id friends::GetClanByIndex(int iClan)
{
return steam_id();
}
steam_id friends::GetClanByIndex(int iClan)
{
return steam_id();
}
const char* friends::GetClanName(steam_id steamIDClan)
{
return "3arc";
}
const char* friends::GetClanName(steam_id steamIDClan)
{
return "3arc";
}
const char* friends::GetClanTag(steam_id steamIDClan)
{
return this->GetClanName(steamIDClan);
}
const char* friends::GetClanTag(steam_id steamIDClan)
{
return this->GetClanName(steamIDClan);
}
bool friends::GetClanActivityCounts(steam_id steamID, int* pnOnline, int* pnInGame, int* pnChatting)
{
return false;
}
bool friends::GetClanActivityCounts(steam_id steamID, int* pnOnline, int* pnInGame, int* pnChatting)
{
return false;
}
unsigned long long friends::DownloadClanActivityCounts(steam_id groupIDs[], int nIds)
{
return 0;
}
unsigned long long friends::DownloadClanActivityCounts(steam_id groupIDs[], int nIds)
{
return 0;
}
int friends::GetFriendCountFromSource(steam_id steamIDSource)
{
return 0;
}
int friends::GetFriendCountFromSource(steam_id steamIDSource)
{
return 0;
}
steam_id friends::GetFriendFromSourceByIndex(steam_id steamIDSource, int iFriend)
{
return steam_id();
}
steam_id friends::GetFriendFromSourceByIndex(steam_id steamIDSource, int iFriend)
{
return steam_id();
}
bool friends::IsUserInSource(steam_id steamIDUser, steam_id steamIDSource)
{
return false;
}
bool friends::IsUserInSource(steam_id steamIDUser, steam_id steamIDSource)
{
return false;
}
void friends::SetInGameVoiceSpeaking(steam_id steamIDUser, bool bSpeaking)
{
}
void friends::SetInGameVoiceSpeaking(steam_id steamIDUser, bool bSpeaking)
{
}
void friends::ActivateGameOverlay(const char* pchDialog)
{
}
void friends::ActivateGameOverlay(const char* pchDialog)
{
}
void friends::ActivateGameOverlayToUser(const char* pchDialog, steam_id steamID)
{
}
void friends::ActivateGameOverlayToUser(const char* pchDialog, steam_id steamID)
{
}
void friends::ActivateGameOverlayToWebPage(const char* pchURL)
{
}
void friends::ActivateGameOverlayToWebPage(const char* pchURL)
{
}
void friends::ActivateGameOverlayToStore(unsigned int nAppID, unsigned int eFlag)
{
}
void friends::ActivateGameOverlayToStore(unsigned int nAppID, unsigned int eFlag)
{
}
void friends::SetPlayedWith(steam_id steamIDUserPlayedWith)
{
}
void friends::SetPlayedWith(steam_id steamIDUserPlayedWith)
{
}
void friends::ActivateGameOverlayInviteDialog(steam_id steamIDLobby)
{
}
void friends::ActivateGameOverlayInviteDialog(steam_id steamIDLobby)
{
}
int friends::GetSmallFriendAvatar(steam_id steamIDFriend)
{
return 0;
}
int friends::GetSmallFriendAvatar(steam_id steamIDFriend)
{
return 0;
}
int friends::GetMediumFriendAvatar(steam_id steamIDFriend)
{
return 0;
}
int friends::GetMediumFriendAvatar(steam_id steamIDFriend)
{
return 0;
}
int friends::GetLargeFriendAvatar(steam_id steamIDFriend)
{
return 0;
}
int friends::GetLargeFriendAvatar(steam_id steamIDFriend)
{
return 0;
}
bool friends::RequestUserInformation(steam_id steamIDUser, bool bRequireNameOnly)
{
return false;
}
bool friends::RequestUserInformation(steam_id steamIDUser, bool bRequireNameOnly)
{
return false;
}
unsigned long long friends::RequestClanOfficerList(steam_id steamIDClan)
{
return 0;
}
unsigned long long friends::RequestClanOfficerList(steam_id steamIDClan)
{
return 0;
}
steam_id friends::GetClanOwner(steam_id steamIDClan)
{
return steam_id();
}
steam_id friends::GetClanOwner(steam_id steamIDClan)
{
return steam_id();
}
int friends::GetClanOfficerCount(steam_id steamIDClan)
{
return 0;
}
int friends::GetClanOfficerCount(steam_id steamIDClan)
{
return 0;
}
steam_id friends::GetClanOfficerByIndex(steam_id steamIDClan, int iOfficer)
{
return steam_id();
}
steam_id friends::GetClanOfficerByIndex(steam_id steamIDClan, int iOfficer)
{
return steam_id();
}
int friends::GetUserRestrictions()
{
return 0;
}
int friends::GetUserRestrictions()
{
return 0;
}
bool friends::SetRichPresence(const char* pchKey, const char* pchValue)
{
return true;
}
bool friends::SetRichPresence(const char* pchKey, const char* pchValue)
{
return true;
}
void friends::ClearRichPresence()
{
}
void friends::ClearRichPresence()
{
}
const char* friends::GetFriendRichPresence(steam_id steamIDFriend, const char* pchKey)
{
return "";
}
const char* friends::GetFriendRichPresence(steam_id steamIDFriend, const char* pchKey)
{
return "";
}
int friends::GetFriendRichPresenceKeyCount(steam_id steamIDFriend)
{
return 0;
}
int friends::GetFriendRichPresenceKeyCount(steam_id steamIDFriend)
{
return 0;
}
const char* friends::GetFriendRichPresenceKeyByIndex(steam_id steamIDFriend, int iKey)
{
return "a";
}
const char* friends::GetFriendRichPresenceKeyByIndex(steam_id steamIDFriend, int iKey)
{
return "a";
}
void friends::RequestFriendRichPresence(steam_id steamIDFriend)
{
}
void friends::RequestFriendRichPresence(steam_id steamIDFriend)
{
}
bool friends::InviteUserToGame(steam_id steamIDFriend, const char* pchConnectString)
{
return false;
}
bool friends::InviteUserToGame(steam_id steamIDFriend, const char* pchConnectString)
{
return false;
}
int friends::GetCoplayFriendCount()
{
return 0;
}
int friends::GetCoplayFriendCount()
{
return 0;
}
steam_id friends::GetCoplayFriend(int iCoplayFriend)
{
return steam_id();
}
steam_id friends::GetCoplayFriend(int iCoplayFriend)
{
return steam_id();
}
int friends::GetFriendCoplayTime(steam_id steamIDFriend)
{
return 0;
}
int friends::GetFriendCoplayTime(steam_id steamIDFriend)
{
return 0;
}
unsigned int friends::GetFriendCoplayGame(steam_id steamIDFriend)
{
return 0;
}
unsigned int friends::GetFriendCoplayGame(steam_id steamIDFriend)
{
return 0;
}
unsigned long long friends::JoinClanChatRoom(steam_id steamIDClan)
{
return 0;
}
unsigned long long friends::JoinClanChatRoom(steam_id steamIDClan)
{
return 0;
}
bool friends::LeaveClanChatRoom(steam_id steamIDClan)
{
return false;
}
bool friends::LeaveClanChatRoom(steam_id steamIDClan)
{
return false;
}
int friends::GetClanChatMemberCount(steam_id steamIDClan)
{
return 0;
}
int friends::GetClanChatMemberCount(steam_id steamIDClan)
{
return 0;
}
steam_id friends::GetChatMemberByIndex(steam_id steamIDClan, int iUser)
{
return steam_id();
}
steam_id friends::GetChatMemberByIndex(steam_id steamIDClan, int iUser)
{
return steam_id();
}
bool friends::SendClanChatMessage(steam_id steamIDClanChat, const char* pchText)
{
return false;
}
bool friends::SendClanChatMessage(steam_id steamIDClanChat, const char* pchText)
{
return false;
}
int friends::GetClanChatMessage(steam_id steamIDClanChat, int iMessage, void* prgchText, int cchTextMax,
unsigned int* peChatEntryType, steam_id* pSteamIDChatter)
{
return 0;
}
int friends::GetClanChatMessage(steam_id steamIDClanChat, int iMessage, void* prgchText, int cchTextMax, unsigned int* peChatEntryType, steam_id* pSteamIDChatter)
{
return 0;
}
bool friends::IsClanChatAdmin(steam_id steamIDClanChat, steam_id steamIDUser)
{
return false;
}
bool friends::IsClanChatAdmin(steam_id steamIDClanChat, steam_id steamIDUser)
{
return false;
}
bool friends::IsClanChatWindowOpenInSteam(steam_id steamIDClanChat)
{
return false;
}
bool friends::IsClanChatWindowOpenInSteam(steam_id steamIDClanChat)
{
return false;
}
bool friends::OpenClanChatWindowInSteam(steam_id steamIDClanChat)
{
return false;
}
bool friends::OpenClanChatWindowInSteam(steam_id steamIDClanChat)
{
return false;
}
bool friends::CloseClanChatWindowInSteam(steam_id steamIDClanChat)
{
return false;
}
bool friends::CloseClanChatWindowInSteam(steam_id steamIDClanChat)
{
return false;
}
bool friends::SetListenForFriendsMessages(bool bInterceptEnabled)
{
return false;
}
bool friends::SetListenForFriendsMessages(bool bInterceptEnabled)
{
return false;
}
bool friends::ReplyToFriendMessage(steam_id steamIDFriend, const char* pchMsgToSend)
{
return false;
}
bool friends::ReplyToFriendMessage(steam_id steamIDFriend, const char* pchMsgToSend)
{
return false;
}
int friends::GetFriendMessage(steam_id steamIDFriend, int iMessageID, void* pvData, int cubData,
unsigned int* peChatEntryType)
{
return 0;
}
int friends::GetFriendMessage(steam_id steamIDFriend, int iMessageID, void* pvData, int cubData, unsigned int* peChatEntryType)
{
return 0;
}
unsigned long long friends::GetFollowerCount(steam_id steamID)
{
return 0;
}
unsigned long long friends::GetFollowerCount(steam_id steamID)
{
return 0;
}
unsigned long long friends::IsFollowing(steam_id steamID)
{
return 0;
}
unsigned long long friends::IsFollowing(steam_id steamID)
{
return 0;
}
unsigned long long friends::EnumerateFollowingList(unsigned int unStartIndex)
{
return 0;
}
} // namespace steam
unsigned long long friends::EnumerateFollowingList(unsigned int unStartIndex)
{
return 0;
}
}

View File

@ -2,75 +2,75 @@
namespace steam
{
class friends
{
public:
~friends() = default;
class friends
{
public:
~friends() = default;
virtual const char* GetPersonaName();
virtual unsigned long long SetPersonaName(const char* pchPersonaName);
virtual int GetPersonaState();
virtual int GetFriendCount(int eFriendFlags);
virtual steam_id GetFriendByIndex(int iFriend, int iFriendFlags);
virtual int GetFriendRelationship(steam_id steamIDFriend);
virtual int GetFriendPersonaState(steam_id steamIDFriend);
virtual const char* GetFriendPersonaName(steam_id steamIDFriend);
virtual bool GetFriendGamePlayed(steam_id steamIDFriend, void* pFriendGameInfo);
virtual const char* GetFriendPersonaNameHistory(steam_id steamIDFriend, int iPersonaName);
virtual bool HasFriend(steam_id steamIDFriend, int eFriendFlags);
virtual int GetClanCount();
virtual steam_id GetClanByIndex(int iClan);
virtual const char* GetClanName(steam_id steamIDClan);
virtual const char* GetClanTag(steam_id steamIDClan);
virtual bool GetClanActivityCounts(steam_id steamID, int* pnOnline, int* pnInGame, int* pnChatting);
virtual unsigned long long DownloadClanActivityCounts(steam_id groupIDs[], int nIds);
virtual int GetFriendCountFromSource(steam_id steamIDSource);
virtual steam_id GetFriendFromSourceByIndex(steam_id steamIDSource, int iFriend);
virtual bool IsUserInSource(steam_id steamIDUser, steam_id steamIDSource);
virtual void SetInGameVoiceSpeaking(steam_id steamIDUser, bool bSpeaking);
virtual void ActivateGameOverlay(const char* pchDialog);
virtual void ActivateGameOverlayToUser(const char* pchDialog, steam_id steamID);
virtual void ActivateGameOverlayToWebPage(const char* pchURL);
virtual void ActivateGameOverlayToStore(unsigned int nAppID, unsigned int eFlag);
virtual void SetPlayedWith(steam_id steamIDUserPlayedWith);
virtual void ActivateGameOverlayInviteDialog(steam_id steamIDLobby);
virtual int GetSmallFriendAvatar(steam_id steamIDFriend);
virtual int GetMediumFriendAvatar(steam_id steamIDFriend);
virtual int GetLargeFriendAvatar(steam_id steamIDFriend);
virtual bool RequestUserInformation(steam_id steamIDUser, bool bRequireNameOnly);
virtual unsigned long long RequestClanOfficerList(steam_id steamIDClan);
virtual steam_id GetClanOwner(steam_id steamIDClan);
virtual int GetClanOfficerCount(steam_id steamIDClan);
virtual steam_id GetClanOfficerByIndex(steam_id steamIDClan, int iOfficer);
virtual int GetUserRestrictions();
virtual bool SetRichPresence(const char* pchKey, const char* pchValue);
virtual void ClearRichPresence();
virtual const char* GetFriendRichPresence(steam_id steamIDFriend, const char* pchKey);
virtual int GetFriendRichPresenceKeyCount(steam_id steamIDFriend);
virtual const char* GetFriendRichPresenceKeyByIndex(steam_id steamIDFriend, int iKey);
virtual void RequestFriendRichPresence(steam_id steamIDFriend);
virtual bool InviteUserToGame(steam_id steamIDFriend, const char* pchConnectString);
virtual int GetCoplayFriendCount();
virtual steam_id GetCoplayFriend(int iCoplayFriend);
virtual int GetFriendCoplayTime(steam_id steamIDFriend);
virtual unsigned int GetFriendCoplayGame(steam_id steamIDFriend);
virtual unsigned long long JoinClanChatRoom(steam_id steamIDClan);
virtual bool LeaveClanChatRoom(steam_id steamIDClan);
virtual int GetClanChatMemberCount(steam_id steamIDClan);
virtual steam_id GetChatMemberByIndex(steam_id steamIDClan, int iUser);
virtual bool SendClanChatMessage(steam_id steamIDClanChat, const char* pchText);
virtual int GetClanChatMessage(steam_id steamIDClanChat, int iMessage, void* prgchText, int cchTextMax, unsigned int* peChatEntryType, steam_id* pSteamIDChatter);
virtual bool IsClanChatAdmin(steam_id steamIDClanChat, steam_id steamIDUser);
virtual bool IsClanChatWindowOpenInSteam(steam_id steamIDClanChat);
virtual bool OpenClanChatWindowInSteam(steam_id steamIDClanChat);
virtual bool CloseClanChatWindowInSteam(steam_id steamIDClanChat);
virtual bool SetListenForFriendsMessages(bool bInterceptEnabled);
virtual bool ReplyToFriendMessage(steam_id steamIDFriend, const char* pchMsgToSend);
virtual int GetFriendMessage(steam_id steamIDFriend, int iMessageID, void* pvData, int cubData, unsigned int* peChatEntryType);
virtual unsigned long long GetFollowerCount(steam_id steamID);
virtual unsigned long long IsFollowing(steam_id steamID);
virtual unsigned long long EnumerateFollowingList(unsigned int unStartIndex);
};
} // namespace steam
virtual const char* GetPersonaName();
virtual unsigned long long SetPersonaName(const char* pchPersonaName);
virtual int GetPersonaState();
virtual int GetFriendCount(int eFriendFlags);
virtual steam_id GetFriendByIndex(int iFriend, int iFriendFlags);
virtual int GetFriendRelationship(steam_id steamIDFriend);
virtual int GetFriendPersonaState(steam_id steamIDFriend);
virtual const char* GetFriendPersonaName(steam_id steamIDFriend);
virtual bool GetFriendGamePlayed(steam_id steamIDFriend, void* pFriendGameInfo);
virtual const char* GetFriendPersonaNameHistory(steam_id steamIDFriend, int iPersonaName);
virtual bool HasFriend(steam_id steamIDFriend, int eFriendFlags);
virtual int GetClanCount();
virtual steam_id GetClanByIndex(int iClan);
virtual const char* GetClanName(steam_id steamIDClan);
virtual const char* GetClanTag(steam_id steamIDClan);
virtual bool GetClanActivityCounts(steam_id steamID, int* pnOnline, int* pnInGame, int* pnChatting);
virtual unsigned long long DownloadClanActivityCounts(steam_id groupIDs[], int nIds);
virtual int GetFriendCountFromSource(steam_id steamIDSource);
virtual steam_id GetFriendFromSourceByIndex(steam_id steamIDSource, int iFriend);
virtual bool IsUserInSource(steam_id steamIDUser, steam_id steamIDSource);
virtual void SetInGameVoiceSpeaking(steam_id steamIDUser, bool bSpeaking);
virtual void ActivateGameOverlay(const char* pchDialog);
virtual void ActivateGameOverlayToUser(const char* pchDialog, steam_id steamID);
virtual void ActivateGameOverlayToWebPage(const char* pchURL);
virtual void ActivateGameOverlayToStore(unsigned int nAppID, unsigned int eFlag);
virtual void SetPlayedWith(steam_id steamIDUserPlayedWith);
virtual void ActivateGameOverlayInviteDialog(steam_id steamIDLobby);
virtual int GetSmallFriendAvatar(steam_id steamIDFriend);
virtual int GetMediumFriendAvatar(steam_id steamIDFriend);
virtual int GetLargeFriendAvatar(steam_id steamIDFriend);
virtual bool RequestUserInformation(steam_id steamIDUser, bool bRequireNameOnly);
virtual unsigned long long RequestClanOfficerList(steam_id steamIDClan);
virtual steam_id GetClanOwner(steam_id steamIDClan);
virtual int GetClanOfficerCount(steam_id steamIDClan);
virtual steam_id GetClanOfficerByIndex(steam_id steamIDClan, int iOfficer);
virtual int GetUserRestrictions();
virtual bool SetRichPresence(const char* pchKey, const char* pchValue);
virtual void ClearRichPresence();
virtual const char* GetFriendRichPresence(steam_id steamIDFriend, const char* pchKey);
virtual int GetFriendRichPresenceKeyCount(steam_id steamIDFriend);
virtual const char* GetFriendRichPresenceKeyByIndex(steam_id steamIDFriend, int iKey);
virtual void RequestFriendRichPresence(steam_id steamIDFriend);
virtual bool InviteUserToGame(steam_id steamIDFriend, const char* pchConnectString);
virtual int GetCoplayFriendCount();
virtual steam_id GetCoplayFriend(int iCoplayFriend);
virtual int GetFriendCoplayTime(steam_id steamIDFriend);
virtual unsigned int GetFriendCoplayGame(steam_id steamIDFriend);
virtual unsigned long long JoinClanChatRoom(steam_id steamIDClan);
virtual bool LeaveClanChatRoom(steam_id steamIDClan);
virtual int GetClanChatMemberCount(steam_id steamIDClan);
virtual steam_id GetChatMemberByIndex(steam_id steamIDClan, int iUser);
virtual bool SendClanChatMessage(steam_id steamIDClanChat, const char* pchText);
virtual int GetClanChatMessage(steam_id steamIDClanChat, int iMessage, void* prgchText, int cchTextMax,
unsigned int* peChatEntryType, steam_id* pSteamIDChatter);
virtual bool IsClanChatAdmin(steam_id steamIDClanChat, steam_id steamIDUser);
virtual bool IsClanChatWindowOpenInSteam(steam_id steamIDClanChat);
virtual bool OpenClanChatWindowInSteam(steam_id steamIDClanChat);
virtual bool CloseClanChatWindowInSteam(steam_id steamIDClanChat);
virtual bool SetListenForFriendsMessages(bool bInterceptEnabled);
virtual bool ReplyToFriendMessage(steam_id steamIDFriend, const char* pchMsgToSend);
virtual int GetFriendMessage(steam_id steamIDFriend, int iMessageID, void* pvData, int cubData,
unsigned int* peChatEntryType);
virtual unsigned long long GetFollowerCount(steam_id steamID);
virtual unsigned long long IsFollowing(steam_id steamID);
virtual unsigned long long EnumerateFollowingList(unsigned int unStartIndex);
};
}

View File

@ -3,202 +3,202 @@
namespace steam
{
bool game_server::InitGameServer(unsigned int unGameIP, unsigned short unGamePort, unsigned short usQueryPort,
unsigned int unServerFlags, unsigned int nAppID, const char* pchVersion)
{
return true;
}
bool game_server::InitGameServer(unsigned int unGameIP, unsigned short unGamePort, unsigned short usQueryPort, unsigned int unServerFlags, unsigned int nAppID, const char* pchVersion)
{
return true;
}
void game_server::SetProduct(const char* pchProductName)
{
}
void game_server::SetProduct(const char* pchProductName)
{
}
void game_server::SetGameDescription(const char* pchGameDescription)
{
}
void game_server::SetGameDescription(const char* pchGameDescription)
{
}
void game_server::SetModDir(const char* pchModDir)
{
}
void game_server::SetModDir(const char* pchModDir)
{
}
void game_server::SetDedicatedServer(bool bDedicatedServer)
{
}
void game_server::SetDedicatedServer(bool bDedicatedServer)
{
}
void game_server::LogOn(const char* pszAccountName, const char* pszPassword)
{
}
void game_server::LogOn(const char* pszAccountName, const char* pszPassword)
{
}
void game_server::LogOnAnonymous()
{
auto* const retvals = calloc(1, 1);
const auto result = callbacks::register_call();
callbacks::return_call(retvals, 0, 101, result);
}
void game_server::LogOnAnonymous()
{
auto* const retvals = calloc(1, 1);
const auto result = callbacks::register_call();
callbacks::return_call(retvals, 0, 101, result);
}
void game_server::LogOff()
{
}
void game_server::LogOff()
{
}
bool game_server::BLoggedOn()
{
return true;
}
bool game_server::BLoggedOn()
{
return true;
}
bool game_server::BSecure()
{
return false;
}
bool game_server::BSecure()
{
return false;
}
steam_id game_server::GetSteamID()
{
return SteamUser()->GetSteamID();
}
steam_id game_server::GetSteamID()
{
return SteamUser()->GetSteamID();
}
bool game_server::WasRestartRequested()
{
return false;
}
bool game_server::WasRestartRequested()
{
return false;
}
void game_server::SetMaxPlayerCount(int cPlayersMax)
{
}
void game_server::SetMaxPlayerCount(int cPlayersMax)
{
}
void game_server::SetBotPlayerCount(int cBotPlayers)
{
}
void game_server::SetBotPlayerCount(int cBotPlayers)
{
}
void game_server::SetServerName(const char* pszServerName)
{
}
void game_server::SetServerName(const char* pszServerName)
{
}
void game_server::SetMapName(const char* pszMapName)
{
}
void game_server::SetMapName(const char* pszMapName)
{
}
void game_server::SetPasswordProtected(bool bPasswordProtected)
{
}
void game_server::SetPasswordProtected(bool bPasswordProtected)
{
}
void game_server::SetSpectatorPort(unsigned short unSpectatorPort)
{
}
void game_server::SetSpectatorPort(unsigned short unSpectatorPort)
{
}
void game_server::SetSpectatorServerName(const char* pszSpectatorServerName)
{
}
void game_server::SetSpectatorServerName(const char* pszSpectatorServerName)
{
}
void game_server::ClearAllKeyValues()
{
}
void game_server::ClearAllKeyValues()
{
}
void game_server::SetKeyValue(const char* pKey, const char* pValue)
{
}
void game_server::SetKeyValue(const char* pKey, const char* pValue)
{
}
void game_server::SetGameTags(const char* pchGameTags)
{
}
void game_server::SetGameTags(const char* pchGameTags)
{
}
void game_server::SetGameData(const char* pchGameData)
{
}
void game_server::SetGameData(const char* pchGameData)
{
}
void game_server::SetRegion(const char* pchRegionName)
{
}
void game_server::SetRegion(const char* pchRegionName)
{
}
int game_server::SendUserConnectAndAuthenticate(unsigned int unIPClient, const void* pvAuthBlob,
unsigned int cubAuthBlobSize, steam_id* pSteamIDUser)
{
return 0;
}
int game_server::SendUserConnectAndAuthenticate(unsigned int unIPClient, const void* pvAuthBlob, unsigned int cubAuthBlobSize, steam_id* pSteamIDUser)
{
return 0;
}
steam_id game_server::CreateUnauthenticatedUserConnection()
{
return SteamUser()->GetSteamID();
}
steam_id game_server::CreateUnauthenticatedUserConnection()
{
return SteamUser()->GetSteamID();
}
void game_server::SendUserDisconnect(steam_id steamIDUser)
{
}
void game_server::SendUserDisconnect(steam_id steamIDUser)
{
}
bool game_server::BUpdateUserData(steam_id steamIDUser, const char* pchPlayerName, unsigned int uScore)
{
return false;
}
bool game_server::BUpdateUserData(steam_id steamIDUser, const char* pchPlayerName, unsigned int uScore)
{
return false;
}
int game_server::GetAuthSessionTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket)
{
return 0;
}
int game_server::GetAuthSessionTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket)
{
return 0;
}
int game_server::BeginAuthSession(const void* pAuthTicket, int cbAuthTicket, steam_id steamID)
{
return 0;
}
int game_server::BeginAuthSession(const void* pAuthTicket, int cbAuthTicket, steam_id steamID)
{
return 0;
}
void game_server::EndAuthSession(steam_id steamID)
{
}
void game_server::EndAuthSession(steam_id steamID)
{
}
void game_server::CancelAuthTicket(int hAuthTicket)
{
}
void game_server::CancelAuthTicket(int hAuthTicket)
{
}
int game_server::UserHasLicenseForApp(steam_id steamID, unsigned int appID)
{
return 0;
}
int game_server::UserHasLicenseForApp(steam_id steamID, unsigned int appID)
{
return 0;
}
bool game_server::RequestUserGroupStatus(steam_id steamIDUser, steam_id steamIDGroup)
{
return false;
}
bool game_server::RequestUserGroupStatus(steam_id steamIDUser, steam_id steamIDGroup)
{
return false;
}
void game_server::GetGameplayStats()
{
}
void game_server::GetGameplayStats()
{
}
unsigned long long game_server::GetServerReputation()
{
return 0;
}
unsigned long long game_server::GetServerReputation()
{
return 0;
}
unsigned int game_server::GetPublicIP()
{
return 0;
}
unsigned int game_server::GetPublicIP()
{
return 0;
}
bool game_server::HandleIncomingPacket(const void* pData, int cbData, unsigned int srcIP, unsigned short srcPort)
{
return false;
}
bool game_server::HandleIncomingPacket(const void* pData, int cbData, unsigned int srcIP, unsigned short srcPort)
{
return false;
}
int game_server::GetNextOutgoingPacket(void* pOut, int cbMaxOut, unsigned int* pNetAdr, unsigned short* pPort)
{
return 0;
}
int game_server::GetNextOutgoingPacket(void* pOut, int cbMaxOut, unsigned int* pNetAdr, unsigned short* pPort)
{
return 0;
}
void game_server::EnableHeartbeats(bool bActive)
{
}
void game_server::EnableHeartbeats(bool bActive)
{
}
void game_server::SetHeartbeatInterval(int iHeartbeatInterval)
{
}
void game_server::SetHeartbeatInterval(int iHeartbeatInterval)
{
}
void game_server::ForceHeartbeat()
{
}
void game_server::ForceHeartbeat()
{
}
unsigned long long game_server::AssociateWithClan(steam_id clanID)
{
return 0;
}
unsigned long long game_server::AssociateWithClan(steam_id clanID)
{
return 0;
}
unsigned long long game_server::ComputeNewPlayerCompatibility(steam_id steamID)
{
return 0;
}
} // namespace steam
unsigned long long game_server::ComputeNewPlayerCompatibility(steam_id steamID)
{
return 0;
}
}

View File

@ -2,56 +2,56 @@
namespace steam
{
class game_server
{
public:
~game_server() = default;
class game_server
{
public:
~game_server() = default;
virtual bool InitGameServer(unsigned int unGameIP, unsigned short unGamePort, unsigned short usQueryPort, unsigned int unServerFlags, unsigned int nAppID, const char* pchVersion);
virtual void SetProduct(const char* pchProductName);
virtual void SetGameDescription(const char* pchGameDescription);
virtual void SetModDir(const char* pchModDir);
virtual void SetDedicatedServer(bool bDedicatedServer);
virtual void LogOn(const char* pszAccountName, const char* pszPassword);
virtual void LogOnAnonymous();
virtual void LogOff();
virtual bool BLoggedOn();
virtual bool BSecure();
virtual steam_id GetSteamID();
virtual bool WasRestartRequested();
virtual void SetMaxPlayerCount(int cPlayersMax);
virtual void SetBotPlayerCount(int cBotPlayers);
virtual void SetServerName(const char* pszServerName);
virtual void SetMapName(const char* pszMapName);
virtual void SetPasswordProtected(bool bPasswordProtected);
virtual void SetSpectatorPort(unsigned short unSpectatorPort);
virtual void SetSpectatorServerName(const char* pszSpectatorServerName);
virtual void ClearAllKeyValues();
virtual void SetKeyValue(const char* pKey, const char* pValue);
virtual void SetGameTags(const char* pchGameTags);
virtual void SetGameData(const char* pchGameData);
virtual void SetRegion(const char* pchRegionName);
virtual int SendUserConnectAndAuthenticate(unsigned int unIPClient, const void* pvAuthBlob, unsigned int cubAuthBlobSize, steam_id* pSteamIDUser);
virtual steam_id CreateUnauthenticatedUserConnection();
virtual void SendUserDisconnect(steam_id steamIDUser);
virtual bool BUpdateUserData(steam_id steamIDUser, const char* pchPlayerName, unsigned int uScore);
virtual int GetAuthSessionTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket);
virtual int BeginAuthSession(const void* pAuthTicket, int cbAuthTicket, steam_id steamID);
virtual void EndAuthSession(steam_id steamID);
virtual void CancelAuthTicket(int hAuthTicket);
virtual int UserHasLicenseForApp(steam_id steamID, unsigned int appID);
virtual bool RequestUserGroupStatus(steam_id steamIDUser, steam_id steamIDGroup);
virtual void GetGameplayStats();
virtual unsigned long long GetServerReputation();
virtual unsigned int GetPublicIP();
virtual bool HandleIncomingPacket(const void* pData, int cbData, unsigned int srcIP, unsigned short srcPort);
virtual int GetNextOutgoingPacket(void* pOut, int cbMaxOut, unsigned int* pNetAdr, unsigned short* pPort);
virtual void EnableHeartbeats(bool bActive);
virtual void SetHeartbeatInterval(int iHeartbeatInterval);
virtual void ForceHeartbeat();
virtual unsigned long long AssociateWithClan(steam_id clanID);
virtual unsigned long long ComputeNewPlayerCompatibility(steam_id steamID);
};
} // namespace steam
virtual bool InitGameServer(unsigned int unGameIP, unsigned short unGamePort, unsigned short usQueryPort,
unsigned int unServerFlags, unsigned int nAppID, const char* pchVersion);
virtual void SetProduct(const char* pchProductName);
virtual void SetGameDescription(const char* pchGameDescription);
virtual void SetModDir(const char* pchModDir);
virtual void SetDedicatedServer(bool bDedicatedServer);
virtual void LogOn(const char* pszAccountName, const char* pszPassword);
virtual void LogOnAnonymous();
virtual void LogOff();
virtual bool BLoggedOn();
virtual bool BSecure();
virtual steam_id GetSteamID();
virtual bool WasRestartRequested();
virtual void SetMaxPlayerCount(int cPlayersMax);
virtual void SetBotPlayerCount(int cBotPlayers);
virtual void SetServerName(const char* pszServerName);
virtual void SetMapName(const char* pszMapName);
virtual void SetPasswordProtected(bool bPasswordProtected);
virtual void SetSpectatorPort(unsigned short unSpectatorPort);
virtual void SetSpectatorServerName(const char* pszSpectatorServerName);
virtual void ClearAllKeyValues();
virtual void SetKeyValue(const char* pKey, const char* pValue);
virtual void SetGameTags(const char* pchGameTags);
virtual void SetGameData(const char* pchGameData);
virtual void SetRegion(const char* pchRegionName);
virtual int SendUserConnectAndAuthenticate(unsigned int unIPClient, const void* pvAuthBlob,
unsigned int cubAuthBlobSize, steam_id* pSteamIDUser);
virtual steam_id CreateUnauthenticatedUserConnection();
virtual void SendUserDisconnect(steam_id steamIDUser);
virtual bool BUpdateUserData(steam_id steamIDUser, const char* pchPlayerName, unsigned int uScore);
virtual int GetAuthSessionTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket);
virtual int BeginAuthSession(const void* pAuthTicket, int cbAuthTicket, steam_id steamID);
virtual void EndAuthSession(steam_id steamID);
virtual void CancelAuthTicket(int hAuthTicket);
virtual int UserHasLicenseForApp(steam_id steamID, unsigned int appID);
virtual bool RequestUserGroupStatus(steam_id steamIDUser, steam_id steamIDGroup);
virtual void GetGameplayStats();
virtual unsigned long long GetServerReputation();
virtual unsigned int GetPublicIP();
virtual bool HandleIncomingPacket(const void* pData, int cbData, unsigned int srcIP, unsigned short srcPort);
virtual int GetNextOutgoingPacket(void* pOut, int cbMaxOut, unsigned int* pNetAdr, unsigned short* pPort);
virtual void EnableHeartbeats(bool bActive);
virtual void SetHeartbeatInterval(int iHeartbeatInterval);
virtual void ForceHeartbeat();
virtual unsigned long long AssociateWithClan(steam_id clanID);
virtual unsigned long long ComputeNewPlayerCompatibility(steam_id steamID);
};
}

View File

@ -3,231 +3,228 @@
namespace steam
{
int matchmaking::GetFavoriteGameCount()
{
return 0;
}
int matchmaking::GetFavoriteGameCount()
{
return 0;
}
bool matchmaking::GetFavoriteGame(int iGame, unsigned int* pnAppID, unsigned int* pnIP, unsigned short* pnConnPort,
unsigned short* pnQueryPort, unsigned int* punFlags,
unsigned int* pRTime32LastPlayedOnServer)
{
return false;
}
bool matchmaking::GetFavoriteGame(int iGame, unsigned int* pnAppID, unsigned int* pnIP, unsigned short* pnConnPort,
unsigned short* pnQueryPort, unsigned int* punFlags,
unsigned int* pRTime32LastPlayedOnServer)
{
return false;
}
int matchmaking::AddFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort,
unsigned short nQueryPort, unsigned int unFlags,
unsigned int rTime32LastPlayedOnServer)
{
return 0;
}
int matchmaking::AddFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort,
unsigned short nQueryPort, unsigned int unFlags,
unsigned int rTime32LastPlayedOnServer)
{
return 0;
}
bool matchmaking::RemoveFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort,
unsigned short nQueryPort, unsigned int unFlags)
{
return false;
}
bool matchmaking::RemoveFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort,
unsigned short nQueryPort, unsigned int unFlags)
{
return false;
}
unsigned long long matchmaking::RequestLobbyList()
{
return 0;
}
unsigned long long matchmaking::RequestLobbyList()
{
return 0;
}
void matchmaking::AddRequestLobbyListStringFilter(const char* pchKeyToMatch, const char* pchValueToMatch,
int eComparisonType)
{
}
void matchmaking::AddRequestLobbyListStringFilter(const char* pchKeyToMatch, const char* pchValueToMatch,
int eComparisonType)
{
}
void matchmaking::AddRequestLobbyListNumericalFilter(const char* pchKeyToMatch, int nValueToMatch,
int eComparisonType)
{
}
void matchmaking::AddRequestLobbyListNumericalFilter(const char* pchKeyToMatch, int nValueToMatch,
int eComparisonType)
{
}
void matchmaking::AddRequestLobbyListNearValueFilter(const char* pchKeyToMatch, int nValueToBeCloseTo)
{
}
void matchmaking::AddRequestLobbyListNearValueFilter(const char* pchKeyToMatch, int nValueToBeCloseTo)
{
}
void matchmaking::AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable)
{
}
void matchmaking::AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable)
{
}
void matchmaking::AddRequestLobbyListDistanceFilter(int eLobbyDistanceFilter)
{
}
void matchmaking::AddRequestLobbyListDistanceFilter(int eLobbyDistanceFilter)
{
}
void matchmaking::AddRequestLobbyListResultCountFilter(int cMaxResults)
{
}
void matchmaking::AddRequestLobbyListResultCountFilter(int cMaxResults)
{
}
void matchmaking::AddRequestLobbyListCompatibleMembersFilter(steam_id steamID)
{
}
void matchmaking::AddRequestLobbyListCompatibleMembersFilter(steam_id steamID)
{
}
steam_id matchmaking::GetLobbyByIndex(int iLobby)
{
steam_id id;
steam_id matchmaking::GetLobbyByIndex(int iLobby)
{
steam_id id;
id.raw.account_id = SteamUser()->GetSteamID().raw.account_id;
id.raw.universe = 1;
id.raw.account_type = 8;
id.raw.account_instance = 0x40000;
id.raw.account_id = SteamUser()->GetSteamID().raw.account_id;
id.raw.universe = 1;
id.raw.account_type = 8;
id.raw.account_instance = 0x40000;
return id;
}
return id;
}
unsigned long long matchmaking::CreateLobby(int eLobbyType, int cMaxMembers)
{
const auto result = callbacks::register_call();
auto retvals = static_cast<lobby_created*>(calloc(1, sizeof(lobby_created)));
//::Utils::Memory::AllocateArray<LobbyCreated>();
steam_id id;
unsigned long long matchmaking::CreateLobby(int eLobbyType, int cMaxMembers)
{
const auto result = callbacks::register_call();
auto retvals = static_cast<lobby_created*>(calloc(1, sizeof(lobby_created)));
//::Utils::Memory::AllocateArray<LobbyCreated>();
steam_id id;
id.raw.account_id = SteamUser()->GetSteamID().raw.account_id;
id.raw.universe = 1;
id.raw.account_type = 8;
id.raw.account_instance = 0x40000;
id.raw.account_id = SteamUser()->GetSteamID().raw.account_id;
id.raw.universe = 1;
id.raw.account_type = 8;
id.raw.account_instance = 0x40000;
retvals->m_e_result = 1;
retvals->m_ul_steam_id_lobby = id;
retvals->m_e_result = 1;
retvals->m_ul_steam_id_lobby = id;
callbacks::return_call(retvals, sizeof(lobby_created), lobby_created::callback_id, result);
callbacks::return_call(retvals, sizeof(lobby_created), lobby_created::callback_id, result);
matchmaking::JoinLobby(id);
matchmaking::JoinLobby(id);
return result;
}
return result;
}
unsigned long long matchmaking::JoinLobby(steam_id steamIDLobby)
{
const auto result = callbacks::register_call();
auto* retvals = static_cast<lobby_enter*>(calloc(1, sizeof(lobby_enter)));
//::Utils::Memory::AllocateArray<LobbyEnter>();
retvals->m_b_locked = false;
retvals->m_e_chat_room_enter_response = 1;
retvals->m_rgf_chat_permissions = 0xFFFFFFFF;
retvals->m_ul_steam_id_lobby = steamIDLobby;
unsigned long long matchmaking::JoinLobby(steam_id steamIDLobby)
{
const auto result = callbacks::register_call();
auto* retvals = static_cast<lobby_enter*>(calloc(1, sizeof(lobby_enter)));
//::Utils::Memory::AllocateArray<LobbyEnter>();
retvals->m_b_locked = false;
retvals->m_e_chat_room_enter_response = 1;
retvals->m_rgf_chat_permissions = 0xFFFFFFFF;
retvals->m_ul_steam_id_lobby = steamIDLobby;
callbacks::return_call(retvals, sizeof(lobby_enter), lobby_enter::callback_id, result);
callbacks::return_call(retvals, sizeof(lobby_enter), lobby_enter::callback_id, result);
return result;
}
return result;
}
void matchmaking::LeaveLobby(steam_id steamIDLobby)
{
}
void matchmaking::LeaveLobby(steam_id steamIDLobby)
{
bool matchmaking::InviteUserToLobby(steam_id steamIDLobby, steam_id steamIDInvitee)
{
return true;
}
}
int matchmaking::GetNumLobbyMembers(steam_id steamIDLobby)
{
return 1;
}
bool matchmaking::InviteUserToLobby(steam_id steamIDLobby, steam_id steamIDInvitee)
{
return true;
}
steam_id matchmaking::GetLobbyMemberByIndex(steam_id steamIDLobby, int iMember)
{
return SteamUser()->GetSteamID();
}
int matchmaking::GetNumLobbyMembers(steam_id steamIDLobby)
{
return 1;
}
const char* matchmaking::GetLobbyData(steam_id steamIDLobby, const char* pchKey)
{
return "";
}
steam_id matchmaking::GetLobbyMemberByIndex(steam_id steamIDLobby, int iMember)
{
return SteamUser()->GetSteamID();
}
bool matchmaking::SetLobbyData(steam_id steamIDLobby, const char* pchKey, const char* pchValue)
{
return true;
}
const char* matchmaking::GetLobbyData(steam_id steamIDLobby, const char* pchKey)
{
return "";
}
int matchmaking::GetLobbyDataCount(steam_id steamIDLobby)
{
return 0;
}
bool matchmaking::SetLobbyData(steam_id steamIDLobby, const char* pchKey, const char* pchValue)
{
return true;
}
bool matchmaking::GetLobbyDataByIndex(steam_id steamIDLobby, int iLobbyData, char* pchKey, int cchKeyBufferSize,
char* pchValue, int cchValueBufferSize)
{
return true;
}
int matchmaking::GetLobbyDataCount(steam_id steamIDLobby)
{
return 0;
}
bool matchmaking::DeleteLobbyData(steam_id steamIDLobby, const char* pchKey)
{
return true;
}
bool matchmaking::GetLobbyDataByIndex(steam_id steamIDLobby, int iLobbyData, char* pchKey, int cchKeyBufferSize,
char* pchValue, int cchValueBufferSize)
{
return true;
}
const char* matchmaking::GetLobbyMemberData(steam_id steamIDLobby, steam_id steamIDUser, const char* pchKey)
{
return "";
}
bool matchmaking::DeleteLobbyData(steam_id steamIDLobby, const char* pchKey)
{
return true;
}
void matchmaking::SetLobbyMemberData(steam_id steamIDLobby, const char* pchKey, const char* pchValue)
{
}
const char* matchmaking::GetLobbyMemberData(steam_id steamIDLobby, steam_id steamIDUser, const char* pchKey)
{
return "";
}
bool matchmaking::SendLobbyChatMsg(steam_id steamIDLobby, const void* pvMsgBody, int cubMsgBody)
{
return true;
}
void matchmaking::SetLobbyMemberData(steam_id steamIDLobby, const char* pchKey, const char* pchValue)
{
}
int matchmaking::GetLobbyChatEntry(steam_id steamIDLobby, int iChatID, steam_id* pSteamIDUser, void* pvData,
int cubData, int* peChatEntryType)
{
return 0;
}
bool matchmaking::SendLobbyChatMsg(steam_id steamIDLobby, const void* pvMsgBody, int cubMsgBody)
{
return true;
}
bool matchmaking::RequestLobbyData(steam_id steamIDLobby)
{
return true;
}
int matchmaking::GetLobbyChatEntry(steam_id steamIDLobby, int iChatID, steam_id* pSteamIDUser, void* pvData,
int cubData, int* peChatEntryType)
{
return 0;
}
void matchmaking::SetLobbyGameServer(steam_id steamIDLobby, unsigned int unGameServerIP,
unsigned short unGameServerPort, steam_id steamIDGameServer)
{
}
bool matchmaking::RequestLobbyData(steam_id steamIDLobby)
{
return true;
}
bool matchmaking::GetLobbyGameServer(steam_id steamIDLobby, unsigned int* punGameServerIP,
unsigned short* punGameServerPort, steam_id* psteamIDGameServer)
{
return true;
}
void matchmaking::SetLobbyGameServer(steam_id steamIDLobby, unsigned int unGameServerIP,
unsigned short unGameServerPort, steam_id steamIDGameServer)
{
}
bool matchmaking::SetLobbyMemberLimit(steam_id steamIDLobby, int cMaxMembers)
{
return true;
}
bool matchmaking::GetLobbyGameServer(steam_id steamIDLobby, unsigned int* punGameServerIP,
unsigned short* punGameServerPort, steam_id* psteamIDGameServer)
{
return true;
}
int matchmaking::GetLobbyMemberLimit(steam_id steamIDLobby)
{
return 0;
}
bool matchmaking::SetLobbyMemberLimit(steam_id steamIDLobby, int cMaxMembers)
{
return true;
}
bool matchmaking::SetLobbyType(steam_id steamIDLobby, int eLobbyType)
{
return true;
}
int matchmaking::GetLobbyMemberLimit(steam_id steamIDLobby)
{
return 0;
}
bool matchmaking::SetLobbyJoinable(steam_id steamIDLobby, bool bLobbyJoinable)
{
return true;
}
bool matchmaking::SetLobbyType(steam_id steamIDLobby, int eLobbyType)
{
return true;
}
steam_id matchmaking::GetLobbyOwner(steam_id steamIDLobby)
{
return SteamUser()->GetSteamID();
}
bool matchmaking::SetLobbyJoinable(steam_id steamIDLobby, bool bLobbyJoinable)
{
return true;
}
bool matchmaking::SetLobbyOwner(steam_id steamIDLobby, steam_id steamIDNewOwner)
{
return true;
}
steam_id matchmaking::GetLobbyOwner(steam_id steamIDLobby)
{
return SteamUser()->GetSteamID();
}
bool matchmaking::SetLobbyOwner(steam_id steamIDLobby, steam_id steamIDNewOwner)
{
return true;
}
bool matchmaking::SetLinkedLobby(steam_id steamIDLobby, steam_id steamIDLobby2)
{
return true;
}
} // namespace steam
bool matchmaking::SetLinkedLobby(steam_id steamIDLobby, steam_id steamIDLobby2)
{
return true;
}
}

View File

@ -2,80 +2,78 @@
namespace steam
{
struct lobby_created final
{
enum { callback_id = 513 };
struct lobby_created final
{
enum { callback_id = 513 };
int m_e_result;
int m_pad;
steam_id m_ul_steam_id_lobby;
};
int m_e_result;
int m_pad;
steam_id m_ul_steam_id_lobby;
};
struct lobby_enter final
{
enum { callback_id = 504 };
struct lobby_enter final
{
enum { callback_id = 504 };
steam_id m_ul_steam_id_lobby;
int m_rgf_chat_permissions;
bool m_b_locked;
int m_e_chat_room_enter_response;
};
steam_id m_ul_steam_id_lobby;
int m_rgf_chat_permissions;
bool m_b_locked;
int m_e_chat_room_enter_response;
};
class matchmaking
{
public:
~matchmaking() = default;
class matchmaking
{
public:
~matchmaking() = default;
virtual int GetFavoriteGameCount();
virtual bool GetFavoriteGame(int iGame, unsigned int* pnAppID, unsigned int* pnIP, unsigned short* pnConnPort,
unsigned short* pnQueryPort, unsigned int* punFlags,
unsigned int* pRTime32LastPlayedOnServer);
virtual int AddFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort,
unsigned short nQueryPort, unsigned int unFlags,
unsigned int rTime32LastPlayedOnServer);
virtual bool RemoveFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort,
unsigned short nQueryPort, unsigned int unFlags);
virtual unsigned long long RequestLobbyList();
virtual void AddRequestLobbyListStringFilter(const char* pchKeyToMatch, const char* pchValueToMatch,
int eComparisonType);
virtual void AddRequestLobbyListNumericalFilter(const char* pchKeyToMatch, int nValueToMatch,
int eComparisonType);
virtual void AddRequestLobbyListNearValueFilter(const char* pchKeyToMatch, int nValueToBeCloseTo);
virtual void AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable);
virtual void AddRequestLobbyListDistanceFilter(int eLobbyDistanceFilter);
virtual void AddRequestLobbyListResultCountFilter(int cMaxResults);
virtual void AddRequestLobbyListCompatibleMembersFilter(steam_id steamID);
virtual steam_id GetLobbyByIndex(int iLobby);
virtual unsigned long long CreateLobby(int eLobbyType, int cMaxMembers);
virtual unsigned long long JoinLobby(steam_id steamIDLobby);
virtual void LeaveLobby(steam_id steamIDLobby);
virtual bool InviteUserToLobby(steam_id steamIDLobby, steam_id steamIDInvitee);
virtual int GetNumLobbyMembers(steam_id steamIDLobby);
virtual steam_id GetLobbyMemberByIndex(steam_id steamIDLobby, int iMember);
virtual const char* GetLobbyData(steam_id steamIDLobby, const char* pchKey);
virtual bool SetLobbyData(steam_id steamIDLobby, const char* pchKey, const char* pchValue);
virtual int GetLobbyDataCount(steam_id steamIDLobby);
virtual bool GetLobbyDataByIndex(steam_id steamIDLobby, int iLobbyData, char* pchKey, int cchKeyBufferSize,
char* pchValue, int cchValueBufferSize);
virtual bool DeleteLobbyData(steam_id steamIDLobby, const char* pchKey);
virtual const char* GetLobbyMemberData(steam_id steamIDLobby, steam_id steamIDUser, const char* pchKey);
virtual void SetLobbyMemberData(steam_id steamIDLobby, const char* pchKey, const char* pchValue);
virtual bool SendLobbyChatMsg(steam_id steamIDLobby, const void* pvMsgBody, int cubMsgBody);
virtual int GetLobbyChatEntry(steam_id steamIDLobby, int iChatID, steam_id* pSteamIDUser, void* pvData,
int cubData, int* peChatEntryType);
virtual bool RequestLobbyData(steam_id steamIDLobby);
virtual void SetLobbyGameServer(steam_id steamIDLobby, unsigned int unGameServerIP,
unsigned short unGameServerPort, steam_id steamIDGameServer);
virtual bool GetLobbyGameServer(steam_id steamIDLobby, unsigned int* punGameServerIP,
unsigned short* punGameServerPort, steam_id* psteamIDGameServer);
virtual bool SetLobbyMemberLimit(steam_id steamIDLobby, int cMaxMembers);
virtual int GetLobbyMemberLimit(steam_id steamIDLobby);
virtual bool SetLobbyType(steam_id steamIDLobby, int eLobbyType);
virtual bool SetLobbyJoinable(steam_id steamIDLobby, bool bLobbyJoinable);
virtual steam_id GetLobbyOwner(steam_id steamIDLobby);
virtual bool SetLobbyOwner(steam_id steamIDLobby, steam_id steamIDNewOwner);
virtual bool SetLinkedLobby(steam_id steamIDLobby, steam_id steamIDLobby2);
};
} // namespace steam
virtual int GetFavoriteGameCount();
virtual bool GetFavoriteGame(int iGame, unsigned int* pnAppID, unsigned int* pnIP, unsigned short* pnConnPort,
unsigned short* pnQueryPort, unsigned int* punFlags,
unsigned int* pRTime32LastPlayedOnServer);
virtual int AddFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort,
unsigned short nQueryPort, unsigned int unFlags,
unsigned int rTime32LastPlayedOnServer);
virtual bool RemoveFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort,
unsigned short nQueryPort, unsigned int unFlags);
virtual unsigned long long RequestLobbyList();
virtual void AddRequestLobbyListStringFilter(const char* pchKeyToMatch, const char* pchValueToMatch,
int eComparisonType);
virtual void AddRequestLobbyListNumericalFilter(const char* pchKeyToMatch, int nValueToMatch,
int eComparisonType);
virtual void AddRequestLobbyListNearValueFilter(const char* pchKeyToMatch, int nValueToBeCloseTo);
virtual void AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable);
virtual void AddRequestLobbyListDistanceFilter(int eLobbyDistanceFilter);
virtual void AddRequestLobbyListResultCountFilter(int cMaxResults);
virtual void AddRequestLobbyListCompatibleMembersFilter(steam_id steamID);
virtual steam_id GetLobbyByIndex(int iLobby);
virtual unsigned long long CreateLobby(int eLobbyType, int cMaxMembers);
virtual unsigned long long JoinLobby(steam_id steamIDLobby);
virtual void LeaveLobby(steam_id steamIDLobby);
virtual bool InviteUserToLobby(steam_id steamIDLobby, steam_id steamIDInvitee);
virtual int GetNumLobbyMembers(steam_id steamIDLobby);
virtual steam_id GetLobbyMemberByIndex(steam_id steamIDLobby, int iMember);
virtual const char* GetLobbyData(steam_id steamIDLobby, const char* pchKey);
virtual bool SetLobbyData(steam_id steamIDLobby, const char* pchKey, const char* pchValue);
virtual int GetLobbyDataCount(steam_id steamIDLobby);
virtual bool GetLobbyDataByIndex(steam_id steamIDLobby, int iLobbyData, char* pchKey, int cchKeyBufferSize,
char* pchValue, int cchValueBufferSize);
virtual bool DeleteLobbyData(steam_id steamIDLobby, const char* pchKey);
virtual const char* GetLobbyMemberData(steam_id steamIDLobby, steam_id steamIDUser, const char* pchKey);
virtual void SetLobbyMemberData(steam_id steamIDLobby, const char* pchKey, const char* pchValue);
virtual bool SendLobbyChatMsg(steam_id steamIDLobby, const void* pvMsgBody, int cubMsgBody);
virtual int GetLobbyChatEntry(steam_id steamIDLobby, int iChatID, steam_id* pSteamIDUser, void* pvData,
int cubData, int* peChatEntryType);
virtual bool RequestLobbyData(steam_id steamIDLobby);
virtual void SetLobbyGameServer(steam_id steamIDLobby, unsigned int unGameServerIP,
unsigned short unGameServerPort, steam_id steamIDGameServer);
virtual bool GetLobbyGameServer(steam_id steamIDLobby, unsigned int* punGameServerIP,
unsigned short* punGameServerPort, steam_id* psteamIDGameServer);
virtual bool SetLobbyMemberLimit(steam_id steamIDLobby, int cMaxMembers);
virtual int GetLobbyMemberLimit(steam_id steamIDLobby);
virtual bool SetLobbyType(steam_id steamIDLobby, int eLobbyType);
virtual bool SetLobbyJoinable(steam_id steamIDLobby, bool bLobbyJoinable);
virtual steam_id GetLobbyOwner(steam_id steamIDLobby);
virtual bool SetLobbyOwner(steam_id steamIDLobby, steam_id steamIDNewOwner);
virtual bool SetLinkedLobby(steam_id steamIDLobby, steam_id steamIDLobby2);
};
}

View File

@ -3,121 +3,119 @@
namespace steam
{
bool networking::SendP2PPacket(steam_id steamIDRemote, const void* pubData, unsigned int cubData, int eP2PSendType)
{
return false;
}
bool networking::SendP2PPacket(steam_id steamIDRemote, const void* pubData, unsigned int cubData, int eP2PSendType)
{
return false;
}
bool networking::IsP2PPacketAvailable(unsigned int* pcubMsgSize, int idk)
{
return false;
}
bool networking::IsP2PPacketAvailable(unsigned int* pcubMsgSize, int idk)
{
return false;
}
bool networking::ReadP2PPacket(void* pubDest, unsigned int cubDest, unsigned int* pcubMsgSize,
steam_id* psteamIDRemote)
{
return false;
}
bool networking::ReadP2PPacket(void* pubDest, unsigned int cubDest, unsigned int* pcubMsgSize,
steam_id* psteamIDRemote)
{
return false;
}
bool networking::AcceptP2PSessionWithUser(steam_id steamIDRemote)
{
return false;
}
bool networking::AcceptP2PSessionWithUser(steam_id steamIDRemote)
{
return false;
}
bool networking::CloseP2PSessionWithUser(steam_id steamIDRemote)
{
return false;
}
bool networking::CloseP2PSessionWithUser(steam_id steamIDRemote)
{
return false;
}
bool networking::CloseP2PChannelWithUser(steam_id steamIDRemote, int iVirtualPort)
{
return false;
}
bool networking::CloseP2PChannelWithUser(steam_id steamIDRemote, int iVirtualPort)
{
return false;
}
bool networking::GetP2PSessionState(steam_id steamIDRemote, void* pConnectionState)
{
return false;
}
bool networking::GetP2PSessionState(steam_id steamIDRemote, void* pConnectionState)
{
return false;
}
bool networking::AllowP2PPacketRelay(bool bAllow)
{
return false;
}
bool networking::AllowP2PPacketRelay(bool bAllow)
{
return false;
}
unsigned int networking::CreateListenSocket(int nVirtualP2PPort, unsigned int nIP, unsigned short nPort,
bool bAllowUseOfPacketRelay)
{
return NULL;
}
unsigned int networking::CreateListenSocket(int nVirtualP2PPort, unsigned int nIP, unsigned short nPort,
bool bAllowUseOfPacketRelay)
{
return NULL;
}
unsigned int networking::CreateP2PConnectionSocket(steam_id steamIDTarget, int nVirtualPort, int nTimeoutSec,
bool bAllowUseOfPacketRelay)
{
return NULL;
}
unsigned int networking::CreateP2PConnectionSocket(steam_id steamIDTarget, int nVirtualPort, int nTimeoutSec,
bool bAllowUseOfPacketRelay)
{
return NULL;
}
unsigned int networking::CreateConnectionSocket(unsigned int nIP, unsigned short nPort, int nTimeoutSec)
{
return NULL;
}
unsigned int networking::CreateConnectionSocket(unsigned int nIP, unsigned short nPort, int nTimeoutSec)
{
return NULL;
}
bool networking::DestroySocket(unsigned int hSocket, bool bNotifyRemoteEnd)
{
return false;
}
bool networking::DestroySocket(unsigned int hSocket, bool bNotifyRemoteEnd)
{
return false;
}
bool networking::DestroyListenSocket(unsigned int hSocket, bool bNotifyRemoteEnd)
{
return false;
}
bool networking::DestroyListenSocket(unsigned int hSocket, bool bNotifyRemoteEnd)
{
return false;
}
bool networking::SendDataOnSocket(unsigned int hSocket, void* pubData, unsigned int cubData, bool bReliable)
{
return false;
}
bool networking::SendDataOnSocket(unsigned int hSocket, void* pubData, unsigned int cubData, bool bReliable)
{
return false;
}
bool networking::IsDataAvailableOnSocket(unsigned int hSocket, unsigned int* pcubMsgSize)
{
return false;
}
bool networking::IsDataAvailableOnSocket(unsigned int hSocket, unsigned int* pcubMsgSize)
{
return false;
}
bool networking::RetrieveDataFromSocket(unsigned int hSocket, void* pubDest, unsigned int cubDest,
unsigned int* pcubMsgSize)
{
return false;
}
bool networking::RetrieveDataFromSocket(unsigned int hSocket, void* pubDest, unsigned int cubDest,
unsigned int* pcubMsgSize)
{
return false;
}
bool networking::IsDataAvailable(unsigned int hListenSocket, unsigned int* pcubMsgSize, unsigned int* phSocket)
{
return false;
}
bool networking::IsDataAvailable(unsigned int hListenSocket, unsigned int* pcubMsgSize, unsigned int* phSocket)
{
return false;
}
bool networking::RetrieveData(unsigned int hListenSocket, void* pubDest, unsigned int cubDest,
unsigned int* pcubMsgSize, unsigned int* phSocket)
{
return false;
}
bool networking::RetrieveData(unsigned int hListenSocket, void* pubDest, unsigned int cubDest,
unsigned int* pcubMsgSize, unsigned int* phSocket)
{
return false;
}
bool networking::GetSocketInfo(unsigned int hSocket, steam_id* pSteamIDRemote, int* peSocketStatus,
unsigned int* punIPRemote, unsigned short* punPortRemote)
{
return false;
}
bool networking::GetSocketInfo(unsigned int hSocket, steam_id* pSteamIDRemote, int* peSocketStatus,
unsigned int* punIPRemote, unsigned short* punPortRemote)
{
return false;
}
bool networking::GetListenSocketInfo(unsigned int hListenSocket, unsigned int* pnIP, unsigned short* pnPort)
{
return false;
}
bool networking::GetListenSocketInfo(unsigned int hListenSocket, unsigned int* pnIP, unsigned short* pnPort)
{
return false;
}
int networking::GetSocketConnectionType(unsigned int hSocket)
{
return 0;
}
int networking::GetSocketConnectionType(unsigned int hSocket)
{
return 0;
}
int networking::GetMaxPacketSize(unsigned int hSocket)
{
return 0;
}
} // namespace steam
int networking::GetMaxPacketSize(unsigned int hSocket)
{
return 0;
}
}

View File

@ -2,40 +2,38 @@
namespace steam
{
class networking
{
public:
~networking() = default;
class networking
{
public:
~networking() = default;
virtual bool SendP2PPacket(steam_id steamIDRemote, const void* pubData, unsigned int cubData, int eP2PSendType);
virtual bool IsP2PPacketAvailable(unsigned int* pcubMsgSize, int idk);
virtual bool ReadP2PPacket(void* pubDest, unsigned int cubDest, unsigned int* pcubMsgSize,
steam_id* psteamIDRemote);
virtual bool AcceptP2PSessionWithUser(steam_id steamIDRemote);
virtual bool CloseP2PSessionWithUser(steam_id steamIDRemote);
virtual bool CloseP2PChannelWithUser(steam_id steamIDRemote, int iVirtualPort);
virtual bool GetP2PSessionState(steam_id steamIDRemote, void* pConnectionState);
virtual bool AllowP2PPacketRelay(bool bAllow);
virtual unsigned int CreateListenSocket(int nVirtualP2PPort, unsigned int nIP, unsigned short nPort,
bool bAllowUseOfPacketRelay);
virtual unsigned int CreateP2PConnectionSocket(steam_id steamIDTarget, int nVirtualPort, int nTimeoutSec,
bool bAllowUseOfPacketRelay);
virtual unsigned int CreateConnectionSocket(unsigned int nIP, unsigned short nPort, int nTimeoutSec);
virtual bool DestroySocket(unsigned int hSocket, bool bNotifyRemoteEnd);
virtual bool DestroyListenSocket(unsigned int hSocket, bool bNotifyRemoteEnd);
virtual bool SendDataOnSocket(unsigned int hSocket, void* pubData, unsigned int cubData, bool bReliable);
virtual bool IsDataAvailableOnSocket(unsigned int hSocket, unsigned int* pcubMsgSize);
virtual bool RetrieveDataFromSocket(unsigned int hSocket, void* pubDest, unsigned int cubDest,
unsigned int* pcubMsgSize);
virtual bool IsDataAvailable(unsigned int hListenSocket, unsigned int* pcubMsgSize, unsigned int* phSocket);
virtual bool RetrieveData(unsigned int hListenSocket, void* pubDest, unsigned int cubDest,
unsigned int* pcubMsgSize, unsigned int* phSocket);
virtual bool GetSocketInfo(unsigned int hSocket, steam_id* pSteamIDRemote, int* peSocketStatus,
unsigned int* punIPRemote, unsigned short* punPortRemote);
virtual bool GetListenSocketInfo(unsigned int hListenSocket, unsigned int* pnIP, unsigned short* pnPort);
virtual int GetSocketConnectionType(unsigned int hSocket);
virtual int GetMaxPacketSize(unsigned int hSocket);
};
} // namespace steam
virtual bool SendP2PPacket(steam_id steamIDRemote, const void* pubData, unsigned int cubData, int eP2PSendType);
virtual bool IsP2PPacketAvailable(unsigned int* pcubMsgSize, int idk);
virtual bool ReadP2PPacket(void* pubDest, unsigned int cubDest, unsigned int* pcubMsgSize,
steam_id* psteamIDRemote);
virtual bool AcceptP2PSessionWithUser(steam_id steamIDRemote);
virtual bool CloseP2PSessionWithUser(steam_id steamIDRemote);
virtual bool CloseP2PChannelWithUser(steam_id steamIDRemote, int iVirtualPort);
virtual bool GetP2PSessionState(steam_id steamIDRemote, void* pConnectionState);
virtual bool AllowP2PPacketRelay(bool bAllow);
virtual unsigned int CreateListenSocket(int nVirtualP2PPort, unsigned int nIP, unsigned short nPort,
bool bAllowUseOfPacketRelay);
virtual unsigned int CreateP2PConnectionSocket(steam_id steamIDTarget, int nVirtualPort, int nTimeoutSec,
bool bAllowUseOfPacketRelay);
virtual unsigned int CreateConnectionSocket(unsigned int nIP, unsigned short nPort, int nTimeoutSec);
virtual bool DestroySocket(unsigned int hSocket, bool bNotifyRemoteEnd);
virtual bool DestroyListenSocket(unsigned int hSocket, bool bNotifyRemoteEnd);
virtual bool SendDataOnSocket(unsigned int hSocket, void* pubData, unsigned int cubData, bool bReliable);
virtual bool IsDataAvailableOnSocket(unsigned int hSocket, unsigned int* pcubMsgSize);
virtual bool RetrieveDataFromSocket(unsigned int hSocket, void* pubDest, unsigned int cubDest,
unsigned int* pcubMsgSize);
virtual bool IsDataAvailable(unsigned int hListenSocket, unsigned int* pcubMsgSize, unsigned int* phSocket);
virtual bool RetrieveData(unsigned int hListenSocket, void* pubDest, unsigned int cubDest,
unsigned int* pcubMsgSize, unsigned int* phSocket);
virtual bool GetSocketInfo(unsigned int hSocket, steam_id* pSteamIDRemote, int* peSocketStatus,
unsigned int* punIPRemote, unsigned short* punPortRemote);
virtual bool GetListenSocketInfo(unsigned int hListenSocket, unsigned int* pnIP, unsigned short* pnPort);
virtual int GetSocketConnectionType(unsigned int hSocket);
virtual int GetMaxPacketSize(unsigned int hSocket);
};
}

View File

@ -3,283 +3,281 @@
namespace steam
{
bool remote_storage::FileWrite(const char* pchFile, const void* pvData, int cubData)
{
return true;
}
bool remote_storage::FileWrite(const char* pchFile, const void* pvData, int cubData)
{
return true;
}
int remote_storage::FileRead(const char* pchFile, void* pvData, int cubDataToRead)
{
return 0;
}
int remote_storage::FileRead(const char* pchFile, void* pvData, int cubDataToRead)
{
return 0;
}
bool remote_storage::FileForget(const char* pchFile)
{
return true;
}
bool remote_storage::FileForget(const char* pchFile)
{
return true;
}
bool remote_storage::FileDelete(const char* pchFile)
{
return true;
}
bool remote_storage::FileDelete(const char* pchFile)
{
return true;
}
unsigned long long remote_storage::FileShare(const char* pchFile)
{
return 0;
}
unsigned long long remote_storage::FileShare(const char* pchFile)
{
return 0;
}
bool remote_storage::SetSyncPlatforms(const char* pchFile, unsigned int eRemoteStoragePlatform)
{
return true;
}
bool remote_storage::SetSyncPlatforms(const char* pchFile, unsigned int eRemoteStoragePlatform)
{
return true;
}
unsigned long long remote_storage::FileWriteStreamOpen(const char* pchFile)
{
return 0;
}
unsigned long long remote_storage::FileWriteStreamOpen(const char* pchFile)
{
return 0;
}
int remote_storage::FileWriteStreamWriteChunk(unsigned long long hStream, const void* pvData, int cubData)
{
return 1;
}
int remote_storage::FileWriteStreamWriteChunk(unsigned long long hStream, const void* pvData, int cubData)
{
return 1;
}
int remote_storage::FileWriteStreamClose(unsigned long long hStream)
{
return 1;
}
int remote_storage::FileWriteStreamClose(unsigned long long hStream)
{
return 1;
}
int remote_storage::FileWriteStreamCancel(unsigned long long hStream)
{
return 1;
}
int remote_storage::FileWriteStreamCancel(unsigned long long hStream)
{
return 1;
}
bool remote_storage::FileExists(const char* pchFile)
{
return true;
}
bool remote_storage::FileExists(const char* pchFile)
{
return true;
}
bool remote_storage::FilePersisted(const char* pchFile)
{
return true;
}
bool remote_storage::FilePersisted(const char* pchFile)
{
return true;
}
int remote_storage::GetFileSize(const char* pchFile)
{
return 0;
}
int remote_storage::GetFileSize(const char* pchFile)
{
return 0;
}
long long remote_storage::GetFileTimestamp(const char* pchFile)
{
return 0;
}
long long remote_storage::GetFileTimestamp(const char* pchFile)
{
return 0;
}
unsigned remote_storage::GetSyncPlatforms(const char* pchFile)
{
return 0;
}
unsigned remote_storage::GetSyncPlatforms(const char* pchFile)
{
return 0;
}
int remote_storage::GetFileCount()
{
return 0;
}
int remote_storage::GetFileCount()
{
return 0;
}
const char* remote_storage::GetFileNameAndSize(int iFile, int* pnFileSizeInBytes)
{
*pnFileSizeInBytes = 0;
return "";
}
const char* remote_storage::GetFileNameAndSize(int iFile, int* pnFileSizeInBytes)
{
*pnFileSizeInBytes = 0;
return "";
}
bool remote_storage::GetQuota(int* pnTotalBytes, int* puAvailableBytes)
{
*pnTotalBytes = 0x10000000;
*puAvailableBytes = 0x10000000;
return false;
}
bool remote_storage::GetQuota(int* pnTotalBytes, int* puAvailableBytes)
{
*pnTotalBytes = 0x10000000;
*puAvailableBytes = 0x10000000;
return false;
}
bool remote_storage::IsCloudEnabledForAccount()
{
return false;
}
bool remote_storage::IsCloudEnabledForAccount()
{
return false;
}
bool remote_storage::IsCloudEnabledForApp()
{
return false;
}
bool remote_storage::IsCloudEnabledForApp()
{
return false;
}
void remote_storage::SetCloudEnabledForApp(bool bEnabled)
{
}
void remote_storage::SetCloudEnabledForApp(bool bEnabled)
{
}
unsigned long long remote_storage::UGCDownload(unsigned long long hContent, unsigned int uUnk)
{
return 0;
}
unsigned long long remote_storage::UGCDownload(unsigned long long hContent, unsigned int uUnk)
{
return 0;
}
bool remote_storage::GetUGCDownloadProgress(unsigned long long hContent, unsigned int* puDownloadedBytes,
unsigned int* puTotalBytes)
{
return false;
}
bool remote_storage::GetUGCDownloadProgress(unsigned long long hContent, unsigned int* puDownloadedBytes,
unsigned int* puTotalBytes)
{
return false;
}
bool remote_storage::GetUGCDetails(unsigned long long hContent, unsigned int* pnAppID, char** ppchName,
int* pnFileSizeInBytes, steam_id* pSteamIDOwner)
{
return false;
}
bool remote_storage::GetUGCDetails(unsigned long long hContent, unsigned int* pnAppID, char** ppchName,
int* pnFileSizeInBytes, steam_id* pSteamIDOwner)
{
return false;
}
int remote_storage::UGCRead(unsigned long long hContent, void* pvData, int cubDataToRead, unsigned int uOffset)
{
return 0;
}
int remote_storage::UGCRead(unsigned long long hContent, void* pvData, int cubDataToRead, unsigned int uOffset)
{
return 0;
}
int remote_storage::GetCachedUGCCount()
{
return 0;
}
int remote_storage::GetCachedUGCCount()
{
return 0;
}
unsigned long long remote_storage::GetCachedUGCHandle(int iCachedContent)
{
return 0;
}
unsigned long long remote_storage::GetCachedUGCHandle(int iCachedContent)
{
return 0;
}
unsigned long long remote_storage::PublishWorkshopFile(const char* pchFile, const char* pchPreviewFile,
unsigned int nConsumerAppId, const char* pchTitle,
const char* pchDescription, unsigned int eVisibility,
int* pTags, unsigned int eWorkshopFileType)
{
return 0;
}
unsigned long long remote_storage::PublishWorkshopFile(const char* pchFile, const char* pchPreviewFile,
unsigned int nConsumerAppId, const char* pchTitle,
const char* pchDescription, unsigned int eVisibility,
int* pTags, unsigned int eWorkshopFileType)
{
return 0;
}
unsigned long long remote_storage::CreatePublishedFileUpdateRequest(unsigned long long unPublishedFileId)
{
return 0;
}
unsigned long long remote_storage::CreatePublishedFileUpdateRequest(unsigned long long unPublishedFileId)
{
return 0;
}
bool remote_storage::UpdatePublishedFileFile(unsigned long long hUpdateRequest, const char* pchFile)
{
return false;
}
bool remote_storage::UpdatePublishedFileFile(unsigned long long hUpdateRequest, const char* pchFile)
{
return false;
}
bool remote_storage::UpdatePublishedFilePreviewFile(unsigned long long hUpdateRequest, const char* pchPreviewFile)
{
return false;
}
bool remote_storage::UpdatePublishedFilePreviewFile(unsigned long long hUpdateRequest, const char* pchPreviewFile)
{
return false;
}
bool remote_storage::UpdatePublishedFileTitle(unsigned long long hUpdateRequest, const char* pchTitle)
{
return false;
}
bool remote_storage::UpdatePublishedFileTitle(unsigned long long hUpdateRequest, const char* pchTitle)
{
return false;
}
bool remote_storage::UpdatePublishedFileDescription(unsigned long long hUpdateRequest, const char* pchDescription)
{
return false;
}
bool remote_storage::UpdatePublishedFileDescription(unsigned long long hUpdateRequest, const char* pchDescription)
{
return false;
}
bool remote_storage::UpdatePublishedFileVisibility(unsigned long long hUpdateRequest, unsigned int eVisibility)
{
return false;
}
bool remote_storage::UpdatePublishedFileVisibility(unsigned long long hUpdateRequest, unsigned int eVisibility)
{
return false;
}
bool remote_storage::UpdatePublishedFileTags(unsigned long long hUpdateRequest, int* pTags)
{
return false;
}
bool remote_storage::UpdatePublishedFileTags(unsigned long long hUpdateRequest, int* pTags)
{
return false;
}
unsigned long long remote_storage::CommitPublishedFileUpdate(unsigned long long hUpdateRequest)
{
return 0;
}
unsigned long long remote_storage::CommitPublishedFileUpdate(unsigned long long hUpdateRequest)
{
return 0;
}
unsigned long long remote_storage::GetPublishedFileDetails(unsigned long long unPublishedFileId)
{
return 0;
}
unsigned long long remote_storage::GetPublishedFileDetails(unsigned long long unPublishedFileId)
{
return 0;
}
unsigned long long remote_storage::DeletePublishedFile(unsigned long long unPublishedFileId)
{
return 0;
}
unsigned long long remote_storage::DeletePublishedFile(unsigned long long unPublishedFileId)
{
return 0;
}
unsigned long long remote_storage::EnumerateUserPublishedFiles(unsigned int uStartIndex)
{
return 0;
}
unsigned long long remote_storage::EnumerateUserPublishedFiles(unsigned int uStartIndex)
{
return 0;
}
unsigned long long remote_storage::SubscribePublishedFile(unsigned long long unPublishedFileId)
{
return 0;
}
unsigned long long remote_storage::SubscribePublishedFile(unsigned long long unPublishedFileId)
{
return 0;
}
unsigned long long remote_storage::EnumerateUserSubscribedFiles(unsigned int uStartIndex)
{
return 0;
}
unsigned long long remote_storage::EnumerateUserSubscribedFiles(unsigned int uStartIndex)
{
return 0;
}
unsigned long long remote_storage::UnsubscribePublishedFile(unsigned long long unPublishedFileId)
{
return 0;
}
unsigned long long remote_storage::UnsubscribePublishedFile(unsigned long long unPublishedFileId)
{
return 0;
}
bool remote_storage::UpdatePublishedFileSetChangeDescription(unsigned long long hUpdateRequest,
const char* cszDescription)
{
return false;
}
bool remote_storage::UpdatePublishedFileSetChangeDescription(unsigned long long hUpdateRequest,
const char* cszDescription)
{
return false;
}
unsigned long long remote_storage::GetPublishedItemVoteDetails(unsigned long long unPublishedFileId)
{
return 0;
}
unsigned long long remote_storage::GetPublishedItemVoteDetails(unsigned long long unPublishedFileId)
{
return 0;
}
unsigned long long remote_storage::UpdateUserPublishedItemVote(unsigned long long unPublishedFileId, bool bVoteUp)
{
return 0;
}
unsigned long long remote_storage::UpdateUserPublishedItemVote(unsigned long long unPublishedFileId, bool bVoteUp)
{
return 0;
}
unsigned long long remote_storage::GetUserPublishedItemVoteDetails(unsigned long long unPublishedFileId)
{
return 0;
}
unsigned long long remote_storage::GetUserPublishedItemVoteDetails(unsigned long long unPublishedFileId)
{
return 0;
}
unsigned long long remote_storage::EnumerateUserSharedWorkshopFiles(unsigned int nAppId, steam_id creatorSteamID,
unsigned int uStartIndex, int* pRequiredTags,
int* pExcludedTags)
{
return 0;
}
unsigned long long remote_storage::EnumerateUserSharedWorkshopFiles(unsigned int nAppId, steam_id creatorSteamID,
unsigned int uStartIndex, int* pRequiredTags,
int* pExcludedTags)
{
return 0;
}
unsigned long long remote_storage::PublishVideo(unsigned int eVideoProvider, const char* cszVideoAccountName,
const char* cszVideoIdentifier, const char* cszFileName,
unsigned int nConsumerAppId, const char* cszTitle,
const char* cszDescription, unsigned int eVisibility, int* pTags)
{
return 0;
}
unsigned long long remote_storage::PublishVideo(unsigned int eVideoProvider, const char* cszVideoAccountName,
const char* cszVideoIdentifier, const char* cszFileName,
unsigned int nConsumerAppId, const char* cszTitle,
const char* cszDescription, unsigned int eVisibility, int* pTags)
{
return 0;
}
unsigned long long remote_storage::SetUserPublishedFileAction(unsigned long long unPublishedFileId,
unsigned int eAction)
{
return 0;
}
unsigned long long remote_storage::SetUserPublishedFileAction(unsigned long long unPublishedFileId,
unsigned int eAction)
{
return 0;
}
unsigned long long remote_storage::EnumeratePublishedFilesByUserAction(
unsigned int eAction, unsigned int uStartIndex)
{
return 0;
}
unsigned long long remote_storage::EnumeratePublishedFilesByUserAction(
unsigned int eAction, unsigned int uStartIndex)
{
return 0;
}
unsigned long long remote_storage::EnumeratePublishedWorkshopFiles(unsigned int eType, unsigned int uStartIndex,
unsigned int cDays, unsigned int cCount,
int* pTags, int* pUserTags)
{
return 0;
}
unsigned long long remote_storage::EnumeratePublishedWorkshopFiles(unsigned int eType, unsigned int uStartIndex,
unsigned int cDays, unsigned int cCount,
int* pTags, int* pUserTags)
{
return 0;
}
unsigned long long remote_storage::UGCDownloadToLocation(unsigned long long hContent, const char* cszLocation,
unsigned int uUnk)
{
return 0;
}
} // namespace steam
unsigned long long remote_storage::UGCDownloadToLocation(unsigned long long hContent, const char* cszLocation,
unsigned int uUnk)
{
return 0;
}
}

View File

@ -2,64 +2,77 @@
namespace steam
{
class remote_storage
{
public:
~remote_storage() = default;
class remote_storage
{
public:
~remote_storage() = default;
virtual bool FileWrite(const char* pchFile, const void* pvData, int cubData);
virtual int FileRead(const char* pchFile, void* pvData, int cubDataToRead);
virtual bool FileForget(const char* pchFile);
virtual bool FileDelete(const char* pchFile);
virtual unsigned long long FileShare(const char* pchFile);
virtual bool SetSyncPlatforms(const char* pchFile, unsigned int eRemoteStoragePlatform);
virtual unsigned long long FileWriteStreamOpen(const char* pchFile);
virtual int FileWriteStreamWriteChunk(unsigned long long hStream, const void* pvData, int cubData);
virtual int FileWriteStreamClose(unsigned long long hStream);
virtual int FileWriteStreamCancel(unsigned long long hStream);
virtual bool FileExists(const char* pchFile);
virtual bool FilePersisted(const char* pchFile);
virtual int GetFileSize(const char* pchFile);
virtual long long GetFileTimestamp(const char* pchFile);
virtual unsigned int GetSyncPlatforms(const char* pchFile);
virtual int GetFileCount();
virtual const char* GetFileNameAndSize(int iFile, int* pnFileSizeInBytes);
virtual bool GetQuota(int* pnTotalBytes, int* puAvailableBytes);
virtual bool IsCloudEnabledForAccount();
virtual bool IsCloudEnabledForApp();
virtual void SetCloudEnabledForApp(bool bEnabled);
virtual unsigned long long UGCDownload(unsigned long long hContent, unsigned int uUnk);
virtual bool GetUGCDownloadProgress(unsigned long long hContent, unsigned int* puDownloadedBytes, unsigned int* puTotalBytes);
virtual bool GetUGCDetails(unsigned long long hContent, unsigned int* pnAppID, char** ppchName, int* pnFileSizeInBytes, steam_id* pSteamIDOwner);
virtual int UGCRead(unsigned long long hContent, void* pvData, int cubDataToRead, unsigned int uOffset);
virtual int GetCachedUGCCount();
virtual unsigned long long GetCachedUGCHandle(int iCachedContent);
virtual unsigned long long PublishWorkshopFile(const char* pchFile, const char* pchPreviewFile, unsigned int nConsumerAppId, const char* pchTitle, const char* pchDescription, unsigned int eVisibility, int* pTags, unsigned int eWorkshopFileType);
virtual unsigned long long CreatePublishedFileUpdateRequest(unsigned long long unPublishedFileId);
virtual bool UpdatePublishedFileFile(unsigned long long hUpdateRequest, const char* pchFile);
virtual bool UpdatePublishedFilePreviewFile(unsigned long long hUpdateRequest, const char* pchPreviewFile);
virtual bool UpdatePublishedFileTitle(unsigned long long hUpdateRequest, const char* pchTitle);
virtual bool UpdatePublishedFileDescription(unsigned long long hUpdateRequest, const char* pchDescription);
virtual bool UpdatePublishedFileVisibility(unsigned long long hUpdateRequest, unsigned int eVisibility);
virtual bool UpdatePublishedFileTags(unsigned long long hUpdateRequest, int* pTags);
virtual unsigned long long CommitPublishedFileUpdate(unsigned long long hUpdateRequest);
virtual unsigned long long GetPublishedFileDetails(unsigned long long unPublishedFileId);
virtual unsigned long long DeletePublishedFile(unsigned long long unPublishedFileId);
virtual unsigned long long EnumerateUserPublishedFiles(unsigned int uStartIndex);
virtual unsigned long long SubscribePublishedFile(unsigned long long unPublishedFileId);
virtual unsigned long long EnumerateUserSubscribedFiles(unsigned int uStartIndex);
virtual unsigned long long UnsubscribePublishedFile(unsigned long long unPublishedFileId);
virtual bool UpdatePublishedFileSetChangeDescription(unsigned long long hUpdateRequest, const char* cszDescription);
virtual unsigned long long GetPublishedItemVoteDetails(unsigned long long unPublishedFileId);
virtual unsigned long long UpdateUserPublishedItemVote(unsigned long long unPublishedFileId, bool bVoteUp);
virtual unsigned long long GetUserPublishedItemVoteDetails(unsigned long long unPublishedFileId);
virtual unsigned long long EnumerateUserSharedWorkshopFiles(unsigned int nAppId, steam_id creatorSteamID, unsigned int uStartIndex, int* pRequiredTags, int* pExcludedTags);
virtual unsigned long long PublishVideo(unsigned int eVideoProvider, const char* cszVideoAccountName, const char* cszVideoIdentifier, const char* cszFileName, unsigned int nConsumerAppId, const char* cszTitle, const char* cszDescription, unsigned int eVisibility, int* pTags);
virtual unsigned long long SetUserPublishedFileAction(unsigned long long unPublishedFileId, unsigned int eAction);
virtual unsigned long long EnumeratePublishedFilesByUserAction(unsigned int eAction, unsigned int uStartIndex);
virtual unsigned long long EnumeratePublishedWorkshopFiles(unsigned int eType, unsigned int uStartIndex, unsigned int cDays, unsigned int cCount, int* pTags, int* pUserTags);
virtual unsigned long long UGCDownloadToLocation(unsigned long long hContent, const char* cszLocation, unsigned int uUnk);
};
} // namespace steam
virtual bool FileWrite(const char* pchFile, const void* pvData, int cubData);
virtual int FileRead(const char* pchFile, void* pvData, int cubDataToRead);
virtual bool FileForget(const char* pchFile);
virtual bool FileDelete(const char* pchFile);
virtual unsigned long long FileShare(const char* pchFile);
virtual bool SetSyncPlatforms(const char* pchFile, unsigned int eRemoteStoragePlatform);
virtual unsigned long long FileWriteStreamOpen(const char* pchFile);
virtual int FileWriteStreamWriteChunk(unsigned long long hStream, const void* pvData, int cubData);
virtual int FileWriteStreamClose(unsigned long long hStream);
virtual int FileWriteStreamCancel(unsigned long long hStream);
virtual bool FileExists(const char* pchFile);
virtual bool FilePersisted(const char* pchFile);
virtual int GetFileSize(const char* pchFile);
virtual long long GetFileTimestamp(const char* pchFile);
virtual unsigned int GetSyncPlatforms(const char* pchFile);
virtual int GetFileCount();
virtual const char* GetFileNameAndSize(int iFile, int* pnFileSizeInBytes);
virtual bool GetQuota(int* pnTotalBytes, int* puAvailableBytes);
virtual bool IsCloudEnabledForAccount();
virtual bool IsCloudEnabledForApp();
virtual void SetCloudEnabledForApp(bool bEnabled);
virtual unsigned long long UGCDownload(unsigned long long hContent, unsigned int uUnk);
virtual bool GetUGCDownloadProgress(unsigned long long hContent, unsigned int* puDownloadedBytes,
unsigned int* puTotalBytes);
virtual bool GetUGCDetails(unsigned long long hContent, unsigned int* pnAppID, char** ppchName,
int* pnFileSizeInBytes, steam_id* pSteamIDOwner);
virtual int UGCRead(unsigned long long hContent, void* pvData, int cubDataToRead, unsigned int uOffset);
virtual int GetCachedUGCCount();
virtual unsigned long long GetCachedUGCHandle(int iCachedContent);
virtual unsigned long long PublishWorkshopFile(const char* pchFile, const char* pchPreviewFile,
unsigned int nConsumerAppId, const char* pchTitle,
const char* pchDescription, unsigned int eVisibility, int* pTags,
unsigned int eWorkshopFileType);
virtual unsigned long long CreatePublishedFileUpdateRequest(unsigned long long unPublishedFileId);
virtual bool UpdatePublishedFileFile(unsigned long long hUpdateRequest, const char* pchFile);
virtual bool UpdatePublishedFilePreviewFile(unsigned long long hUpdateRequest, const char* pchPreviewFile);
virtual bool UpdatePublishedFileTitle(unsigned long long hUpdateRequest, const char* pchTitle);
virtual bool UpdatePublishedFileDescription(unsigned long long hUpdateRequest, const char* pchDescription);
virtual bool UpdatePublishedFileVisibility(unsigned long long hUpdateRequest, unsigned int eVisibility);
virtual bool UpdatePublishedFileTags(unsigned long long hUpdateRequest, int* pTags);
virtual unsigned long long CommitPublishedFileUpdate(unsigned long long hUpdateRequest);
virtual unsigned long long GetPublishedFileDetails(unsigned long long unPublishedFileId);
virtual unsigned long long DeletePublishedFile(unsigned long long unPublishedFileId);
virtual unsigned long long EnumerateUserPublishedFiles(unsigned int uStartIndex);
virtual unsigned long long SubscribePublishedFile(unsigned long long unPublishedFileId);
virtual unsigned long long EnumerateUserSubscribedFiles(unsigned int uStartIndex);
virtual unsigned long long UnsubscribePublishedFile(unsigned long long unPublishedFileId);
virtual bool UpdatePublishedFileSetChangeDescription(unsigned long long hUpdateRequest,
const char* cszDescription);
virtual unsigned long long GetPublishedItemVoteDetails(unsigned long long unPublishedFileId);
virtual unsigned long long UpdateUserPublishedItemVote(unsigned long long unPublishedFileId, bool bVoteUp);
virtual unsigned long long GetUserPublishedItemVoteDetails(unsigned long long unPublishedFileId);
virtual unsigned long long EnumerateUserSharedWorkshopFiles(unsigned int nAppId, steam_id creatorSteamID,
unsigned int uStartIndex, int* pRequiredTags,
int* pExcludedTags);
virtual unsigned long long PublishVideo(unsigned int eVideoProvider, const char* cszVideoAccountName,
const char* cszVideoIdentifier, const char* cszFileName,
unsigned int nConsumerAppId, const char* cszTitle,
const char* cszDescription, unsigned int eVisibility, int* pTags);
virtual unsigned long long SetUserPublishedFileAction(unsigned long long unPublishedFileId,
unsigned int eAction);
virtual unsigned long long EnumeratePublishedFilesByUserAction(unsigned int eAction, unsigned int uStartIndex);
virtual unsigned long long EnumeratePublishedWorkshopFiles(unsigned int eType, unsigned int uStartIndex,
unsigned int cDays, unsigned int cCount, int* pTags,
int* pUserTags);
virtual unsigned long long UGCDownloadToLocation(unsigned long long hContent, const char* cszLocation,
unsigned int uUnk);
};
}

View File

@ -5,166 +5,167 @@
namespace steam
{
namespace
{
std::string auth_ticket;
namespace
{
std::string auth_ticket;
steam_id generate_steam_id()
{
steam_id id{};
id.bits = auth::get_guid();
return id;
}
}
steam_id generate_steam_id()
{
steam_id id{};
id.bits = auth::get_guid();
return id;
}
}
int user::GetHSteamUser()
{
return NULL;
}
int user::GetHSteamUser()
{
return NULL;
}
bool user::LoggedOn()
{
return true;
}
bool user::LoggedOn()
{
return true;
}
steam_id user::GetSteamID()
{
static auto id = generate_steam_id();
return id;
}
steam_id user::GetSteamID()
{
static auto id = generate_steam_id();
return id;
}
int user::InitiateGameConnection(void* pAuthBlob, int cbMaxAuthBlob, steam_id steamIDGameServer,
unsigned int unIPServer, unsigned short usPortServer, bool bSecure)
{
return 0;
}
int user::InitiateGameConnection(void* pAuthBlob, int cbMaxAuthBlob, steam_id steamIDGameServer,
unsigned int unIPServer, unsigned short usPortServer, bool bSecure)
{
return 0;
}
void user::TerminateGameConnection(unsigned int unIPServer, unsigned short usPortServer)
{
}
void user::TerminateGameConnection(unsigned int unIPServer, unsigned short usPortServer)
{
}
void user::TrackAppUsageEvent(steam_id gameID, int eAppUsageEvent, const char* pchExtraInfo)
{
}
void user::TrackAppUsageEvent(steam_id gameID, int eAppUsageEvent, const char* pchExtraInfo)
{
}
bool user::GetUserDataFolder(char* pchBuffer, int cubBuffer)
{
return false;
}
bool user::GetUserDataFolder(char* pchBuffer, int cubBuffer)
{
return false;
}
void user::StartVoiceRecording()
{
}
void user::StartVoiceRecording()
{
}
void user::StopVoiceRecording()
{
}
void user::StopVoiceRecording()
{
}
int user::GetAvailableVoice(unsigned int* pcbCompressed, unsigned int* pcbUncompressed,
unsigned int nUncompressedVoiceDesiredSampleRate)
{
return 0;
}
int user::GetAvailableVoice(unsigned int* pcbCompressed, unsigned int* pcbUncompressed,
unsigned int nUncompressedVoiceDesiredSampleRate)
{
return 0;
}
int user::GetVoice(bool bWantCompressed, void* pDestBuffer, unsigned int cbDestBufferSize,
unsigned int* nBytesWritten, bool bWantUncompressed, void* pUncompressedDestBuffer,
unsigned int cbUncompressedDestBufferSize, unsigned int* nUncompressBytesWritten,
unsigned int nUncompressedVoiceDesiredSampleRate)
{
return 0;
}
int user::GetVoice(bool bWantCompressed, void* pDestBuffer, unsigned int cbDestBufferSize,
unsigned int* nBytesWritten, bool bWantUncompressed, void* pUncompressedDestBuffer,
unsigned int cbUncompressedDestBufferSize, unsigned int* nUncompressBytesWritten,
unsigned int nUncompressedVoiceDesiredSampleRate)
{
return 0;
}
int user::DecompressVoice(void* pCompressed, unsigned int cbCompressed, void* pDestBuffer,
unsigned int cbDestBufferSize, unsigned int* nBytesWritten)
{
return 0;
}
int user::DecompressVoice(void* pCompressed, unsigned int cbCompressed, void* pDestBuffer,
unsigned int cbDestBufferSize, unsigned int* nBytesWritten)
{
return 0;
}
unsigned int user::GetVoiceOptimalSampleRate()
{
return 0;
}
unsigned int user::GetVoiceOptimalSampleRate()
{
return 0;
}
unsigned int user::GetAuthSessionTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket)
{
static uint32_t ticket = 0;
*pcbTicket = 1;
unsigned int user::GetAuthSessionTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket)
{
static uint32_t ticket = 0;
*pcbTicket = 1;
const auto result = callbacks::register_call();
auto* response = static_cast<get_auth_session_ticket_response*>(calloc(1, sizeof(get_auth_session_ticket_response)));
response->m_h_auth_ticket = ++ticket;
response->m_e_result = 1; // k_EResultOK;
const auto result = callbacks::register_call();
auto* response = static_cast<get_auth_session_ticket_response*>(calloc(
1, sizeof(get_auth_session_ticket_response)));
response->m_h_auth_ticket = ++ticket;
response->m_e_result = 1; // k_EResultOK;
callbacks::return_call(response, sizeof(get_auth_session_ticket_response), get_auth_session_ticket_response::callback_id, result);
return response->m_h_auth_ticket;
}
callbacks::return_call(response, sizeof(get_auth_session_ticket_response),
get_auth_session_ticket_response::callback_id, result);
return response->m_h_auth_ticket;
}
int user::BeginAuthSession(const void* pAuthTicket, int cbAuthTicket, steam_id steamID)
{
return 0;
}
int user::BeginAuthSession(const void* pAuthTicket, int cbAuthTicket, steam_id steamID)
{
return 0;
}
void user::EndAuthSession(steam_id steamID)
{
}
void user::EndAuthSession(steam_id steamID)
{
}
void user::CancelAuthTicket(unsigned int hAuthTicket)
{
}
void user::CancelAuthTicket(unsigned int hAuthTicket)
{
}
unsigned int user::UserHasLicenseForApp(steam_id steamID, unsigned int appID)
{
return 0;
}
unsigned int user::UserHasLicenseForApp(steam_id steamID, unsigned int appID)
{
return 0;
}
bool user::BIsBehindNAT()
{
return false;
}
bool user::BIsBehindNAT()
{
return false;
}
void user::AdvertiseGame(steam_id steamIDGameServer, unsigned int unIPServer, unsigned short usPortServer)
{
}
void user::AdvertiseGame(steam_id steamIDGameServer, unsigned int unIPServer, unsigned short usPortServer)
{
}
unsigned long long user::RequestEncryptedAppTicket(void* pUserData, int cbUserData)
{
unsigned long long user::RequestEncryptedAppTicket(void* pUserData, int cbUserData)
{
#ifdef DEBUG
printf("[steam_api]: [user]: request encrypted app ticket\n");
printf("[steam_api]: [user]: request encrypted app ticket\n");
#endif
// Generate the authentication ticket
const auto id = this->GetSteamID();
// Generate the authentication ticket
const auto id = this->GetSteamID();
auth_ticket = "S1";
auth_ticket.resize(32);
auth_ticket.append(reinterpret_cast<char*>(pUserData), 24); // key
auth_ticket.append(reinterpret_cast<const char*>(&id.bits), sizeof(id.bits)); // user id
auth_ticket.append((char*)&reinterpret_cast<char*>(pUserData)[24], 64); // user name
auth_ticket = "S1";
auth_ticket.resize(32);
auth_ticket.append(reinterpret_cast<char*>(pUserData), 24); // key
auth_ticket.append(reinterpret_cast<const char*>(&id.bits), sizeof(id.bits)); // user id
auth_ticket.append((char*)&reinterpret_cast<char*>(pUserData)[24], 64); // user name
// Create the call response
const auto result = callbacks::register_call();
auto retvals = static_cast<encrypted_app_ticket_response*>(calloc(1, sizeof(encrypted_app_ticket_response)));
//::Utils::Memory::AllocateArray<EncryptedAppTicketResponse>();
retvals->m_e_result = 1;
// Create the call response
const auto result = callbacks::register_call();
auto retvals = static_cast<encrypted_app_ticket_response*>(calloc(1, sizeof(encrypted_app_ticket_response)));
//::Utils::Memory::AllocateArray<EncryptedAppTicketResponse>();
retvals->m_e_result = 1;
// Return the call response
callbacks::return_call(retvals, sizeof(encrypted_app_ticket_response),
encrypted_app_ticket_response::callback_id, result);
// Return the call response
callbacks::return_call(retvals, sizeof(encrypted_app_ticket_response),
encrypted_app_ticket_response::callback_id, result);
return result;
}
return result;
}
bool user::GetEncryptedAppTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket)
{
bool user::GetEncryptedAppTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket)
{
#ifdef DEBUG
printf("[steam_api]: [user]: sending encrypted app ticket\n");
printf("[steam_api]: [user]: sending encrypted app ticket\n");
#endif
if (cbMaxTicket < 0 || auth_ticket.empty()) return false;
if (cbMaxTicket < 0 || auth_ticket.empty()) return false;
const auto size = std::min(size_t(cbMaxTicket), auth_ticket.size());
std::memcpy(pTicket, auth_ticket.data(), size);
*pcbTicket = static_cast<unsigned>(size);
const auto size = std::min(size_t(cbMaxTicket), auth_ticket.size());
std::memcpy(pTicket, auth_ticket.data(), size);
*pcbTicket = static_cast<unsigned>(size);
return true;
}
} // namespace steam
return true;
}
}

View File

@ -2,56 +2,54 @@
namespace steam
{
struct encrypted_app_ticket_response final
{
enum { callback_id = 154 };
struct encrypted_app_ticket_response final
{
enum { callback_id = 154 };
int m_e_result;
};
int m_e_result;
};
struct get_auth_session_ticket_response
{
enum { callback_id = 163 };
struct get_auth_session_ticket_response
{
enum { callback_id = 163 };
unsigned int m_h_auth_ticket;
int m_e_result;
};
unsigned int m_h_auth_ticket;
int m_e_result;
};
class user
{
public:
~user() = default;
class user
{
public:
~user() = default;
virtual int GetHSteamUser();
virtual bool LoggedOn();
virtual steam_id GetSteamID();
virtual int GetHSteamUser();
virtual bool LoggedOn();
virtual steam_id GetSteamID();
virtual int InitiateGameConnection(void* pAuthBlob, int cbMaxAuthBlob, steam_id steamIDGameServer,
unsigned int unIPServer, unsigned short usPortServer, bool bSecure);
virtual void TerminateGameConnection(unsigned int unIPServer, unsigned short usPortServer);
virtual void TrackAppUsageEvent(steam_id gameID, int eAppUsageEvent, const char* pchExtraInfo = "");
virtual bool GetUserDataFolder(char* pchBuffer, int cubBuffer);
virtual void StartVoiceRecording();
virtual void StopVoiceRecording();
virtual int GetAvailableVoice(unsigned int* pcbCompressed, unsigned int* pcbUncompressed,
unsigned int nUncompressedVoiceDesiredSampleRate);
virtual int GetVoice(bool bWantCompressed, void* pDestBuffer, unsigned int cbDestBufferSize,
unsigned int* nBytesWritten, bool bWantUncompressed, void* pUncompressedDestBuffer,
unsigned int cbUncompressedDestBufferSize, unsigned int* nUncompressBytesWritten,
unsigned int nUncompressedVoiceDesiredSampleRate);
virtual int DecompressVoice(void* pCompressed, unsigned int cbCompressed, void* pDestBuffer,
unsigned int cbDestBufferSize, unsigned int* nBytesWritten);
virtual unsigned int GetVoiceOptimalSampleRate();
virtual unsigned int GetAuthSessionTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket);
virtual int BeginAuthSession(const void* pAuthTicket, int cbAuthTicket, steam_id steamID);
virtual void EndAuthSession(steam_id steamID);
virtual void CancelAuthTicket(unsigned int hAuthTicket);
virtual unsigned int UserHasLicenseForApp(steam_id steamID, unsigned int appID);
virtual bool BIsBehindNAT();
virtual void AdvertiseGame(steam_id steamIDGameServer, unsigned int unIPServer, unsigned short usPortServer);
virtual unsigned long long RequestEncryptedAppTicket(void* pUserData, int cbUserData);
virtual bool GetEncryptedAppTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket);
};
} // namespace steam
virtual int InitiateGameConnection(void* pAuthBlob, int cbMaxAuthBlob, steam_id steamIDGameServer,
unsigned int unIPServer, unsigned short usPortServer, bool bSecure);
virtual void TerminateGameConnection(unsigned int unIPServer, unsigned short usPortServer);
virtual void TrackAppUsageEvent(steam_id gameID, int eAppUsageEvent, const char* pchExtraInfo = "");
virtual bool GetUserDataFolder(char* pchBuffer, int cubBuffer);
virtual void StartVoiceRecording();
virtual void StopVoiceRecording();
virtual int GetAvailableVoice(unsigned int* pcbCompressed, unsigned int* pcbUncompressed,
unsigned int nUncompressedVoiceDesiredSampleRate);
virtual int GetVoice(bool bWantCompressed, void* pDestBuffer, unsigned int cbDestBufferSize,
unsigned int* nBytesWritten, bool bWantUncompressed, void* pUncompressedDestBuffer,
unsigned int cbUncompressedDestBufferSize, unsigned int* nUncompressBytesWritten,
unsigned int nUncompressedVoiceDesiredSampleRate);
virtual int DecompressVoice(void* pCompressed, unsigned int cbCompressed, void* pDestBuffer,
unsigned int cbDestBufferSize, unsigned int* nBytesWritten);
virtual unsigned int GetVoiceOptimalSampleRate();
virtual unsigned int GetAuthSessionTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket);
virtual int BeginAuthSession(const void* pAuthTicket, int cbAuthTicket, steam_id steamID);
virtual void EndAuthSession(steam_id steamID);
virtual void CancelAuthTicket(unsigned int hAuthTicket);
virtual unsigned int UserHasLicenseForApp(steam_id steamID, unsigned int appID);
virtual bool BIsBehindNAT();
virtual void AdvertiseGame(steam_id steamIDGameServer, unsigned int unIPServer, unsigned short usPortServer);
virtual unsigned long long RequestEncryptedAppTicket(void* pUserData, int cbUserData);
virtual bool GetEncryptedAppTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket);
};
}

View File

@ -3,230 +3,229 @@
namespace steam
{
bool user_stats::RequestCurrentStats()
{
return true;
}
bool user_stats::RequestCurrentStats()
{
return true;
}
bool user_stats::GetStat(const char* pchName, int* pData)
{
return false;
}
bool user_stats::GetStat(const char* pchName, int* pData)
{
return false;
}
bool user_stats::GetStat(const char* pchName, float* pData)
{
return false;
}
bool user_stats::GetStat(const char* pchName, float* pData)
{
return false;
}
bool user_stats::SetStat(const char* pchName, int nData)
{
return false;
}
bool user_stats::SetStat(const char* pchName, int nData)
{
return false;
}
bool user_stats::SetStat(const char* pchName, float fData)
{
return false;
}
bool user_stats::SetStat(const char* pchName, float fData)
{
return false;
}
bool user_stats::UpdateAvgRateStat(const char* pchName, float flCountThisSession, double dSessionLength)
{
return false;
}
bool user_stats::UpdateAvgRateStat(const char* pchName, float flCountThisSession, double dSessionLength)
{
return false;
}
bool user_stats::GetAchievement(const char* pchName, bool* pbAchieved)
{
return true;
}
bool user_stats::GetAchievement(const char* pchName, bool* pbAchieved)
{
return true;
}
bool user_stats::SetAchievement(const char* pchName)
{
return true;
}
bool user_stats::SetAchievement(const char* pchName)
{
return true;
}
bool user_stats::ClearAchievement(const char* pchName)
{
return true;
}
bool user_stats::ClearAchievement(const char* pchName)
{
return true;
}
bool user_stats::GetAchievementAndUnlockTime(const char* pchName, bool* pbAchieved, unsigned int* punUnlockTime)
{
return true;
}
bool user_stats::GetAchievementAndUnlockTime(const char* pchName, bool* pbAchieved, unsigned int* punUnlockTime)
{
return true;
}
bool user_stats::StoreStats()
{
return true;
}
bool user_stats::StoreStats()
{
return true;
}
int user_stats::GetAchievementIcon(const char* pchName)
{
return 0;
}
int user_stats::GetAchievementIcon(const char* pchName)
{
return 0;
}
const char* user_stats::GetAchievementDisplayAttribute(const char* pchName, const char* pchKey)
{
return "";
}
const char* user_stats::GetAchievementDisplayAttribute(const char* pchName, const char* pchKey)
{
return "";
}
bool user_stats::IndicateAchievementProgress(const char* pchName, unsigned int nCurProgress,
unsigned int nMaxProgress)
{
return true;
}
bool user_stats::IndicateAchievementProgress(const char* pchName, unsigned int nCurProgress,
unsigned int nMaxProgress)
{
return true;
}
unsigned int user_stats::GetNumAchievements()
{
return 0;
}
unsigned int user_stats::GetNumAchievements()
{
return 0;
}
const char* user_stats::GetAchievementName(unsigned int iAchievement)
{
return "";
}
const char* user_stats::GetAchievementName(unsigned int iAchievement)
{
return "";
}
unsigned long long user_stats::RequestUserStats(steam_id steamIDUser)
{
return 0;
}
unsigned long long user_stats::RequestUserStats(steam_id steamIDUser)
{
return 0;
}
bool user_stats::GetUserStat(steam_id steamIDUser, const char* pchName, int* pData)
{
return false;
}
bool user_stats::GetUserStat(steam_id steamIDUser, const char* pchName, int* pData)
{
return false;
}
bool user_stats::GetUserStat(steam_id steamIDUser, const char* pchName, float* pData)
{
return false;
}
bool user_stats::GetUserStat(steam_id steamIDUser, const char* pchName, float* pData)
{
return false;
}
bool user_stats::GetUserAchievement(steam_id steamIDUser, const char* pchName, bool* pbAchieved)
{
return true;
}
bool user_stats::GetUserAchievement(steam_id steamIDUser, const char* pchName, bool* pbAchieved)
{
return true;
}
bool user_stats::GetUserAchievementAndUnlockTime(steam_id steamIDUser, const char* pchName, bool* pbAchieved,
unsigned int* punUnlockTime)
{
return true;
}
bool user_stats::GetUserAchievementAndUnlockTime(steam_id steamIDUser, const char* pchName, bool* pbAchieved,
unsigned int* punUnlockTime)
{
return true;
}
bool user_stats::ResetAllStats(bool bAchievementsToo)
{
return false;
}
bool user_stats::ResetAllStats(bool bAchievementsToo)
{
return false;
}
unsigned long long user_stats::FindOrCreateLeaderboard(const char* pchLeaderboardName, int eLeaderboardSortMethod,
int eLeaderboardDisplayType)
{
return 0;
}
unsigned long long user_stats::FindOrCreateLeaderboard(const char* pchLeaderboardName, int eLeaderboardSortMethod,
int eLeaderboardDisplayType)
{
return 0;
}
unsigned long long user_stats::FindLeaderboard(const char* pchLeaderboardName)
{
return 0;
}
unsigned long long user_stats::FindLeaderboard(const char* pchLeaderboardName)
{
return 0;
}
const char* user_stats::GetLeaderboardName(unsigned long long hSteamLeaderboard)
{
return "";
}
const char* user_stats::GetLeaderboardName(unsigned long long hSteamLeaderboard)
{
return "";
}
int user_stats::GetLeaderboardEntryCount(unsigned long long hSteamLeaderboard)
{
return 0;
}
int user_stats::GetLeaderboardEntryCount(unsigned long long hSteamLeaderboard)
{
return 0;
}
int user_stats::GetLeaderboardSortMethod(unsigned long long hSteamLeaderboard)
{
return 0;
}
int user_stats::GetLeaderboardSortMethod(unsigned long long hSteamLeaderboard)
{
return 0;
}
int user_stats::GetLeaderboardDisplayType(unsigned long long hSteamLeaderboard)
{
return 0;
}
int user_stats::GetLeaderboardDisplayType(unsigned long long hSteamLeaderboard)
{
return 0;
}
unsigned long long user_stats::DownloadLeaderboardEntries(unsigned long long hSteamLeaderboard,
int eLeaderboardDataRequest, int nRangeStart,
int nRangeEnd)
{
return 0;
}
unsigned long long user_stats::DownloadLeaderboardEntries(unsigned long long hSteamLeaderboard,
int eLeaderboardDataRequest, int nRangeStart, int nRangeEnd)
{
return 0;
}
unsigned long long user_stats::DownloadLeaderboardEntriesForUsers(unsigned long long hSteamLeaderboard,
steam_id* prgUsers, int cUsers)
{
return 0;
}
unsigned long long user_stats::DownloadLeaderboardEntriesForUsers(unsigned long long hSteamLeaderboard,
steam_id* prgUsers, int cUsers)
{
return 0;
}
bool user_stats::GetDownloadedLeaderboardEntry(unsigned long long hSteamLeaderboardEntries, int index,
int* pLeaderboardEntry, int* pDetails, int cDetailsMax)
{
return false;
}
bool user_stats::GetDownloadedLeaderboardEntry(unsigned long long hSteamLeaderboardEntries, int index,
int* pLeaderboardEntry, int* pDetails, int cDetailsMax)
{
return false;
}
unsigned long long user_stats::UploadLeaderboardScore(unsigned long long hSteamLeaderboard,
int eLeaderboardUploadScoreMethod, int nScore,
const int* pScoreDetails, int cScoreDetailsCount)
{
return 0;
}
unsigned long long user_stats::UploadLeaderboardScore(unsigned long long hSteamLeaderboard,
int eLeaderboardUploadScoreMethod, int nScore,
const int* pScoreDetails, int cScoreDetailsCount)
{
return 0;
}
unsigned long long user_stats::AttachLeaderboardUGC(unsigned long long hSteamLeaderboard, unsigned long long hUGC)
{
return 0;
}
unsigned long long user_stats::AttachLeaderboardUGC(unsigned long long hSteamLeaderboard, unsigned long long hUGC)
{
return 0;
}
unsigned long long user_stats::GetNumberOfCurrentPlayers()
{
return 0;
}
unsigned long long user_stats::GetNumberOfCurrentPlayers()
{
return 0;
}
unsigned long long user_stats::RequestGlobalAchievementPercentages()
{
return 0;
}
unsigned long long user_stats::RequestGlobalAchievementPercentages()
{
return 0;
}
int user_stats::GetMostAchievedAchievementInfo(char* pchName, unsigned int unNameBufLen, float* pflPercent,
bool* pbAchieved)
{
return 0;
}
int user_stats::GetMostAchievedAchievementInfo(char* pchName, unsigned int unNameBufLen, float* pflPercent,
bool* pbAchieved)
{
return 0;
}
int user_stats::GetNextMostAchievedAchievementInfo(int iIteratorPrevious, char* pchName, unsigned int unNameBufLen,
float* pflPercent, bool* pbAchieved)
{
return 0;
}
int user_stats::GetNextMostAchievedAchievementInfo(int iIteratorPrevious, char* pchName, unsigned int unNameBufLen,
float* pflPercent, bool* pbAchieved)
{
return 0;
}
bool user_stats::GetAchievementAchievedPercent(const char* pchName, float* pflPercent)
{
return true;
}
bool user_stats::GetAchievementAchievedPercent(const char* pchName, float* pflPercent)
{
return true;
}
unsigned long long user_stats::RequestGlobalStats(int nHistoryDays)
{
return 0;
}
unsigned long long user_stats::RequestGlobalStats(int nHistoryDays)
{
return 0;
}
bool user_stats::GetGlobalStat(const char* pchStatName, long long* pData)
{
return false;
}
bool user_stats::GetGlobalStat(const char* pchStatName, long long* pData)
{
return false;
}
bool user_stats::GetGlobalStat(const char* pchStatName, double* pData)
{
return false;
}
bool user_stats::GetGlobalStat(const char* pchStatName, double* pData)
{
return false;
}
int user_stats::GetGlobalStatHistory(const char* pchStatName, long long* pData, unsigned int cubData)
{
return 0;
}
int user_stats::GetGlobalStatHistory(const char* pchStatName, long long* pData, unsigned int cubData)
{
return 0;
}
int user_stats::GetGlobalStatHistory(const char* pchStatName, double* pData, unsigned int cubData)
{
return 0;
}
} // namespace steam
int user_stats::GetGlobalStatHistory(const char* pchStatName, double* pData, unsigned int cubData)
{
return 0;
}
}

View File

@ -2,66 +2,64 @@
namespace steam
{
class user_stats
{
public:
~user_stats() = default;
class user_stats
{
public:
~user_stats() = default;
virtual bool RequestCurrentStats();
virtual bool GetStat(const char* pchName, int* pData);
virtual bool GetStat(const char* pchName, float* pData);
virtual bool SetStat(const char* pchName, int nData);
virtual bool SetStat(const char* pchName, float fData);
virtual bool UpdateAvgRateStat(const char* pchName, float flCountThisSession, double dSessionLength);
virtual bool GetAchievement(const char* pchName, bool* pbAchieved);
virtual bool SetAchievement(const char* pchName);
virtual bool ClearAchievement(const char* pchName);
virtual bool GetAchievementAndUnlockTime(const char* pchName, bool* pbAchieved, unsigned int* punUnlockTime);
virtual bool StoreStats();
virtual int GetAchievementIcon(const char* pchName);
virtual const char* GetAchievementDisplayAttribute(const char* pchName, const char* pchKey);
virtual bool IndicateAchievementProgress(const char* pchName, unsigned int nCurProgress,
unsigned int nMaxProgress);
virtual unsigned int GetNumAchievements();
virtual const char* GetAchievementName(unsigned int iAchievement);
virtual unsigned long long RequestUserStats(steam_id steamIDUser);
virtual bool GetUserStat(steam_id steamIDUser, const char* pchName, int* pData);
virtual bool GetUserStat(steam_id steamIDUser, const char* pchName, float* pData);
virtual bool GetUserAchievement(steam_id steamIDUser, const char* pchName, bool* pbAchieved);
virtual bool GetUserAchievementAndUnlockTime(steam_id steamIDUser, const char* pchName, bool* pbAchieved,
unsigned int* punUnlockTime);
virtual bool ResetAllStats(bool bAchievementsToo);
virtual unsigned long long FindOrCreateLeaderboard(const char* pchLeaderboardName, int eLeaderboardSortMethod,
int eLeaderboardDisplayType);
virtual unsigned long long FindLeaderboard(const char* pchLeaderboardName);
virtual const char* GetLeaderboardName(unsigned long long hSteamLeaderboard);
virtual int GetLeaderboardEntryCount(unsigned long long hSteamLeaderboard);
virtual int GetLeaderboardSortMethod(unsigned long long hSteamLeaderboard);
virtual int GetLeaderboardDisplayType(unsigned long long hSteamLeaderboard);
virtual unsigned long long DownloadLeaderboardEntries(unsigned long long hSteamLeaderboard,
int eLeaderboardDataRequest, int nRangeStart,
int nRangeEnd);
virtual unsigned long long DownloadLeaderboardEntriesForUsers(unsigned long long hSteamLeaderboard,
steam_id* prgUsers, int cUsers);
virtual bool GetDownloadedLeaderboardEntry(unsigned long long hSteamLeaderboardEntries, int index,
int* pLeaderboardEntry, int* pDetails, int cDetailsMax);
virtual unsigned long long UploadLeaderboardScore(unsigned long long hSteamLeaderboard,
int eLeaderboardUploadScoreMethod, int nScore,
const int* pScoreDetails, int cScoreDetailsCount);
virtual unsigned long long AttachLeaderboardUGC(unsigned long long hSteamLeaderboard, unsigned long long hUGC);
virtual unsigned long long GetNumberOfCurrentPlayers();
virtual unsigned long long RequestGlobalAchievementPercentages();
virtual int GetMostAchievedAchievementInfo(char* pchName, unsigned int unNameBufLen, float* pflPercent,
bool* pbAchieved);
virtual int GetNextMostAchievedAchievementInfo(int iIteratorPrevious, char* pchName, unsigned int unNameBufLen,
float* pflPercent, bool* pbAchieved);
virtual bool GetAchievementAchievedPercent(const char* pchName, float* pflPercent);
virtual unsigned long long RequestGlobalStats(int nHistoryDays);
virtual bool GetGlobalStat(const char* pchStatName, long long* pData);
virtual bool GetGlobalStat(const char* pchStatName, double* pData);
virtual int GetGlobalStatHistory(const char* pchStatName, long long* pData, unsigned int cubData);
virtual int GetGlobalStatHistory(const char* pchStatName, double* pData, unsigned int cubData);
};
} // namespace steam
virtual bool RequestCurrentStats();
virtual bool GetStat(const char* pchName, int* pData);
virtual bool GetStat(const char* pchName, float* pData);
virtual bool SetStat(const char* pchName, int nData);
virtual bool SetStat(const char* pchName, float fData);
virtual bool UpdateAvgRateStat(const char* pchName, float flCountThisSession, double dSessionLength);
virtual bool GetAchievement(const char* pchName, bool* pbAchieved);
virtual bool SetAchievement(const char* pchName);
virtual bool ClearAchievement(const char* pchName);
virtual bool GetAchievementAndUnlockTime(const char* pchName, bool* pbAchieved, unsigned int* punUnlockTime);
virtual bool StoreStats();
virtual int GetAchievementIcon(const char* pchName);
virtual const char* GetAchievementDisplayAttribute(const char* pchName, const char* pchKey);
virtual bool IndicateAchievementProgress(const char* pchName, unsigned int nCurProgress,
unsigned int nMaxProgress);
virtual unsigned int GetNumAchievements();
virtual const char* GetAchievementName(unsigned int iAchievement);
virtual unsigned long long RequestUserStats(steam_id steamIDUser);
virtual bool GetUserStat(steam_id steamIDUser, const char* pchName, int* pData);
virtual bool GetUserStat(steam_id steamIDUser, const char* pchName, float* pData);
virtual bool GetUserAchievement(steam_id steamIDUser, const char* pchName, bool* pbAchieved);
virtual bool GetUserAchievementAndUnlockTime(steam_id steamIDUser, const char* pchName, bool* pbAchieved,
unsigned int* punUnlockTime);
virtual bool ResetAllStats(bool bAchievementsToo);
virtual unsigned long long FindOrCreateLeaderboard(const char* pchLeaderboardName, int eLeaderboardSortMethod,
int eLeaderboardDisplayType);
virtual unsigned long long FindLeaderboard(const char* pchLeaderboardName);
virtual const char* GetLeaderboardName(unsigned long long hSteamLeaderboard);
virtual int GetLeaderboardEntryCount(unsigned long long hSteamLeaderboard);
virtual int GetLeaderboardSortMethod(unsigned long long hSteamLeaderboard);
virtual int GetLeaderboardDisplayType(unsigned long long hSteamLeaderboard);
virtual unsigned long long DownloadLeaderboardEntries(unsigned long long hSteamLeaderboard,
int eLeaderboardDataRequest, int nRangeStart,
int nRangeEnd);
virtual unsigned long long DownloadLeaderboardEntriesForUsers(unsigned long long hSteamLeaderboard,
steam_id* prgUsers, int cUsers);
virtual bool GetDownloadedLeaderboardEntry(unsigned long long hSteamLeaderboardEntries, int index,
int* pLeaderboardEntry, int* pDetails, int cDetailsMax);
virtual unsigned long long UploadLeaderboardScore(unsigned long long hSteamLeaderboard,
int eLeaderboardUploadScoreMethod, int nScore,
const int* pScoreDetails, int cScoreDetailsCount);
virtual unsigned long long AttachLeaderboardUGC(unsigned long long hSteamLeaderboard, unsigned long long hUGC);
virtual unsigned long long GetNumberOfCurrentPlayers();
virtual unsigned long long RequestGlobalAchievementPercentages();
virtual int GetMostAchievedAchievementInfo(char* pchName, unsigned int unNameBufLen, float* pflPercent,
bool* pbAchieved);
virtual int GetNextMostAchievedAchievementInfo(int iIteratorPrevious, char* pchName, unsigned int unNameBufLen,
float* pflPercent, bool* pbAchieved);
virtual bool GetAchievementAchievedPercent(const char* pchName, float* pflPercent);
virtual unsigned long long RequestGlobalStats(int nHistoryDays);
virtual bool GetGlobalStat(const char* pchStatName, long long* pData);
virtual bool GetGlobalStat(const char* pchStatName, double* pData);
virtual int GetGlobalStatHistory(const char* pchStatName, long long* pData, unsigned int cubData);
virtual int GetGlobalStatHistory(const char* pchStatName, double* pData, unsigned int cubData);
};
}

View File

@ -3,123 +3,121 @@
namespace steam
{
unsigned int utils::GetSecondsSinceAppActive()
{
return 0;
}
unsigned int utils::GetSecondsSinceAppActive()
{
return 0;
}
unsigned int utils::GetSecondsSinceComputerActive()
{
return (uint32_t)GetTickCount64() / 1000;
}
unsigned int utils::GetSecondsSinceComputerActive()
{
return (uint32_t)GetTickCount64() / 1000;
}
int utils::GetConnectedUniverse()
{
return 1;
}
int utils::GetConnectedUniverse()
{
return 1;
}
unsigned int utils::GetServerRealTime()
{
return (uint32_t)time(NULL);
}
unsigned int utils::GetServerRealTime()
{
return (uint32_t)time(NULL);
}
const char* utils::GetIPCountry()
{
return "US";
}
const char* utils::GetIPCountry()
{
return "US";
}
bool utils::GetImageSize(int iImage, unsigned int* pnWidth, unsigned int* pnHeight)
{
return false;
}
bool utils::GetImageSize(int iImage, unsigned int* pnWidth, unsigned int* pnHeight)
{
return false;
}
bool utils::GetImageRGBA(int iImage, unsigned char* pubDest, int nDestBufferSize)
{
return false;
}
bool utils::GetImageRGBA(int iImage, unsigned char* pubDest, int nDestBufferSize)
{
return false;
}
bool utils::GetCSERIPPort(unsigned int* unIP, unsigned short* usPort)
{
return false;
}
bool utils::GetCSERIPPort(unsigned int* unIP, unsigned short* usPort)
{
return false;
}
unsigned char utils::GetCurrentBatteryPower()
{
return 255;
}
unsigned char utils::GetCurrentBatteryPower()
{
return 255;
}
unsigned int utils::GetAppID()
{
return 209660;
}
unsigned int utils::GetAppID()
{
return 209660;
}
void utils::SetOverlayNotificationPosition(int eNotificationPosition)
{
//const auto& overlay = steam_proxy::get_overlay_module();
//if (overlay)
//{
// overlay.invoke<void>("SetNotificationPosition", eNotificationPosition);
//}
}
void utils::SetOverlayNotificationPosition(int eNotificationPosition)
{
//const auto& overlay = steam_proxy::get_overlay_module();
//if (overlay)
//{
// overlay.invoke<void>("SetNotificationPosition", eNotificationPosition);
//}
}
bool utils::IsAPICallCompleted(unsigned long long hSteamAPICall, bool* pbFailed)
{
return false;
}
bool utils::IsAPICallCompleted(unsigned long long hSteamAPICall, bool* pbFailed)
{
return false;
}
int utils::GetAPICallFailureReason(unsigned long long hSteamAPICall)
{
return -1;
}
int utils::GetAPICallFailureReason(unsigned long long hSteamAPICall)
{
return -1;
}
bool utils::GetAPICallResult(unsigned long long hSteamAPICall, void* pCallback, int cubCallback,
int iCallbackExpected, bool* pbFailed)
{
return false;
}
bool utils::GetAPICallResult(unsigned long long hSteamAPICall, void* pCallback, int cubCallback,
int iCallbackExpected, bool* pbFailed)
{
return false;
}
void utils::RunFrame()
{
}
void utils::RunFrame()
{
}
unsigned int utils::GetIPCCallCount()
{
return 0;
}
unsigned int utils::GetIPCCallCount()
{
return 0;
}
void utils::SetWarningMessageHook(void (*pFunction)(int hpipe, const char* message))
{
}
void utils::SetWarningMessageHook(void (*pFunction)(int hpipe, const char* message))
{
}
bool utils::IsOverlayEnabled()
{
return false;
}
bool utils::IsOverlayEnabled()
{
return false;
}
bool utils::BOverlayNeedsPresent()
{
return false;
}
bool utils::BOverlayNeedsPresent()
{
return false;
}
unsigned long long utils::CheckFileSignature(const char* szFileName)
{
return 0;
}
unsigned long long utils::CheckFileSignature(const char* szFileName)
{
return 0;
}
bool utils::ShowGamepadTextInput(int eInputMode, int eInputLineMode, const char* szText, unsigned int uMaxLength)
{
return false;
}
bool utils::ShowGamepadTextInput(int eInputMode, int eInputLineMode, const char* szText, unsigned int uMaxLength)
{
return false;
}
unsigned int utils::GetEnteredGamepadTextLength()
{
return 0;
}
unsigned int utils::GetEnteredGamepadTextLength()
{
return 0;
}
bool utils::GetEnteredGamepadTextInput(char* pchValue, unsigned int cchValueMax)
{
return false;
}
} // namespace steam
bool utils::GetEnteredGamepadTextInput(char* pchValue, unsigned int cchValueMax)
{
return false;
}
}

View File

@ -2,37 +2,36 @@
namespace steam
{
class utils
{
public:
~utils() = default;
class utils
{
public:
~utils() = default;
virtual unsigned int GetSecondsSinceAppActive();
virtual unsigned int GetSecondsSinceComputerActive();
virtual int GetConnectedUniverse();
virtual unsigned int GetServerRealTime();
virtual const char* GetIPCountry();
virtual bool GetImageSize(int iImage, unsigned int* pnWidth, unsigned int* pnHeight);
virtual bool GetImageRGBA(int iImage, unsigned char* pubDest, int nDestBufferSize);
virtual bool GetCSERIPPort(unsigned int* unIP, unsigned short* usPort);
virtual unsigned char GetCurrentBatteryPower();
virtual unsigned int GetAppID();
virtual void SetOverlayNotificationPosition(int eNotificationPosition);
virtual bool IsAPICallCompleted(unsigned long long hSteamAPICall, bool* pbFailed);
virtual int GetAPICallFailureReason(unsigned long long hSteamAPICall);
virtual bool GetAPICallResult(unsigned long long hSteamAPICall, void* pCallback, int cubCallback,
int iCallbackExpected, bool* pbFailed);
virtual void RunFrame();
virtual unsigned int GetIPCCallCount();
virtual void SetWarningMessageHook(void (*pFunction)(int hpipe, const char* message));
virtual bool IsOverlayEnabled();
virtual bool BOverlayNeedsPresent();
virtual unsigned long long CheckFileSignature(const char* szFileName);
virtual unsigned int GetSecondsSinceAppActive();
virtual unsigned int GetSecondsSinceComputerActive();
virtual int GetConnectedUniverse();
virtual unsigned int GetServerRealTime();
virtual const char* GetIPCountry();
virtual bool GetImageSize(int iImage, unsigned int* pnWidth, unsigned int* pnHeight);
virtual bool GetImageRGBA(int iImage, unsigned char* pubDest, int nDestBufferSize);
virtual bool GetCSERIPPort(unsigned int* unIP, unsigned short* usPort);
virtual unsigned char GetCurrentBatteryPower();
virtual unsigned int GetAppID();
virtual void SetOverlayNotificationPosition(int eNotificationPosition);
virtual bool IsAPICallCompleted(unsigned long long hSteamAPICall, bool* pbFailed);
virtual int GetAPICallFailureReason(unsigned long long hSteamAPICall);
virtual bool GetAPICallResult(unsigned long long hSteamAPICall, void* pCallback, int cubCallback,
int iCallbackExpected, bool* pbFailed);
virtual void RunFrame();
virtual unsigned int GetIPCCallCount();
virtual void SetWarningMessageHook(void (*pFunction)(int hpipe, const char* message));
virtual bool IsOverlayEnabled();
virtual bool BOverlayNeedsPresent();
virtual unsigned long long CheckFileSignature(const char* szFileName);
virtual bool ShowGamepadTextInput(int eInputMode, int eInputLineMode, const char* szText, unsigned int uMaxLength);
virtual unsigned int GetEnteredGamepadTextLength();
virtual bool GetEnteredGamepadTextInput(char* pchValue, unsigned int cchValueMax);
};
} // namespace steam
virtual bool ShowGamepadTextInput(int eInputMode, int eInputLineMode, const char* szText,
unsigned int uMaxLength);
virtual unsigned int GetEnteredGamepadTextLength();
virtual bool GetEnteredGamepadTextInput(char* pchValue, unsigned int cchValueMax);
};
}

View File

@ -3,239 +3,236 @@
namespace steam
{
uint64_t callbacks::call_id_ = 0;
std::recursive_mutex callbacks::mutex_;
std::map<uint64_t, bool> callbacks::calls_;
std::map<uint64_t, callbacks::base*> callbacks::result_handlers_;
std::vector<callbacks::result> callbacks::results_;
std::vector<callbacks::base*> callbacks::callback_list_;
uint64_t callbacks::call_id_ = 0;
std::recursive_mutex callbacks::mutex_;
std::map<uint64_t, bool> callbacks::calls_;
std::map<uint64_t, callbacks::base*> callbacks::result_handlers_;
std::vector<callbacks::result> callbacks::results_;
std::vector<callbacks::base*> callbacks::callback_list_;
uint64_t callbacks::register_call()
{
std::lock_guard<std::recursive_mutex> _(mutex_);
calls_[++call_id_] = false;
return call_id_;
}
uint64_t callbacks::register_call()
{
std::lock_guard<std::recursive_mutex> _(mutex_);
calls_[++call_id_] = false;
return call_id_;
}
void callbacks::register_callback(base* handler, const int callback)
{
std::lock_guard<std::recursive_mutex> _(mutex_);
handler->set_i_callback(callback);
callback_list_.push_back(handler);
}
void callbacks::register_callback(base* handler, const int callback)
{
std::lock_guard<std::recursive_mutex> _(mutex_);
handler->set_i_callback(callback);
callback_list_.push_back(handler);
}
void callbacks::unregister_callback(base* handler)
{
std::lock_guard<std::recursive_mutex> _(mutex_);
for (auto i = callback_list_.begin(); i != callback_list_.end();)
{
if (*i == handler)
{
i = callback_list_.erase(i);
}
else
{
++i;
}
}
}
void callbacks::unregister_callback(base* handler)
{
std::lock_guard<std::recursive_mutex> _(mutex_);
for (auto i = callback_list_.begin(); i != callback_list_.end();)
{
if (*i == handler)
{
i = callback_list_.erase(i);
}
else
{
++i;
}
}
}
void callbacks::register_call_result(const uint64_t call, base* result)
{
std::lock_guard<std::recursive_mutex> _(mutex_);
result_handlers_[call] = result;
}
void callbacks::register_call_result(const uint64_t call, base* result)
{
std::lock_guard<std::recursive_mutex> _(mutex_);
result_handlers_[call] = result;
}
void callbacks::unregister_call_result(const uint64_t call, base* /*result*/)
{
std::lock_guard<std::recursive_mutex> _(mutex_);
const auto i = result_handlers_.find(call);
if (i != result_handlers_.end())
{
result_handlers_.erase(i);
}
}
void callbacks::unregister_call_result(const uint64_t call, base* /*result*/)
{
std::lock_guard<std::recursive_mutex> _(mutex_);
const auto i = result_handlers_.find(call);
if (i != result_handlers_.end())
{
result_handlers_.erase(i);
}
}
void callbacks::return_call(void* data, const int size, const int type, const uint64_t call)
{
std::lock_guard<std::recursive_mutex> _(mutex_);
void callbacks::return_call(void* data, const int size, const int type, const uint64_t call)
{
std::lock_guard<std::recursive_mutex> _(mutex_);
result result{};
result.call = call;
result.data = data;
result.size = size;
result.type = type;
result result{};
result.call = call;
result.data = data;
result.size = size;
result.type = type;
calls_[call] = true;
calls_[call] = true;
results_.emplace_back(result);
}
results_.emplace_back(result);
}
void callbacks::run_callbacks()
{
std::lock_guard<std::recursive_mutex> _(mutex_);
void callbacks::run_callbacks()
{
std::lock_guard<std::recursive_mutex> _(mutex_);
for (const auto& result : results_)
{
if (result_handlers_.find(result.call) != result_handlers_.end())
{
result_handlers_[result.call]->run(result.data, false, result.call);
}
for (const auto& result : results_)
{
if (result_handlers_.find(result.call) != result_handlers_.end())
{
result_handlers_[result.call]->run(result.data, false, result.call);
}
for (const auto& callback : callback_list_)
{
if (callback && callback->get_i_callback() == result.type)
{
callback->run(result.data, false, 0);
}
}
for (const auto& callback : callback_list_)
{
if (callback && callback->get_i_callback() == result.type)
{
callback->run(result.data, false, 0);
}
}
if (result.data)
{
free(result.data);
}
}
if (result.data)
{
free(result.data);
}
}
results_.clear();
}
results_.clear();
}
extern "C" {
extern "C"
{
bool SteamAPI_RestartAppIfNecessary()
{
return false;
}
bool SteamAPI_RestartAppIfNecessary()
{
return false;
}
bool SteamAPI_Init()
{
return true;
}
bool SteamAPI_Init()
{
return true;
}
void SteamAPI_RegisterCallResult(callbacks::base* result, const uint64_t call)
{
callbacks::register_call_result(call, result);
}
void SteamAPI_RegisterCallResult(callbacks::base* result, const uint64_t call)
{
callbacks::register_call_result(call, result);
}
void SteamAPI_RegisterCallback(callbacks::base* handler, const int callback)
{
callbacks::register_callback(handler, callback);
}
void SteamAPI_RegisterCallback(callbacks::base* handler, const int callback)
{
callbacks::register_callback(handler, callback);
}
void SteamAPI_RunCallbacks()
{
callbacks::run_callbacks();
}
void SteamAPI_RunCallbacks()
{
callbacks::run_callbacks();
}
void SteamAPI_Shutdown()
{
}
void SteamAPI_Shutdown()
{
}
void SteamAPI_UnregisterCallResult(callbacks::base* result, const uint64_t call)
{
callbacks::unregister_call_result(call, result);
}
void SteamAPI_UnregisterCallResult(callbacks::base* result, const uint64_t call)
{
callbacks::unregister_call_result(call, result);
}
void SteamAPI_UnregisterCallback(callbacks::base* handler)
{
callbacks::unregister_callback(handler);
}
void SteamAPI_UnregisterCallback(callbacks::base* handler)
{
callbacks::unregister_callback(handler);
}
const char* SteamAPI_GetSteamInstallPath()
{
static std::string install_path{};
if (!install_path.empty())
{
return install_path.data();
}
const char* SteamAPI_GetSteamInstallPath()
{
static std::string install_path{};
if (!install_path.empty())
{
return install_path.data();
}
HKEY reg_key;
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\WOW6432Node\\Valve\\Steam", 0, KEY_QUERY_VALUE,
&reg_key) ==
ERROR_SUCCESS)
{
char path[MAX_PATH] = {0};
DWORD length = sizeof(path);
RegQueryValueExA(reg_key, "InstallPath", nullptr, nullptr, reinterpret_cast<BYTE*>(path),
&length);
RegCloseKey(reg_key);
HKEY reg_key;
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\WOW6432Node\\Valve\\Steam", 0, KEY_QUERY_VALUE,
&reg_key) ==
ERROR_SUCCESS)
{
char path[MAX_PATH] = { 0 };
DWORD length = sizeof(path);
RegQueryValueExA(reg_key, "InstallPath", nullptr, nullptr, reinterpret_cast<BYTE*>(path),
&length);
RegCloseKey(reg_key);
install_path = path;
}
install_path = path;
}
return install_path.data();
}
return install_path.data();
}
bool SteamGameServer_Init()
{
return true;
}
bool SteamGameServer_Init()
{
return true;
}
void SteamGameServer_RunCallbacks()
{
}
void SteamGameServer_RunCallbacks()
{
}
void SteamGameServer_Shutdown()
{
}
void SteamGameServer_Shutdown()
{
}
friends* SteamFriends()
{
static friends friends;
return &friends;
}
friends* SteamFriends()
{
static friends friends;
return &friends;
}
matchmaking* SteamMatchmaking()
{
static matchmaking matchmaking;
return &matchmaking;
}
matchmaking* SteamMatchmaking()
{
static matchmaking matchmaking;
return &matchmaking;
}
game_server* SteamGameServer()
{
static game_server game_server;
return &game_server;
}
game_server* SteamGameServer()
{
static game_server game_server;
return &game_server;
}
networking* SteamNetworking()
{
static networking networking;
return &networking;
}
networking* SteamNetworking()
{
static networking networking;
return &networking;
}
remote_storage* SteamRemoteStorage()
{
static remote_storage remote_storage;
return &remote_storage;
}
remote_storage* SteamRemoteStorage()
{
static remote_storage remote_storage;
return &remote_storage;
}
user* SteamUser()
{
static user user;
return &user;
}
user* SteamUser()
{
static user user;
return &user;
}
utils* SteamUtils()
{
static utils utils;
return &utils;
}
utils* SteamUtils()
{
static utils utils;
return &utils;
}
apps* SteamApps()
{
static apps apps;
return &apps;
}
apps* SteamApps()
{
static apps apps;
return &apps;
}
user_stats* SteamUserStats()
{
static user_stats user_stats;
return &user_stats;
}
user_stats* SteamUserStats()
{
static user_stats user_stats;
return &user_stats;
}
} // extern C
} // namespace steam
}
}

View File

@ -4,30 +4,30 @@
struct raw_steam_id final
{
unsigned int account_id : 32;
unsigned int account_instance : 20;
unsigned int account_type : 4;
int universe : 8;
unsigned int account_id : 32;
unsigned int account_instance : 20;
unsigned int account_type : 4;
int universe : 8;
};
typedef union
{
raw_steam_id raw;
unsigned long long bits;
raw_steam_id raw;
unsigned long long bits;
} steam_id;
#pragma pack( push, 1 )
struct raw_game_id final
{
unsigned int app_id : 24;
unsigned int type : 8;
unsigned int mod_id : 32;
unsigned int app_id : 24;
unsigned int type : 8;
unsigned int mod_id : 32;
};
typedef union
{
raw_game_id raw;
unsigned long long bits;
raw_game_id raw;
unsigned long long bits;
} game_id;
#pragma pack( pop )
@ -43,81 +43,79 @@ typedef union
namespace steam
{
class callbacks
{
public:
class base
{
public:
base() : flags_(0), callback_(0)
{
}
class callbacks
{
public:
class base
{
public:
base() : flags_(0), callback_(0)
{
}
virtual void run(void* pv_param) = 0;
virtual void run(void* pv_param, bool failure, uint64_t handle) = 0;
virtual int get_callback_size_bytes() = 0;
virtual void run(void* pv_param) = 0;
virtual void run(void* pv_param, bool failure, uint64_t handle) = 0;
virtual int get_callback_size_bytes() = 0;
int get_i_callback() const { return callback_; }
void set_i_callback(const int i_callback) { callback_ = i_callback; }
int get_i_callback() const { return callback_; }
void set_i_callback(const int i_callback) { callback_ = i_callback; }
protected:
~base() = default;
protected:
~base() = default;
unsigned char flags_;
int callback_;
};
unsigned char flags_;
int callback_;
};
struct result final
{
void* data{};
int size{};
int type{};
uint64_t call{};
};
struct result final
{
void* data{};
int size{};
int type{};
uint64_t call{};
};
static uint64_t register_call();
static uint64_t register_call();
static void register_callback(base* handler, int callback);
static void unregister_callback(base* handler);
static void register_callback(base* handler, int callback);
static void unregister_callback(base* handler);
static void register_call_result(uint64_t call, base* result);
static void unregister_call_result(uint64_t call, base* result);
static void register_call_result(uint64_t call, base* result);
static void unregister_call_result(uint64_t call, base* result);
static void return_call(void* data, int size, int type, uint64_t call);
static void run_callbacks();
static void return_call(void* data, int size, int type, uint64_t call);
static void run_callbacks();
private:
static uint64_t call_id_;
static std::recursive_mutex mutex_;
static std::map<uint64_t, bool> calls_;
static std::map<uint64_t, base*> result_handlers_;
static std::vector<result> results_;
static std::vector<base*> callback_list_;
};
private:
static uint64_t call_id_;
static std::recursive_mutex mutex_;
static std::map<uint64_t, bool> calls_;
static std::map<uint64_t, base*> result_handlers_;
static std::vector<result> results_;
static std::vector<base*> callback_list_;
};
STEAM_EXPORT bool SteamAPI_RestartAppIfNecessary();
STEAM_EXPORT bool SteamAPI_Init();
STEAM_EXPORT void SteamAPI_RegisterCallResult(callbacks::base* result, uint64_t call);
STEAM_EXPORT void SteamAPI_RegisterCallback(callbacks::base* handler, int callback);
STEAM_EXPORT void SteamAPI_RunCallbacks();
STEAM_EXPORT void SteamAPI_Shutdown();
STEAM_EXPORT void SteamAPI_UnregisterCallResult(callbacks::base* result, const uint64_t call);
STEAM_EXPORT void SteamAPI_UnregisterCallback(callbacks::base* handler);
STEAM_EXPORT const char* SteamAPI_GetSteamInstallPath();
STEAM_EXPORT bool SteamAPI_RestartAppIfNecessary();
STEAM_EXPORT bool SteamAPI_Init();
STEAM_EXPORT void SteamAPI_RegisterCallResult(callbacks::base* result, uint64_t call);
STEAM_EXPORT void SteamAPI_RegisterCallback(callbacks::base* handler, int callback);
STEAM_EXPORT void SteamAPI_RunCallbacks();
STEAM_EXPORT void SteamAPI_Shutdown();
STEAM_EXPORT void SteamAPI_UnregisterCallResult(callbacks::base* result, const uint64_t call);
STEAM_EXPORT void SteamAPI_UnregisterCallback(callbacks::base* handler);
STEAM_EXPORT const char* SteamAPI_GetSteamInstallPath();
STEAM_EXPORT bool SteamGameServer_Init();
STEAM_EXPORT void SteamGameServer_RunCallbacks();
STEAM_EXPORT void SteamGameServer_Shutdown();
STEAM_EXPORT bool SteamGameServer_Init();
STEAM_EXPORT void SteamGameServer_RunCallbacks();
STEAM_EXPORT void SteamGameServer_Shutdown();
STEAM_EXPORT friends* SteamFriends();
STEAM_EXPORT matchmaking* SteamMatchmaking();
STEAM_EXPORT game_server* SteamGameServer();
STEAM_EXPORT networking* SteamNetworking();
STEAM_EXPORT remote_storage* SteamRemoteStorage();
STEAM_EXPORT user* SteamUser();
STEAM_EXPORT utils* SteamUtils();
STEAM_EXPORT apps* SteamApps();
STEAM_EXPORT user_stats* SteamUserStats();
} // namespace steam
STEAM_EXPORT friends* SteamFriends();
STEAM_EXPORT matchmaking* SteamMatchmaking();
STEAM_EXPORT game_server* SteamGameServer();
STEAM_EXPORT networking* SteamNetworking();
STEAM_EXPORT remote_storage* SteamRemoteStorage();
STEAM_EXPORT user* SteamUser();
STEAM_EXPORT utils* SteamUtils();
STEAM_EXPORT apps* SteamApps();
STEAM_EXPORT user_stats* SteamUserStats();
}

View File

@ -52,7 +52,8 @@ namespace utils
for (auto i = this->key_value_pairs_.begin(); i != this->key_value_pairs_.end(); ++i)
{
//if (first) first = false;
/*else*/ info_string.append("\\");
/*else*/
info_string.append("\\");
info_string.append(i->first); // Key
info_string.append("\\");

View File

@ -118,6 +118,8 @@ namespace utils::io
void copy_folder(const std::filesystem::path& src, const std::filesystem::path& target)
{
std::filesystem::copy(src, target, std::filesystem::copy_options::overwrite_existing | std::filesystem::copy_options::recursive);
std::filesystem::copy(src, target,
std::filesystem::copy_options::overwrite_existing |
std::filesystem::copy_options::recursive);
}
}

View File

@ -10,29 +10,29 @@ namespace utils::hook
{
this->mask_.clear();
this->pattern_.clear();
uint8_t nibble = 0;
auto has_nibble = false;
for(auto val : pattern)
for (auto val : pattern)
{
if (val == ' ') continue;
if(val == '?')
if (val == '?')
{
this->mask_.push_back(val);
this->pattern_.push_back(0);
}
else
{
if((val < '0' || val > '9') && (val < 'A' || val > 'F') && (val < 'a' || val> 'f'))
if ((val < '0' || val > '9') && (val < 'A' || val > 'F') && (val < 'a' || val > 'f'))
{
throw std::runtime_error("Invalid pattern");
}
char str[] = { val, 0 };
char str[] = {val, 0};
const auto current_nibble = static_cast<uint8_t>(strtol(str, nullptr, 16));
if(!has_nibble)
if (!has_nibble)
{
has_nibble = true;
nibble = current_nibble;
@ -54,7 +54,7 @@ namespace utils::hook
this->pattern_.pop_back();
}
if(this->has_sse_support())
if (this->has_sse_support())
{
while (this->pattern_.size() < 16)
{
@ -62,7 +62,7 @@ namespace utils::hook
}
}
if(has_nibble)
if (has_nibble)
{
throw std::runtime_error("Invalid pattern");
}
@ -103,7 +103,7 @@ namespace utils::hook
std::vector<size_t> signature::process_range_vectorized(uint8_t* start, const size_t length) const
{
std::vector<size_t> result;
__declspec(align(16)) char desired_mask[16] = { 0 };
__declspec(align(16)) char desired_mask[16] = {0};
for (size_t i = 0; i < this->mask_.size(); i++)
{
@ -117,7 +117,8 @@ namespace utils::hook
{
const auto address = start + i;
const auto value = _mm_loadu_si128(reinterpret_cast<const __m128i*>(address));
const auto comparison = _mm_cmpestrm(value, 16, comparand, static_cast<int>(this->mask_.size()), _SIDD_CMP_EQUAL_EACH);
const auto comparison = _mm_cmpestrm(value, 16, comparand, static_cast<int>(this->mask_.size()),
_SIDD_CMP_EQUAL_EACH);
const auto matches = _mm_and_si128(mask, comparison);
const auto equivalence = _mm_xor_si128(mask, matches);
@ -143,21 +144,22 @@ namespace utils::hook
signature::signature_result signature::process_serial() const
{
const auto sub = this->has_sse_support() ? 16 : this->mask_.size();
return { this->process_range(this->start_, this->length_ - sub) };
return {this->process_range(this->start_, this->length_ - sub)};
}
signature::signature_result signature::process_parallel() const
{
const auto sub = this->has_sse_support() ? 16 : this->mask_.size();
const auto range = this->length_ - sub;
const auto cores = std::max(1u, std::thread::hardware_concurrency() / 2); // Only use half of the available cores
const auto cores = std::max(1u, std::thread::hardware_concurrency() / 2);
// Only use half of the available cores
const auto grid = range / cores;
std::mutex mutex;
std::vector<size_t> result;
std::vector<std::thread> threads;
for(auto i = 0u; i < cores; ++i)
for (auto i = 0u; i < cores; ++i)
{
const auto start = this->start_ + (grid * i);
const auto length = (i + 1 == cores) ? (this->start_ + this->length_ - sub) - start : grid;
@ -167,23 +169,23 @@ namespace utils::hook
if (local_result.empty()) return;
std::lock_guard _(mutex);
for(const auto& address : local_result)
for (const auto& address : local_result)
{
result.push_back(address);
}
});
}
for(auto& t : threads)
for (auto& t : threads)
{
if(t.joinable())
if (t.joinable())
{
t.join();
}
}
std::sort(result.begin(), result.end());
return { std::move(result) };
return {std::move(result)};
}
bool signature::has_sse_support() const

View File

@ -12,12 +12,11 @@ namespace utils::hook
public:
signature_result(std::vector<size_t>&& matches) : matches_(std::move(matches))
{
}
[[nodiscard]] uint8_t* get(const size_t index) const
{
if(index >= this->count())
if (index >= this->count())
{
throw std::runtime_error("Invalid index");
}
@ -33,7 +32,7 @@ namespace utils::hook
private:
std::vector<size_t> matches_;
};
explicit signature(const std::string& pattern, const nt::library library = {})
: signature(pattern, library.get_ptr(), library.get_optional_header()->SizeOfImage)
{
@ -55,7 +54,7 @@ namespace utils::hook
private:
std::string mask_;
std::basic_string<uint8_t> pattern_;
uint8_t* start_;
size_t length_;

View File

@ -138,11 +138,11 @@ namespace utils::string
std::string result;
result.reserve(wstr.size());
for(const auto& chr : wstr)
for (const auto& chr : wstr)
{
result.push_back(static_cast<char>(chr));
}
return result;
}
@ -151,11 +151,11 @@ namespace utils::string
std::wstring result;
result.reserve(str.size());
for(const auto& chr : str)
for (const auto& chr : str)
{
result.push_back(static_cast<wchar_t>(chr));
}
return result;
}
#pragma warning(pop)