mirror of
https://github.com/XLabsProject/s1x-client.git
synced 2023-08-02 15:02:12 +02:00
Demonware stuff
This commit is contained in:
parent
10fc071bad
commit
2e09e7fc5b
152
src/client/component/arxan.cpp
Normal file
152
src/client/component/arxan.cpp
Normal file
@ -0,0 +1,152 @@
|
||||
#include <std_include.hpp>
|
||||
#include "loader/component_loader.hpp"
|
||||
#include "scheduler.hpp"
|
||||
#include "game/game.hpp"
|
||||
|
||||
#include <utils/hook.hpp>
|
||||
|
||||
namespace arxan
|
||||
{
|
||||
namespace
|
||||
{
|
||||
utils::hook::detour nt_close_hook;
|
||||
utils::hook::detour nt_query_information_process_hook;
|
||||
|
||||
NTSTATUS WINAPI nt_query_information_process_stub(const HANDLE handle, const PROCESSINFOCLASS info_class,
|
||||
const PVOID info,
|
||||
const ULONG info_length, const PULONG ret_length)
|
||||
{
|
||||
auto* orig = static_cast<decltype(NtQueryInformationProcess)*>(nt_query_information_process_hook.
|
||||
get_original());
|
||||
const auto status = orig(handle, info_class, info, info_length, ret_length);
|
||||
|
||||
if (NT_SUCCESS(status))
|
||||
{
|
||||
if (info_class == ProcessBasicInformation)
|
||||
{
|
||||
static DWORD explorer_pid = 0;
|
||||
if (!explorer_pid)
|
||||
{
|
||||
auto* const shell_window = GetShellWindow();
|
||||
GetWindowThreadProcessId(shell_window, &explorer_pid);
|
||||
}
|
||||
|
||||
static_cast<PPROCESS_BASIC_INFORMATION>(info)->Reserved3 = PVOID(DWORD64(explorer_pid));
|
||||
}
|
||||
else if (info_class == 30) // ProcessDebugObjectHandle
|
||||
{
|
||||
*static_cast<HANDLE*>(info) = nullptr;
|
||||
|
||||
return 0xC0000353;
|
||||
}
|
||||
else if (info_class == 7) // ProcessDebugPort
|
||||
{
|
||||
*static_cast<HANDLE*>(info) = nullptr;
|
||||
}
|
||||
else if (info_class == 31)
|
||||
{
|
||||
*static_cast<ULONG*>(info) = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
NTSTATUS NTAPI nt_close_stub(const HANDLE handle)
|
||||
{
|
||||
char info[16];
|
||||
if (NtQueryObject(handle, OBJECT_INFORMATION_CLASS(4), &info, 2, nullptr) >= 0)
|
||||
{
|
||||
auto* orig = static_cast<decltype(NtClose)*>(nt_close_hook.get_original());
|
||||
return orig(handle);
|
||||
}
|
||||
|
||||
return STATUS_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
LONG WINAPI exception_filter(const LPEXCEPTION_POINTERS info)
|
||||
{
|
||||
if (info->ExceptionRecord->ExceptionCode == STATUS_INVALID_HANDLE)
|
||||
{
|
||||
return EXCEPTION_CONTINUE_EXECUTION;
|
||||
}
|
||||
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
|
||||
void hide_being_debugged()
|
||||
{
|
||||
auto* const peb = PPEB(__readgsqword(0x60));
|
||||
peb->BeingDebugged = false;
|
||||
*reinterpret_cast<PDWORD>(LPSTR(peb) + 0xBC) &= ~0x70;
|
||||
}
|
||||
|
||||
void remove_hardware_breakpoints()
|
||||
{
|
||||
CONTEXT context;
|
||||
ZeroMemory(&context, sizeof(context));
|
||||
context.ContextFlags = CONTEXT_DEBUG_REGISTERS;
|
||||
|
||||
auto* const thread = GetCurrentThread();
|
||||
GetThreadContext(thread, &context);
|
||||
|
||||
context.Dr0 = 0;
|
||||
context.Dr1 = 0;
|
||||
context.Dr2 = 0;
|
||||
context.Dr3 = 0;
|
||||
context.Dr6 = 0;
|
||||
context.Dr7 = 0;
|
||||
|
||||
SetThreadContext(thread, &context);
|
||||
}
|
||||
|
||||
BOOL WINAPI set_thread_context_stub(const HANDLE thread, CONTEXT* context)
|
||||
{
|
||||
if (!game::environment::is_sp()
|
||||
&& game::dwGetLogOnStatus() == game::DW_LIVE_CONNECTED
|
||||
&& context->ContextFlags == CONTEXT_DEBUG_REGISTERS)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return SetThreadContext(thread, context);
|
||||
}
|
||||
}
|
||||
|
||||
class component final : public component_interface
|
||||
{
|
||||
public:
|
||||
void* load_import(const std::string& library, const std::string& function) override
|
||||
{
|
||||
if (function == "SetThreadContext")
|
||||
{
|
||||
return set_thread_context_stub;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void post_load() override
|
||||
{
|
||||
hide_being_debugged();
|
||||
scheduler::loop(hide_being_debugged, scheduler::pipeline::async);
|
||||
|
||||
const utils::nt::library ntdll("ntdll.dll");
|
||||
nt_close_hook.create(ntdll.get_proc<void*>("NtClose"), nt_close_stub);
|
||||
nt_query_information_process_hook.create(ntdll.get_proc<void*>("NtQueryInformationProcess"),
|
||||
nt_query_information_process_stub);
|
||||
|
||||
AddVectoredExceptionHandler(1, exception_filter);
|
||||
}
|
||||
|
||||
void post_unpack() override
|
||||
{
|
||||
// cba to implement sp, not sure if it's even needed
|
||||
if (game::environment::is_sp()) return;
|
||||
|
||||
//scheduler::on_game_initialized(remove_hardware_breakpoints, scheduler::pipeline::main);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
REGISTER_COMPONENT(arxan::component)
|
@ -99,14 +99,12 @@ namespace auth
|
||||
return;
|
||||
}
|
||||
|
||||
// THIS CRASHES WITH DEDICATED WHEN CONNECTING!
|
||||
/*utils::cryptography::ecc::key key;
|
||||
utils::cryptography::ecc::key key;
|
||||
key.set(info.publickey());
|
||||
|
||||
//const auto xuid = strtoull(steam_id.data(), nullptr, 16);
|
||||
//if (xuid != key.get_hash())
|
||||
const auto xuid = strtoull(steam_id.data(), nullptr, 16);
|
||||
if (xuid != key.get_hash())
|
||||
{
|
||||
// xuid is always 0
|
||||
//MessageBoxA(nullptr, steam_id.data(), std::to_string(key.get_hash()).data(), 0);
|
||||
//network::send(*from, "error", "XUID doesn't match the certificate!", '\n');
|
||||
//return;
|
||||
@ -116,7 +114,7 @@ namespace auth
|
||||
{
|
||||
network::send(*from, "error", "Challenge signature was invalid!", '\n');
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
|
||||
game::SV_DirectConnect(from);
|
||||
}
|
||||
@ -140,12 +138,12 @@ namespace auth
|
||||
|
||||
uint64_t get_guid()
|
||||
{
|
||||
if (game::environment::is_dedi())
|
||||
//if (game::environment::is_dedi())
|
||||
{
|
||||
return 0x110000100000000 | (::utils::cryptography::random::get_integer() & ~0x80000000);
|
||||
}
|
||||
|
||||
return get_key().get_hash();
|
||||
//return get_key().get_hash();
|
||||
}
|
||||
|
||||
class component final : public component_interface
|
||||
|
@ -48,8 +48,8 @@ namespace branding
|
||||
|
||||
scheduler::loop([]()
|
||||
{
|
||||
const auto x = 3;
|
||||
const auto y = 0;
|
||||
const auto x = 4;
|
||||
const auto y = 4;
|
||||
const auto scale = 1.0f;
|
||||
float color[4] = { 0.666f, 0.666f, 0.666f, 0.666f };
|
||||
const auto* text = "S1-Mod: " VERSION;
|
||||
|
@ -4,27 +4,11 @@
|
||||
#include "game_module.hpp"
|
||||
|
||||
#include <utils/hook.hpp>
|
||||
#include <utils/nt.hpp>
|
||||
#include <utils/cryptography.hpp>
|
||||
#include <utils/thread.hpp>
|
||||
|
||||
#include "game/game.hpp"
|
||||
|
||||
#include "game/demonware/stun_server.hpp"
|
||||
#include "game/demonware/service_server.hpp"
|
||||
|
||||
#include "game/demonware/services/bdLSGHello.hpp" // 7
|
||||
#include "game/demonware/services/bdStorage.hpp" // 10
|
||||
#include "game/demonware/services/bdDediAuth.hpp" // 12
|
||||
#include "game/demonware/services/bdTitleUtilities.hpp" // 12
|
||||
#include "game/demonware/services/bdBandwidthTest.hpp" // 18
|
||||
#include "game/demonware/services/bdMatchMaking.hpp" // 21
|
||||
#include "game/demonware/services/bdDediRSAAuth.hpp" // 26
|
||||
#include "game/demonware/services/bdDML.hpp" // 27
|
||||
#include "game/demonware/services/bdGroup.hpp" // 28
|
||||
#include "game/demonware/services/bdSteamAuth.hpp" // 28
|
||||
#include "game/demonware/services/bdAnticheat.hpp" // 38
|
||||
#include "game/demonware/services/bdRelayService.hpp" // 86
|
||||
#include "game/demonware/demonware.hpp"
|
||||
|
||||
#define TCP_BLOCKING true
|
||||
#define UDP_BLOCKING false
|
||||
@ -33,183 +17,14 @@ namespace demonware
|
||||
{
|
||||
namespace
|
||||
{
|
||||
volatile bool terminate;
|
||||
std::thread message_thread;
|
||||
std::recursive_mutex server_mutex;
|
||||
std::map<SOCKET, bool> blocking_sockets;
|
||||
std::map<SOCKET, std::shared_ptr<service_server>> socket_links;
|
||||
std::map<unsigned long, std::shared_ptr<service_server>> servers;
|
||||
std::map<unsigned long, std::shared_ptr<stun_server>> stun_servers;
|
||||
std::map<SOCKET, std::queue<std::pair<std::string, std::string>>> datagram_packets;
|
||||
|
||||
uint8_t encryption_key_[24];
|
||||
uint8_t decryption_key_[24];
|
||||
|
||||
std::shared_ptr<service_server> find_server_by_address(const unsigned long address)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(server_mutex);
|
||||
|
||||
const auto server = servers.find(address);
|
||||
if (server != servers.end())
|
||||
{
|
||||
return server->second;
|
||||
}
|
||||
|
||||
return std::shared_ptr<service_server>();
|
||||
}
|
||||
|
||||
std::shared_ptr<service_server> find_server_by_name(const std::string& name)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(server_mutex);
|
||||
return find_server_by_address(utils::cryptography::jenkins_one_at_a_time::compute(name));
|
||||
}
|
||||
|
||||
std::shared_ptr<stun_server> find_stun_server_by_address(const unsigned long address)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(server_mutex);
|
||||
|
||||
const auto server = stun_servers.find(address);
|
||||
if (server != stun_servers.end())
|
||||
{
|
||||
return server->second;
|
||||
}
|
||||
|
||||
return std::shared_ptr<stun_server>();
|
||||
}
|
||||
|
||||
std::shared_ptr<stun_server> find_stun_server_by_name(const std::string& name)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(server_mutex);
|
||||
return find_stun_server_by_address(utils::cryptography::jenkins_one_at_a_time::compute(name));
|
||||
}
|
||||
|
||||
std::shared_ptr<service_server> find_server_by_socket(const SOCKET s)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(server_mutex);
|
||||
|
||||
const auto server = socket_links.find(s);
|
||||
if (server != socket_links.end())
|
||||
{
|
||||
return server->second;
|
||||
}
|
||||
|
||||
return std::shared_ptr<service_server>();
|
||||
}
|
||||
|
||||
bool link_socket(const SOCKET s, const unsigned long address)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(server_mutex);
|
||||
|
||||
const auto server = find_server_by_address(address);
|
||||
if (!server) return false;
|
||||
|
||||
socket_links[s] = server;
|
||||
return true;
|
||||
}
|
||||
|
||||
void unlink_socket(const SOCKET sock)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(server_mutex);
|
||||
|
||||
const auto server = socket_links.find(sock);
|
||||
if (server != socket_links.end())
|
||||
{
|
||||
socket_links.erase(server);
|
||||
}
|
||||
|
||||
const auto dgram_packets = datagram_packets.find(sock);
|
||||
if (dgram_packets != datagram_packets.end())
|
||||
{
|
||||
datagram_packets.erase(dgram_packets);
|
||||
}
|
||||
}
|
||||
|
||||
bool is_blocking_socket(const SOCKET s, const bool def)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(server_mutex);
|
||||
|
||||
if (blocking_sockets.find(s) != blocking_sockets.end())
|
||||
{
|
||||
return blocking_sockets[s];
|
||||
}
|
||||
|
||||
return def;
|
||||
}
|
||||
|
||||
int recv_datagam_packet(const SOCKET s, char* buf, const int len, sockaddr* from, int* fromlen)
|
||||
{
|
||||
std::unique_lock<std::recursive_mutex> lock(server_mutex);
|
||||
|
||||
auto queue = datagram_packets.find(s);
|
||||
if (queue != datagram_packets.end())
|
||||
{
|
||||
const auto blocking = is_blocking_socket(s, UDP_BLOCKING);
|
||||
|
||||
lock.unlock();
|
||||
while (blocking && queue->second.empty())
|
||||
{
|
||||
std::this_thread::sleep_for(1ms);
|
||||
}
|
||||
lock.lock();
|
||||
|
||||
if (!queue->second.empty())
|
||||
{
|
||||
auto [address, data] = queue->second.front();
|
||||
queue->second.pop();
|
||||
|
||||
*fromlen = INT(address.size());
|
||||
std::memcpy(from, address.data(), address.size());
|
||||
|
||||
const auto size = std::min(size_t(len), data.size());
|
||||
std::memcpy(buf, data.data(), size);
|
||||
|
||||
return static_cast<int>(size);
|
||||
}
|
||||
|
||||
WSASetLastError(WSAEWOULDBLOCK);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void remove_blocking_socket(const SOCKET s)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(server_mutex);
|
||||
|
||||
const auto entry = blocking_sockets.find(s);
|
||||
if (entry != blocking_sockets.end())
|
||||
{
|
||||
blocking_sockets.erase(entry);
|
||||
}
|
||||
}
|
||||
|
||||
void set_blocking_socket(const SOCKET s, const bool blocking)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(server_mutex);
|
||||
blocking_sockets[s] = blocking;
|
||||
}
|
||||
|
||||
void server_thread()
|
||||
{
|
||||
terminate = false;
|
||||
while (!terminate)
|
||||
{
|
||||
std::unique_lock<std::recursive_mutex> lock(server_mutex);
|
||||
|
||||
for (auto& server : servers)
|
||||
{
|
||||
server.second->run_frame();
|
||||
}
|
||||
|
||||
lock.unlock();
|
||||
|
||||
std::this_thread::sleep_for(50ms);
|
||||
}
|
||||
}
|
||||
|
||||
void bd_logger_stub(const char* const function, const char* const msg, ...)
|
||||
{
|
||||
static auto* enabled = game::Dvar_RegisterBool("bd_logger_enabled", false, game::DVAR_FLAG_NONE, "bdLogger");
|
||||
if (!enabled->current.enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
char buffer[2048];
|
||||
|
||||
va_list ap;
|
||||
@ -220,198 +35,350 @@ namespace demonware
|
||||
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
|
||||
namespace io
|
||||
{
|
||||
int __stdcall send_to(const SOCKET s, const char* buf, const int len, const int flags, const sockaddr* to,
|
||||
const int tolen)
|
||||
{
|
||||
if (tolen == sizeof(sockaddr_in))
|
||||
{
|
||||
const auto* in_addr = reinterpret_cast<const sockaddr_in*>(to);
|
||||
const auto server = find_stun_server_by_address(in_addr->sin_addr.s_addr);
|
||||
if (server) return server->send(s, buf, len, to, tolen);
|
||||
}
|
||||
volatile bool exit_server;
|
||||
std::thread server_thread;
|
||||
std::recursive_mutex server_mutex;
|
||||
std::map<SOCKET, bool> sockets_blocking;
|
||||
std::map<SOCKET, server_ptr> sockets;
|
||||
std::map<std::uint32_t, server_ptr> servers;
|
||||
|
||||
return sendto(s, buf, len, flags, to, tolen);
|
||||
}
|
||||
void register_server(server_ptr server)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> $(server_mutex);
|
||||
|
||||
int __stdcall recv_from(const SOCKET s, char* buf, const int len, const int flags, sockaddr* from,
|
||||
int* fromlen)
|
||||
{
|
||||
auto res = recv_datagam_packet(s, buf, len, from, fromlen);
|
||||
if (res != 0) return res;
|
||||
servers[server->address()] = server;
|
||||
}
|
||||
|
||||
res = recvfrom(s, buf, len, flags, from, fromlen);
|
||||
auto find_server_by_address(const std::uint32_t address) -> server_ptr
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> $(server_mutex);
|
||||
|
||||
return res;
|
||||
}
|
||||
const auto it = servers.find(address);
|
||||
|
||||
int __stdcall send(const SOCKET s, const char* buf, const int len, const int flags)
|
||||
{
|
||||
auto server = find_server_by_socket(s);
|
||||
if (server) return server->send(buf, len);
|
||||
if (it != servers.end())
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
|
||||
return ::send(s, buf, len, flags);
|
||||
}
|
||||
return server_ptr(nullptr);
|
||||
}
|
||||
|
||||
int __stdcall recv(const SOCKET s, char* buf, const int len, const int flags)
|
||||
{
|
||||
auto server = find_server_by_socket(s);
|
||||
if (server)
|
||||
{
|
||||
const auto blocking = is_blocking_socket(s, TCP_BLOCKING);
|
||||
auto find_server_by_name(const std::string& name) -> server_ptr
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> $(server_mutex);
|
||||
|
||||
int result;
|
||||
do
|
||||
{
|
||||
result = server->recv(buf, len);
|
||||
if (blocking && result < 0) std::this_thread::sleep_for(1ms);
|
||||
}
|
||||
while (blocking && result < 0);
|
||||
return find_server_by_address(utils::cryptography::jenkins_one_at_a_time::compute(name));
|
||||
}
|
||||
|
||||
if (!blocking && result < 0)
|
||||
{
|
||||
WSASetLastError(WSAEWOULDBLOCK);
|
||||
}
|
||||
auto find_server_by_socket(const SOCKET socket) -> server_ptr
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> $(server_mutex);
|
||||
|
||||
return result;
|
||||
}
|
||||
const auto it = sockets.find(socket);
|
||||
|
||||
return ::recv(s, buf, len, flags);
|
||||
}
|
||||
if (it != sockets.end())
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
|
||||
int __stdcall connect(const SOCKET s, const sockaddr* addr, const int len)
|
||||
{
|
||||
if (len == sizeof(sockaddr_in))
|
||||
{
|
||||
const auto* in_addr = reinterpret_cast<const sockaddr_in*>(addr);
|
||||
if (link_socket(s, in_addr->sin_addr.s_addr)) return 0;
|
||||
}
|
||||
return server_ptr(nullptr);
|
||||
}
|
||||
|
||||
return ::connect(s, addr, len);
|
||||
}
|
||||
auto socket_link(const SOCKET socket, std::uint32_t address) -> bool
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> $(server_mutex);
|
||||
|
||||
int __stdcall close_socket(const SOCKET s)
|
||||
{
|
||||
remove_blocking_socket(s);
|
||||
unlink_socket(s);
|
||||
return closesocket(s);
|
||||
}
|
||||
const auto server = find_server_by_address(address);
|
||||
|
||||
int __stdcall ioctl_socket(const SOCKET s, const long cmd, u_long* argp)
|
||||
{
|
||||
if (static_cast<unsigned long>(cmd) == (FIONBIO))
|
||||
{
|
||||
set_blocking_socket(s, *argp == 0);
|
||||
}
|
||||
if (!server) return false;
|
||||
|
||||
return ioctlsocket(s, cmd, argp);
|
||||
}
|
||||
sockets[socket] = server;
|
||||
|
||||
hostent* __stdcall get_host_by_name(char* name)
|
||||
{
|
||||
unsigned long addr = 0;
|
||||
const auto server = find_server_by_name(name);
|
||||
if (server) addr = server->get_address();
|
||||
return true;
|
||||
}
|
||||
|
||||
const auto stun_server = find_stun_server_by_name(name);
|
||||
if (stun_server) addr = stun_server->get_address();
|
||||
void socket_unlink(const SOCKET socket)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> $(server_mutex);
|
||||
|
||||
if (server || stun_server)
|
||||
{
|
||||
static thread_local in_addr address;
|
||||
address.s_addr = addr;
|
||||
const auto it = sockets.find(socket);
|
||||
|
||||
static thread_local in_addr* addr_list[2];
|
||||
addr_list[0] = &address;
|
||||
addr_list[1] = nullptr;
|
||||
if (it != sockets.end())
|
||||
{
|
||||
sockets.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
static thread_local hostent host;
|
||||
host.h_name = name;
|
||||
host.h_aliases = nullptr;
|
||||
host.h_addrtype = AF_INET;
|
||||
host.h_length = sizeof(in_addr);
|
||||
host.h_addr_list = reinterpret_cast<char**>(addr_list);
|
||||
auto socket_is_blocking(const SOCKET socket, const bool def) -> bool
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> $(server_mutex);
|
||||
|
||||
return &host;
|
||||
}
|
||||
if (sockets_blocking.find(socket) != sockets_blocking.end())
|
||||
{
|
||||
return sockets_blocking[socket];
|
||||
}
|
||||
|
||||
return def;
|
||||
}
|
||||
|
||||
void remove_blocking_socket(const SOCKET socket)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> $(server_mutex);
|
||||
|
||||
const auto it = sockets_blocking.find(socket);
|
||||
|
||||
if (it != sockets_blocking.end())
|
||||
{
|
||||
sockets_blocking.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
void add_blocking_socket(const SOCKET socket, const bool block)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> $(server_mutex);
|
||||
|
||||
sockets_blocking[socket] = block;
|
||||
}
|
||||
|
||||
void server_main()
|
||||
{
|
||||
exit_server = false;
|
||||
|
||||
while (!exit_server)
|
||||
{
|
||||
std::unique_lock<std::recursive_mutex> $(server_mutex);
|
||||
|
||||
for (auto& server : servers)
|
||||
{
|
||||
server.second->frame();
|
||||
}
|
||||
|
||||
$.unlock();
|
||||
|
||||
std::this_thread::sleep_for(50ms);
|
||||
}
|
||||
}
|
||||
|
||||
// WINSOCK
|
||||
|
||||
namespace io
|
||||
{
|
||||
int getaddrinfo_stub(PCSTR pNodeName, PCSTR pServiceName, const ADDRINFOA* pHints, PADDRINFOA* ppResult)
|
||||
{
|
||||
printf("[ network ]: [getaddrinfo]: %s\n", pNodeName);
|
||||
return getaddrinfo(pNodeName, pServiceName, pHints, ppResult);
|
||||
}
|
||||
|
||||
hostent* gethostbyname_stub(const char* name)
|
||||
{
|
||||
printf("[ network ]: [gethostbyname]: \"%s\"\n", name);
|
||||
|
||||
const auto server = find_server_by_name(name);
|
||||
|
||||
if (server)
|
||||
{
|
||||
static thread_local in_addr address;
|
||||
address.s_addr = server->address();
|
||||
|
||||
static thread_local in_addr* addr_list[2];
|
||||
addr_list[0] = &address;
|
||||
addr_list[1] = nullptr;
|
||||
|
||||
static thread_local hostent host;
|
||||
host.h_name = const_cast<char*>(name);
|
||||
host.h_aliases = nullptr;
|
||||
host.h_addrtype = AF_INET;
|
||||
host.h_length = sizeof(in_addr);
|
||||
host.h_addr_list = reinterpret_cast<char**>(addr_list);
|
||||
|
||||
return &host;
|
||||
}
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4996)
|
||||
return gethostbyname(name);
|
||||
return gethostbyname(name);
|
||||
#pragma warning(pop)
|
||||
}
|
||||
}
|
||||
|
||||
bool register_hook(const std::string& process, void* stub)
|
||||
{
|
||||
const auto game_module = game_module::get_game_module();
|
||||
int connect_stub(SOCKET s, const struct sockaddr* addr, int len)
|
||||
{
|
||||
if (len == sizeof(sockaddr_in))
|
||||
{
|
||||
const auto* in_addr = reinterpret_cast<const sockaddr_in*>(addr);
|
||||
if (socket_link(s, in_addr->sin_addr.s_addr)) return 0;
|
||||
}
|
||||
|
||||
auto result = false;
|
||||
result = result || utils::hook::iat(game_module, "wsock32.dll", process, stub);
|
||||
result = result || utils::hook::iat(game_module, "WS2_32.dll", process, stub);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return connect(s, addr, len);
|
||||
}
|
||||
|
||||
void send_datagram_packet(const SOCKET s, const std::string& data, const sockaddr* to, const int tolen)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(server_mutex);
|
||||
datagram_packets[s].push({std::string(LPSTR(to), size_t(tolen)), data});
|
||||
}
|
||||
int closesocket_stub(SOCKET s)
|
||||
{
|
||||
remove_blocking_socket(s);
|
||||
socket_unlink(s);
|
||||
|
||||
uint8_t* get_key(const bool encrypt)
|
||||
{
|
||||
return encrypt ? encryption_key_ : decryption_key_;
|
||||
}
|
||||
return closesocket(s);
|
||||
}
|
||||
|
||||
void set_key(const bool encrypt, uint8_t* key)
|
||||
{
|
||||
static_assert(sizeof encryption_key_ == sizeof decryption_key_);
|
||||
std::memcpy(encrypt ? encryption_key_ : decryption_key_, key, sizeof encryption_key_);
|
||||
}
|
||||
int send_stub(SOCKET s, const char* buf, int len, int flags)
|
||||
{
|
||||
auto server = find_server_by_socket(s);
|
||||
|
||||
if (server)
|
||||
{
|
||||
return server->recv(buf, len);
|
||||
}
|
||||
|
||||
return send(s, buf, len, flags);
|
||||
}
|
||||
|
||||
int recv_stub(SOCKET s, char* buf, int len, int flags)
|
||||
{
|
||||
auto server = find_server_by_socket(s);
|
||||
|
||||
if (server)
|
||||
{
|
||||
if (server->pending_data())
|
||||
{
|
||||
return server->send(buf, len);
|
||||
}
|
||||
else
|
||||
{
|
||||
WSASetLastError(WSAEWOULDBLOCK);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return recv(s, buf, len, flags);
|
||||
}
|
||||
|
||||
int sendto_stub(SOCKET s, const char* buf, int len, int flags, const struct sockaddr* to, int tolen)
|
||||
{
|
||||
|
||||
|
||||
return sendto(s, buf, len, flags, to, tolen);
|
||||
}
|
||||
|
||||
int recvfrom_stub(SOCKET s, char* buf, int len, int flags, struct sockaddr* from, int* fromlen)
|
||||
{
|
||||
|
||||
|
||||
return recvfrom(s, buf, len, flags, from, fromlen);
|
||||
}
|
||||
|
||||
int select_stub(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, struct timeval* timeout)
|
||||
{
|
||||
int result = 0;
|
||||
std::vector<SOCKET> read_sockets;
|
||||
std::vector<SOCKET> write_sockets;
|
||||
|
||||
for (auto& s : sockets)
|
||||
{
|
||||
if (readfds)
|
||||
{
|
||||
if (FD_ISSET(s.first, readfds))
|
||||
{
|
||||
if (s.second->pending_data())
|
||||
{
|
||||
read_sockets.push_back(s.first);
|
||||
FD_CLR(s.first, readfds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (writefds)
|
||||
{
|
||||
if (FD_ISSET(s.first, writefds))
|
||||
{
|
||||
write_sockets.push_back(s.first);
|
||||
FD_CLR(s.first, writefds);
|
||||
}
|
||||
}
|
||||
|
||||
if (exceptfds)
|
||||
{
|
||||
if (FD_ISSET(s.first, exceptfds))
|
||||
{
|
||||
FD_CLR(s.first, exceptfds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((!readfds || readfds->fd_count == 0) && (!writefds || writefds->fd_count == 0))
|
||||
{
|
||||
timeout->tv_sec = 0;
|
||||
timeout->tv_usec = 0;
|
||||
}
|
||||
|
||||
result = select(nfds, readfds, writefds, exceptfds, timeout);
|
||||
if (result < 0) result = 0;
|
||||
|
||||
for (size_t i = 0; i < read_sockets.size(); i++)
|
||||
{
|
||||
if (readfds)
|
||||
{
|
||||
FD_SET(read_sockets.at(i), readfds);
|
||||
result++;
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < write_sockets.size(); i++)
|
||||
{
|
||||
if (writefds)
|
||||
{
|
||||
FD_SET(write_sockets.at(i), writefds);
|
||||
result++;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int ioctlsocket_stub(const SOCKET s, const long cmd, u_long* argp)
|
||||
{
|
||||
if (static_cast<unsigned long>(cmd) == (FIONBIO))
|
||||
{
|
||||
add_blocking_socket(s, *argp == 0);
|
||||
}
|
||||
|
||||
return ioctlsocket(s, cmd, argp);
|
||||
}
|
||||
|
||||
bool register_hook(const std::string& process, void* stub)
|
||||
{
|
||||
const auto game_module = game_module::get_game_module();
|
||||
|
||||
auto result = false;
|
||||
result = result || utils::hook::iat(game_module, "wsock32.dll", process, stub);
|
||||
result = result || utils::hook::iat(game_module, "WS2_32.dll", process, stub);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
class component final : public component_interface
|
||||
{
|
||||
public:
|
||||
component()
|
||||
{
|
||||
register_stun_server("s1-stun.us.demonware.net");
|
||||
register_stun_server("s1-stun.eu.demonware.net");
|
||||
register_stun_server("s1-stun.jp.demonware.net");
|
||||
register_stun_server("s1-stun.au.demonware.net");
|
||||
|
||||
auto lsg_server = register_server("aw-pc-lobby.prod.demonware.net");
|
||||
auto auth_server = register_server("aw-pc-auth3.prod.demonware.net");
|
||||
|
||||
auth_server->register_service<bdDediAuth>();
|
||||
auth_server->register_service<bdSteamAuth>();
|
||||
auth_server->register_service<bdDediRSAAuth>();
|
||||
|
||||
lsg_server->register_service<bdLSGHello>();
|
||||
lsg_server->register_service<bdStorage>();
|
||||
lsg_server->register_service<bdTitleUtilities>();
|
||||
lsg_server->register_service<bdDML>();
|
||||
lsg_server->register_service<bdMatchMaking>();
|
||||
lsg_server->register_service<bdBandwidthTest>();
|
||||
lsg_server->register_service<bdGroup>();
|
||||
lsg_server->register_service<bdAnticheat>();
|
||||
lsg_server->register_service<bdRelayService>();
|
||||
register_server(std::make_shared<demonware::server_auth3>("aw-pc-auth3.prod.demonware.net"));
|
||||
register_server(std::make_shared<demonware::server_lobby>("aw-pc-lobby.prod.demonware.net"));
|
||||
}
|
||||
|
||||
void post_load() override
|
||||
{
|
||||
message_thread = utils::thread::create_named_thread("Demonware", server_thread);
|
||||
server_thread = utils::thread::create_named_thread("Demonware", server_main);
|
||||
|
||||
io::register_hook("send", io::send);
|
||||
io::register_hook("recv", io::recv);
|
||||
io::register_hook("sendto", io::send_to);
|
||||
io::register_hook("recvfrom", io::recv_from);
|
||||
io::register_hook("connect", io::connect);
|
||||
io::register_hook("closesocket", io::close_socket);
|
||||
io::register_hook("ioctlsocket", io::ioctl_socket);
|
||||
io::register_hook("gethostbyname", io::get_host_by_name);
|
||||
io::register_hook("send", io::send_stub);
|
||||
io::register_hook("recv", io::recv_stub);
|
||||
io::register_hook("sendto", io::sendto_stub);
|
||||
io::register_hook("recvfrom", io::recvfrom_stub);
|
||||
io::register_hook("select", io::select_stub);
|
||||
io::register_hook("connect", io::connect_stub);
|
||||
io::register_hook("closesocket", io::closesocket_stub);
|
||||
io::register_hook("ioctlsocket", io::ioctlsocket_stub);
|
||||
io::register_hook("gethostbyname", io::gethostbyname_stub);
|
||||
io::register_hook("getaddrinfo", io::getaddrinfo_stub);
|
||||
}
|
||||
|
||||
void post_unpack() override
|
||||
@ -430,39 +397,15 @@ namespace demonware
|
||||
utils::hook::set<uint8_t>(0x14088D0E8, 0x0); // HTTPS -> HTTP
|
||||
}
|
||||
|
||||
void pre_destroy() override
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(server_mutex);
|
||||
void pre_destroy() override
|
||||
{
|
||||
if (server_thread.joinable())
|
||||
{
|
||||
server_thread.join();
|
||||
}
|
||||
|
||||
terminate = true;
|
||||
if (message_thread.joinable())
|
||||
{
|
||||
message_thread.join();
|
||||
}
|
||||
|
||||
servers.clear();
|
||||
stun_servers.clear();
|
||||
socket_links.clear();
|
||||
blocking_sockets.clear();
|
||||
datagram_packets.clear();
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
static std::shared_ptr<service_server> register_server(Args ... args)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(server_mutex);
|
||||
auto server = std::make_shared<service_server>(args...);
|
||||
servers[server->get_address()] = server;
|
||||
return server;
|
||||
}
|
||||
|
||||
static std::shared_ptr<stun_server> register_stun_server(const std::string& name)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(server_mutex);
|
||||
auto server = std::make_shared<stun_server>(name);
|
||||
stun_servers[server->get_address()] = server;
|
||||
return server;
|
||||
}
|
||||
servers.clear();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,5 @@
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
void send_datagram_packet(SOCKET s, const std::string& data, const sockaddr* to, int tolen);
|
||||
|
||||
uint8_t* get_key(const bool encrypt);
|
||||
void set_key(bool encrypt, uint8_t* key);
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include <std_include.hpp>
|
||||
#include "bit_buffer.hpp"
|
||||
#include "demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
@ -41,14 +41,14 @@ namespace demonware
|
||||
return false;
|
||||
}
|
||||
|
||||
bool bit_buffer::write_bytes(const size_t bytes, const char* data)
|
||||
bool bit_buffer::write_bytes(const unsigned int bytes, const char* data)
|
||||
{
|
||||
return this->write_bytes(bytes, reinterpret_cast<const unsigned char*>(data));
|
||||
}
|
||||
|
||||
bool bit_buffer::write_bytes(const size_t bytes, const unsigned char* data)
|
||||
bool bit_buffer::write_bytes(const unsigned int bytes, const unsigned char* data)
|
||||
{
|
||||
return this->write(static_cast<unsigned>(bytes) * 8, data);
|
||||
return this->write(bytes * 8, data);
|
||||
}
|
||||
|
||||
bool bit_buffer::write_bool(bool data)
|
||||
|
@ -16,8 +16,8 @@ namespace demonware
|
||||
bool read_uint32(unsigned int* output);
|
||||
bool read_data_type(char expected);
|
||||
|
||||
bool write_bytes(size_t bytes, const char* data);
|
||||
bool write_bytes(size_t bytes, const unsigned char* data);
|
||||
bool write_bytes(unsigned int bytes, const char* data);
|
||||
bool write_bytes(unsigned int bytes, const unsigned char* data);
|
||||
bool write_bool(bool data);
|
||||
bool write_int32(int data);
|
||||
bool write_uint32(unsigned int data);
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include <std_include.hpp>
|
||||
#include "byte_buffer.hpp"
|
||||
#include "demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
@ -128,16 +128,11 @@ namespace demonware
|
||||
|
||||
char type;
|
||||
this->read(1, &type);
|
||||
if (type != expected)
|
||||
{
|
||||
//throw std::runtime_error("Data type mismatch!");
|
||||
}
|
||||
|
||||
return type == expected;
|
||||
}
|
||||
|
||||
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;
|
||||
@ -242,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);
|
||||
@ -259,7 +254,7 @@ namespace demonware
|
||||
return result;
|
||||
}
|
||||
|
||||
bool byte_buffer::read(const size_t bytes, void* output)
|
||||
bool byte_buffer::read(const int bytes, void* output)
|
||||
{
|
||||
if (bytes + this->current_byte_ > this->buffer_.size()) return false;
|
||||
|
||||
@ -269,16 +264,16 @@ namespace demonware
|
||||
return true;
|
||||
}
|
||||
|
||||
bool byte_buffer::write(const size_t bytes, const void* data)
|
||||
bool byte_buffer::write(const int bytes, const void* data)
|
||||
{
|
||||
this->buffer_.append(static_cast<const char*>(data), bytes);
|
||||
this->buffer_.append(reinterpret_cast<const char*>(data), bytes);
|
||||
this->current_byte_ += bytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool byte_buffer::write(const std::string& data)
|
||||
{
|
||||
return this->write(data.size(), data.data());
|
||||
return this->write(static_cast<int>(data.size()), data.data());
|
||||
}
|
||||
|
||||
void byte_buffer::set_use_data_types(const bool use_data_types)
|
||||
|
@ -28,7 +28,7 @@ namespace demonware
|
||||
bool read_data_type(char expected);
|
||||
|
||||
bool read_array_header(unsigned char expected, unsigned int* element_count,
|
||||
unsigned int* element_size = nullptr);
|
||||
unsigned int* element_size = nullptr);
|
||||
|
||||
bool write_byte(char data);
|
||||
bool write_bool(bool data);
|
||||
@ -47,8 +47,8 @@ namespace demonware
|
||||
|
||||
bool write_array_header(unsigned char type, unsigned int element_count, unsigned int element_size);
|
||||
|
||||
bool read(size_t bytes, void* output);
|
||||
bool write(size_t bytes, const void* data);
|
||||
bool read(int bytes, void* output);
|
||||
bool write(int bytes, const void* data);
|
||||
bool write(const std::string& data);
|
||||
|
||||
void set_use_data_types(bool use_data_types);
|
||||
|
@ -1,10 +1,17 @@
|
||||
#pragma once
|
||||
#include "i_server.hpp"
|
||||
#include "game/structs.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class bdFileData final : public i_serializable
|
||||
|
||||
class bdTaskResult
|
||||
{
|
||||
public:
|
||||
virtual ~bdTaskResult() = default;
|
||||
virtual void serialize(byte_buffer*) { }
|
||||
virtual void deserialize(byte_buffer*) { }
|
||||
};
|
||||
|
||||
class bdFileData final : public bdTaskResult
|
||||
{
|
||||
public:
|
||||
std::string file_data;
|
||||
@ -24,7 +31,7 @@ namespace demonware
|
||||
}
|
||||
};
|
||||
|
||||
class bdFileInfo final : public i_serializable
|
||||
class bdFileInfo final : public bdTaskResult
|
||||
{
|
||||
public:
|
||||
uint64_t file_id;
|
||||
@ -58,32 +65,7 @@ namespace demonware
|
||||
}
|
||||
};
|
||||
|
||||
class bdGroupCount final : public i_serializable
|
||||
{
|
||||
public:
|
||||
uint32_t group_id;
|
||||
uint32_t group_count;
|
||||
|
||||
bdGroupCount()
|
||||
{
|
||||
this->group_id = 0;
|
||||
this->group_count = 0;
|
||||
}
|
||||
|
||||
void serialize(byte_buffer* buffer) override
|
||||
{
|
||||
buffer->write_uint32(this->group_id);
|
||||
buffer->write_uint32(this->group_count);
|
||||
}
|
||||
|
||||
void deserialize(byte_buffer* buffer) override
|
||||
{
|
||||
buffer->read_uint32(&this->group_id);
|
||||
buffer->read_uint32(&this->group_count);
|
||||
}
|
||||
};
|
||||
|
||||
class bdTimeStamp final : public i_serializable
|
||||
class bdTimeStamp final : public bdTaskResult
|
||||
{
|
||||
public:
|
||||
uint32_t unix_time;
|
||||
@ -99,7 +81,7 @@ namespace demonware
|
||||
}
|
||||
};
|
||||
|
||||
class bdDMLInfo : public i_serializable
|
||||
class bdDMLInfo : public bdTaskResult
|
||||
{
|
||||
public:
|
||||
std::string country_code; // Char [3]
|
||||
@ -153,297 +135,4 @@ namespace demonware
|
||||
}
|
||||
};
|
||||
|
||||
class bdSessionID final : public i_serializable
|
||||
{
|
||||
public:
|
||||
uint64_t session_id;
|
||||
|
||||
void serialize(byte_buffer* buffer) override
|
||||
{
|
||||
buffer->write_blob(LPSTR(&this->session_id), sizeof this->session_id);
|
||||
}
|
||||
|
||||
void deserialize(byte_buffer* buffer) override
|
||||
{
|
||||
int size{};
|
||||
char* data{};
|
||||
buffer->read_blob(&data, &size);
|
||||
|
||||
if (data && uint32_t(size) >= sizeof(this->session_id))
|
||||
{
|
||||
this->session_id = *reinterpret_cast<uint64_t*>(data);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class bdMatchmakingInfo : public i_serializable
|
||||
{
|
||||
public:
|
||||
bdSessionID session_id{};
|
||||
std::string host_addr{};
|
||||
uint32_t game_type{};
|
||||
uint32_t max_players{};
|
||||
uint32_t num_players{};
|
||||
|
||||
bool symmetric = false;
|
||||
|
||||
void serialize(byte_buffer* buffer) override
|
||||
{
|
||||
buffer->write_blob(this->host_addr);
|
||||
this->session_id.serialize(buffer);
|
||||
buffer->write_uint32(this->game_type);
|
||||
buffer->write_uint32(this->max_players);
|
||||
buffer->write_uint32(this->num_players);
|
||||
}
|
||||
|
||||
void deserialize(byte_buffer* buffer) override
|
||||
{
|
||||
buffer->read_blob(&this->host_addr);
|
||||
|
||||
if (this->symmetric) this->session_id.deserialize(buffer);
|
||||
|
||||
buffer->read_uint32(&this->game_type);
|
||||
buffer->read_uint32(&this->max_players);
|
||||
|
||||
if (this->symmetric) buffer->read_uint32(&this->num_players);
|
||||
}
|
||||
};
|
||||
|
||||
class MatchMakingInfo final : public bdMatchmakingInfo
|
||||
{
|
||||
public:
|
||||
int32_t playlist_number{};
|
||||
int32_t playlist_version{};
|
||||
int32_t netcode_version{};
|
||||
int32_t map_packs{};
|
||||
int32_t slots_needed_on_team{};
|
||||
int32_t skill{};
|
||||
uint32_t country_code{};
|
||||
uint32_t asn{};
|
||||
float latitude{};
|
||||
float longitude{};
|
||||
int32_t max_reserved_slots{};
|
||||
int32_t used_reserved_slots{};
|
||||
std::string game_security_key{}; // 16 bytes.
|
||||
std::string platform_session_id{}; // 16 bytes.
|
||||
uint32_t data_centres{};
|
||||
uint32_t coop_state{};
|
||||
|
||||
void serialize(byte_buffer* buffer) override
|
||||
{
|
||||
bdMatchmakingInfo::serialize(buffer);
|
||||
|
||||
buffer->write_int32(this->playlist_number);
|
||||
buffer->write_int32(this->playlist_version);
|
||||
buffer->write_int32(this->netcode_version);
|
||||
buffer->write_int32(this->map_packs);
|
||||
buffer->write_int32(this->slots_needed_on_team);
|
||||
buffer->write_int32(this->skill);
|
||||
buffer->write_uint32(this->country_code);
|
||||
buffer->write_uint32(this->asn);
|
||||
buffer->write_float(this->latitude);
|
||||
buffer->write_float(this->longitude);
|
||||
buffer->write_int32(this->max_reserved_slots);
|
||||
buffer->write_int32(this->used_reserved_slots);
|
||||
buffer->write_blob(this->game_security_key);
|
||||
buffer->write_blob(this->platform_session_id);
|
||||
buffer->write_uint32(this->data_centres);
|
||||
buffer->write_uint32(this->coop_state);
|
||||
}
|
||||
|
||||
void deserialize(byte_buffer* buffer) override
|
||||
{
|
||||
bdMatchmakingInfo::deserialize(buffer);
|
||||
|
||||
buffer->read_int32(&this->playlist_number);
|
||||
buffer->read_int32(&this->playlist_version);
|
||||
buffer->read_int32(&this->netcode_version);
|
||||
buffer->read_int32(&this->map_packs);
|
||||
buffer->read_int32(&this->slots_needed_on_team);
|
||||
buffer->read_int32(&this->skill);
|
||||
buffer->read_uint32(&this->country_code);
|
||||
buffer->read_uint32(&this->asn);
|
||||
buffer->read_float(&this->latitude);
|
||||
buffer->read_float(&this->longitude);
|
||||
buffer->read_int32(&this->max_reserved_slots);
|
||||
buffer->read_int32(&this->used_reserved_slots);
|
||||
buffer->read_blob(&this->game_security_key);
|
||||
buffer->read_blob(&this->platform_session_id);
|
||||
buffer->read_uint32(&this->data_centres);
|
||||
buffer->read_uint32(&this->coop_state);
|
||||
}
|
||||
};
|
||||
|
||||
class bdPerformanceValue final : public i_serializable
|
||||
{
|
||||
public:
|
||||
uint64_t user_id;
|
||||
int64_t performance;
|
||||
|
||||
void serialize(byte_buffer* buffer) override
|
||||
{
|
||||
buffer->write_uint64(this->user_id);
|
||||
buffer->write_int64(this->performance);
|
||||
}
|
||||
|
||||
void deserialize(byte_buffer* buffer) override
|
||||
{
|
||||
buffer->read_uint64(&this->user_id);
|
||||
buffer->read_int64(&this->performance);
|
||||
}
|
||||
};
|
||||
|
||||
struct bdSockAddr final
|
||||
{
|
||||
bdSockAddr() : in_un(), m_family(AF_INET)
|
||||
{
|
||||
}
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
char m_b1;
|
||||
char m_b2;
|
||||
char m_b3;
|
||||
char m_b4;
|
||||
} m_caddr;
|
||||
|
||||
unsigned int m_iaddr;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned __int16 m_w1;
|
||||
unsigned __int16 m_w2;
|
||||
unsigned __int16 m_w3;
|
||||
unsigned __int16 m_w4;
|
||||
unsigned __int16 m_w5;
|
||||
unsigned __int16 m_w6;
|
||||
unsigned __int16 m_w7;
|
||||
unsigned __int16 m_w8;
|
||||
} m_caddr6;
|
||||
|
||||
char m_iaddr6[16];
|
||||
char m_sockaddr_storage[128];
|
||||
} in_un;
|
||||
|
||||
unsigned __int16 m_family;
|
||||
};
|
||||
|
||||
struct bdInetAddr final : i_serializable
|
||||
{
|
||||
bdSockAddr m_addr;
|
||||
|
||||
bool is_valid() const
|
||||
{
|
||||
return (this->m_addr.m_family == AF_INET /*|| this->m_addr.m_family == AF_INET6*/);
|
||||
}
|
||||
|
||||
void serialize(byte_buffer* buffer) override
|
||||
{
|
||||
const auto data_types = buffer->is_using_data_types();
|
||||
buffer->set_use_data_types(false);
|
||||
|
||||
if (this->m_addr.m_family == AF_INET)
|
||||
{
|
||||
buffer->write(4, &this->m_addr.in_un.m_caddr);
|
||||
}
|
||||
|
||||
buffer->set_use_data_types(data_types);
|
||||
}
|
||||
|
||||
void deserialize(byte_buffer* buffer) override
|
||||
{
|
||||
const auto data_types = buffer->is_using_data_types();
|
||||
buffer->set_use_data_types(false);
|
||||
|
||||
if (this->m_addr.m_family == AF_INET)
|
||||
{
|
||||
buffer->read(4, &this->m_addr.in_un.m_caddr);
|
||||
}
|
||||
|
||||
buffer->set_use_data_types(data_types);
|
||||
}
|
||||
};
|
||||
|
||||
struct bdAddr final : i_serializable
|
||||
{
|
||||
bdInetAddr m_address;
|
||||
unsigned __int16 m_port{};
|
||||
|
||||
void serialize(byte_buffer* buffer) override
|
||||
{
|
||||
const bool data_types = buffer->is_using_data_types();
|
||||
buffer->set_use_data_types(false);
|
||||
|
||||
this->m_address.serialize(buffer);
|
||||
buffer->write_uint16(this->m_port);
|
||||
|
||||
buffer->set_use_data_types(data_types);
|
||||
}
|
||||
|
||||
void deserialize(byte_buffer* buffer) override
|
||||
{
|
||||
const auto data_types = buffer->is_using_data_types();
|
||||
buffer->set_use_data_types(false);
|
||||
|
||||
this->m_address.deserialize(buffer);
|
||||
buffer->read_uint16(&this->m_port);
|
||||
|
||||
buffer->set_use_data_types(data_types);
|
||||
}
|
||||
};
|
||||
|
||||
struct bdCommonAddr : i_serializable
|
||||
{
|
||||
bdAddr m_local_addrs[5];
|
||||
bdAddr m_public_addr;
|
||||
game::bdNATType m_nat_type;
|
||||
unsigned int m_hash;
|
||||
bool m_is_loopback;
|
||||
|
||||
void serialize(byte_buffer* buffer) override
|
||||
{
|
||||
const auto data_types = buffer->is_using_data_types();
|
||||
buffer->set_use_data_types(false);
|
||||
|
||||
auto valid = true;
|
||||
for (uint32_t i = 0; i < 5 && i < ARRAYSIZE(this->m_local_addrs) && valid; ++i)
|
||||
{
|
||||
this->m_local_addrs[i].serialize(buffer);
|
||||
valid = this->m_local_addrs[i].m_address.is_valid();
|
||||
}
|
||||
|
||||
if (valid)
|
||||
{
|
||||
this->m_public_addr.serialize(buffer);
|
||||
buffer->write_byte(this->m_nat_type);
|
||||
}
|
||||
|
||||
buffer->set_use_data_types(data_types);
|
||||
}
|
||||
|
||||
void deserialize(byte_buffer* buffer) override
|
||||
{
|
||||
const auto data_types = buffer->is_using_data_types();
|
||||
buffer->set_use_data_types(false);
|
||||
|
||||
auto valid = true;
|
||||
for (uint32_t i = 0; i < ARRAYSIZE(this->m_local_addrs) && valid; ++i)
|
||||
{
|
||||
bdAddr addr;
|
||||
addr.deserialize(buffer);
|
||||
this->m_local_addrs[i] = addr;
|
||||
valid = this->m_local_addrs[i].m_address.is_valid();
|
||||
}
|
||||
|
||||
if (valid)
|
||||
{
|
||||
this->m_public_addr.deserialize(buffer);
|
||||
buffer->read_byte(reinterpret_cast<uint8_t*>(&this->m_nat_type));
|
||||
}
|
||||
|
||||
buffer->set_use_data_types(data_types);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
2
src/client/game/demonware/demonware.cpp
Normal file
2
src/client/game/demonware/demonware.cpp
Normal file
@ -0,0 +1,2 @@
|
||||
#include <std_include.hpp>
|
||||
#include "demonware.hpp"
|
55
src/client/game/demonware/demonware.hpp
Normal file
55
src/client/game/demonware/demonware.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
#include <std_include.hpp>
|
||||
|
||||
#include "bit_buffer.hpp"
|
||||
#include "byte_buffer.hpp"
|
||||
#include "data_types.hpp"
|
||||
#include "reply.hpp"
|
||||
#include "service.hpp"
|
||||
#include "server.hpp"
|
||||
|
||||
//#include "services/bdTeams.hpp" // 3
|
||||
#include "services/bdStats.hpp" // 4
|
||||
//#include "services/bdMessaging.hpp" // 6
|
||||
#include "services/bdProfiles.hpp" // 8
|
||||
#include "services/bdStorage.hpp" // 10
|
||||
#include "services/bdTitleUtilities.hpp" // 12
|
||||
#include "services/bdBandwidthTest.hpp" // 18
|
||||
//#include "services/bdMatchMaking.hpp" // 21
|
||||
#include "services/bdCounters.hpp" // 23
|
||||
#include "services/bdDML.hpp" // 27
|
||||
#include "services/bdGroups.hpp" // 28
|
||||
//#include "services/bdCMail.hpp" // 29
|
||||
#include "services/bdFacebook.hpp" // 36
|
||||
#include "services/bdAnticheat.hpp" // 38
|
||||
#include "services/bdContentStreaming.hpp" // 50
|
||||
//#include "services/bdTags.hpp" // 52
|
||||
#include "services/bdUNK63.hpp" // 63
|
||||
#include "services/bdEventLog.hpp" // 67
|
||||
#include "services/bdRichPresence.hpp" // 68
|
||||
//#include "services/bdTitleUtilities2.hpp" // 72
|
||||
#include "services/bdUNK80.hpp"
|
||||
// AccountLinking // 86
|
||||
#include "services/bdPresence.hpp" //103
|
||||
#include "services/bdUNK104.hpp" //104 Marketing
|
||||
#include "services/bdMatchMaking2.hpp" //138
|
||||
#include "services/bdMarketing.hpp" //139
|
||||
|
||||
// servers
|
||||
#include "servers/server_auth3.hpp"
|
||||
#include "servers/server_lobby.hpp"
|
||||
#include "servers/server_stun.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
// KEYS
|
||||
void derive_keys();
|
||||
void derive_keys_s1();
|
||||
void queue_packet_to_hash(const std::string& packet);
|
||||
void set_session_key(const std::string& key);
|
||||
std::string get_decrypt_key();
|
||||
std::string get_encrypt_key();
|
||||
std::string get_hmac_key();
|
||||
std::string get_response_id();
|
||||
}
|
@ -1,201 +0,0 @@
|
||||
#pragma once
|
||||
#include "bit_buffer.hpp"
|
||||
#include "byte_buffer.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class reply
|
||||
{
|
||||
public:
|
||||
virtual ~reply() = default;
|
||||
virtual std::string get_data() = 0;
|
||||
};
|
||||
|
||||
class raw_reply : public reply
|
||||
{
|
||||
public:
|
||||
raw_reply() = default;
|
||||
|
||||
explicit raw_reply(std::string data) : buffer_(std::move(data))
|
||||
{
|
||||
}
|
||||
|
||||
virtual std::string get_data() override
|
||||
{
|
||||
return this->buffer_;
|
||||
}
|
||||
|
||||
protected:
|
||||
std::string buffer_;
|
||||
};
|
||||
|
||||
class typed_reply : public raw_reply
|
||||
{
|
||||
public:
|
||||
typed_reply(uint8_t _type) : type_(_type)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
uint8_t get_type() const { return this->type_; }
|
||||
|
||||
private:
|
||||
uint8_t type_;
|
||||
};
|
||||
|
||||
class encrypted_reply final : public typed_reply
|
||||
{
|
||||
public:
|
||||
encrypted_reply(const uint8_t type, bit_buffer* bbuffer) : typed_reply(type)
|
||||
{
|
||||
this->buffer_.append(bbuffer->get_buffer());
|
||||
}
|
||||
|
||||
encrypted_reply(const uint8_t type, byte_buffer* bbuffer) : typed_reply(type)
|
||||
{
|
||||
this->buffer_.append(bbuffer->get_buffer());
|
||||
}
|
||||
|
||||
virtual std::string get_data() override;
|
||||
};
|
||||
|
||||
class unencrypted_reply final : public typed_reply
|
||||
{
|
||||
public:
|
||||
unencrypted_reply(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)
|
||||
{
|
||||
this->buffer_.append(bbuffer->get_buffer());
|
||||
}
|
||||
|
||||
virtual std::string get_data() override;
|
||||
};
|
||||
|
||||
class remote_reply;
|
||||
class service_reply;
|
||||
|
||||
class i_server
|
||||
{
|
||||
public:
|
||||
virtual ~i_server() = default;
|
||||
virtual int send(const char* buf, int len) = 0;
|
||||
virtual int recv(char* buf, int len) = 0;
|
||||
|
||||
virtual void send_reply(reply* reply) = 0;
|
||||
|
||||
virtual std::shared_ptr<remote_reply> create_message(uint8_t type)
|
||||
{
|
||||
auto reply = std::make_shared<remote_reply>(this, type);
|
||||
return reply;
|
||||
}
|
||||
|
||||
virtual std::shared_ptr<service_reply> create_reply(uint8_t type,
|
||||
uint32_t error = 0 /*Game::bdLobbyErrorCode::BD_NO_ERROR*/)
|
||||
{
|
||||
auto reply = std::make_shared<service_reply>(this, type, error);
|
||||
return reply;
|
||||
}
|
||||
};
|
||||
|
||||
class remote_reply final
|
||||
{
|
||||
public:
|
||||
remote_reply(i_server* server, uint8_t _type) : type_(_type), server_(server)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename BufferType>
|
||||
void send(BufferType* buffer, const bool encrypted)
|
||||
{
|
||||
std::unique_ptr<typed_reply> reply;
|
||||
|
||||
if (encrypted) reply = std::make_unique<encrypted_reply>(this->type_, buffer);
|
||||
else reply = std::make_unique<unencrypted_reply>(this->type_, buffer);
|
||||
this->server_->send_reply(reply.get());
|
||||
}
|
||||
|
||||
uint8_t get_type() const { return this->type_; }
|
||||
|
||||
private:
|
||||
uint8_t type_;
|
||||
i_server* server_;
|
||||
};
|
||||
|
||||
class i_serializable
|
||||
{
|
||||
public:
|
||||
virtual ~i_serializable() = default;
|
||||
|
||||
virtual void serialize(byte_buffer* /*buffer*/)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void deserialize(byte_buffer* /*buffer*/)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class service_reply final
|
||||
{
|
||||
public:
|
||||
service_reply(i_server* _server, uint8_t _type, uint32_t _error) : type_(_type), error_(_error),
|
||||
reply_(_server, 1)
|
||||
{
|
||||
}
|
||||
|
||||
uint64_t send()
|
||||
{
|
||||
static uint64_t id = 0x8000000000000001;
|
||||
const auto transaction_id = ++id;
|
||||
|
||||
byte_buffer buffer;
|
||||
buffer.write_uint64(transaction_id);
|
||||
buffer.write_uint32(this->error_);
|
||||
buffer.write_byte(this->type_);
|
||||
|
||||
if (!this->error_)
|
||||
{
|
||||
buffer.write_uint32(uint32_t(this->objects_.size()));
|
||||
if (!this->objects_.empty())
|
||||
{
|
||||
buffer.write_uint32(uint32_t(this->objects_.size()));
|
||||
|
||||
for (auto& object : this->objects_)
|
||||
{
|
||||
object->serialize(&buffer);
|
||||
}
|
||||
|
||||
this->objects_.clear();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer.write_uint64(transaction_id);
|
||||
}
|
||||
|
||||
this->reply_.send(&buffer, true);
|
||||
return transaction_id;
|
||||
}
|
||||
|
||||
void add(const std::shared_ptr<i_serializable>& object)
|
||||
{
|
||||
this->objects_.push_back(object);
|
||||
}
|
||||
|
||||
void add(i_serializable* object)
|
||||
{
|
||||
this->add(std::shared_ptr<i_serializable>(object));
|
||||
}
|
||||
|
||||
private:
|
||||
uint8_t type_;
|
||||
uint32_t error_;
|
||||
remote_reply reply_;
|
||||
|
||||
std::vector<std::shared_ptr<i_serializable>> objects_;
|
||||
};
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
#pragma once
|
||||
#include "i_server.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class i_service
|
||||
{
|
||||
public:
|
||||
virtual ~i_service() = default;
|
||||
i_service() = default;
|
||||
|
||||
// Copying or moving a service object won't work
|
||||
// as the callbacks are bound to the initial object pointer
|
||||
// Therefore, you should never declare copy/move
|
||||
// constructors when inheriting from IService!
|
||||
i_service(i_service&&) = delete;
|
||||
i_service(const i_service&) = delete;
|
||||
i_service& operator=(const i_service&) = delete;
|
||||
|
||||
typedef std::function<void(i_server*, byte_buffer*)> callback;
|
||||
|
||||
virtual uint16_t getType() = 0;
|
||||
|
||||
virtual void call_service(i_server* server, const std::string& data)
|
||||
{
|
||||
std::lock_guard _(this->mutex_);
|
||||
|
||||
byte_buffer buffer(data);
|
||||
buffer.read_byte(&this->sub_type_);
|
||||
|
||||
printf("DW: Handling subservice of type %d\n", this->sub_type_);
|
||||
|
||||
const auto callback = this->callbacks_.find(this->sub_type_);
|
||||
if (callback != this->callbacks_.end())
|
||||
{
|
||||
callback->second(server, &buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("DW: Missing subservice %d for type %d\n", this->sub_type_, this->getType());
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
std::map<uint8_t, callback> callbacks_{};
|
||||
|
||||
template <typename Class, typename T, typename... Args>
|
||||
void register_service(const uint8_t type, T (Class::*callback)(Args ...) const)
|
||||
{
|
||||
this->callbacks_[type] = [this, callback](Args ... args) -> T
|
||||
{
|
||||
return (reinterpret_cast<Class*>(this)->*callback)(args...);
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Class, typename T, typename... Args>
|
||||
void register_service(const uint8_t type, T (Class::*callback)(Args ...))
|
||||
{
|
||||
this->callbacks_[type] = [this, callback](Args ... args) -> T
|
||||
{
|
||||
return (reinterpret_cast<Class*>(this)->*callback)(args...);
|
||||
};
|
||||
}
|
||||
|
||||
uint8_t get_sub_type() const { return this->sub_type_; }
|
||||
|
||||
private:
|
||||
std::mutex mutex_;
|
||||
|
||||
uint8_t sub_type_{};
|
||||
};
|
||||
|
||||
template <uint16_t Type>
|
||||
class i_generic_service : public i_service
|
||||
{
|
||||
public:
|
||||
uint16_t getType() override { return Type; }
|
||||
};
|
||||
}
|
226
src/client/game/demonware/keys.cpp
Normal file
226
src/client/game/demonware/keys.cpp
Normal file
@ -0,0 +1,226 @@
|
||||
#include <std_include.hpp>
|
||||
#include "demonware.hpp"
|
||||
#include <utils/cryptography.hpp>
|
||||
#include <utils/string.hpp>
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
// SHA256 auth signature, Hmacs ...
|
||||
char dw_key[296] = "\x30\x82\x01\x22\x30\x0D\x06\x09\x2A\x86\x48\x86\xF7\x0D\x01\x01"
|
||||
"\x01\x05\x00\x03\x82\x01\x0F\x00\x30\x82\x01\x0A\x02\x82\x01\x01"
|
||||
"\x00\xC0\xA2\x0B\x1F\x6C\xB8\x1B\x12\x70\xED\x1A\xEF\x30\x6C\x75"
|
||||
"\x9D\xC1\x08\x89\x99\xF0\x2A\xC8\xAC\x2F\xC7\xD5\xD0\x3B\x61\x29"
|
||||
"\x39\xF3\x8F\x62\x39\xDA\xF1\x20\x11\xE7\x92\xE9\x16\x24\x22\x96"
|
||||
"\x09\x9E\xAC\x19\xCD\x24\x3E\x58\xC6\x40\x86\x78\xD7\xDF\x70\x77"
|
||||
"\xCB\xDE\x80\x42\xB1\x38\xF3\x1D\x6A\x3C\x98\xE4\x85\xDB\xFB\x53"
|
||||
"\x3A\x86\x47\xCE\x58\xB1\xD3\xD7\x0B\x83\x3D\x14\x6B\xDA\x40\x24"
|
||||
"\x1F\x16\x2B\x0E\x49\x22\xE4\xB7\x63\xFF\xAA\x40\xC2\x44\xDF\xDC"
|
||||
"\x3F\x8C\x1E\x60\xB4\x6F\x3E\xDA\xB2\x4E\x50\xCA\xFC\x62\x4B\x62"
|
||||
"\xC7\xE1\x77\x5E\x83\xCD\xE0\xB5\xFC\xC6\xAA\xA0\xC2\x6B\x28\xCC"
|
||||
"\x8A\xA7\x95\x7B\x1E\x67\xE0\x5B\xAF\xC6\x54\x49\xE6\xAC\x7A\x8D"
|
||||
"\x1D\xE6\x7D\x12\x04\x94\xC3\x23\x4A\x00\x60\x58\x33\x6F\xE7\x94"
|
||||
"\x19\xFF\xF6\xE0\xC6\x40\x50\xB7\x9D\x0E\xCD\xDF\xE7\x92\x5D\x84"
|
||||
"\x94\x13\x06\x61\xBC\x44\x75\x54\x70\x54\x77\x4C\xC0\x28\x7D\xFC"
|
||||
"\xC9\x9A\x92\x38\xD4\xD5\xEE\xF3\x27\x44\x66\x13\x2C\x06\xF0\x64"
|
||||
"\xE7\xEC\xF8\x75\xFD\x15\xD4\x1B\x91\x45\x9D\x4A\x3F\x40\xE9\x35"
|
||||
"\x53\x7F\xFC\x96\x61\xE1\x48\x74\x21\xF0\x04\x20\x41\x30\x02\xD2"
|
||||
"\xF9\x02\x03\x01\x00\x01\x00";
|
||||
|
||||
struct data_t
|
||||
{
|
||||
char m_session_key[24];
|
||||
char m_response[8];
|
||||
char m_hmac_key[20];
|
||||
char m_enc_key[16];
|
||||
char m_dec_key[16];
|
||||
}data{};
|
||||
|
||||
std::string packet_buffer;
|
||||
|
||||
bool calculate_hmacs(const char* input, unsigned int inputSize, const char* key, unsigned int keySize, void* dst, unsigned int dstSize)
|
||||
{
|
||||
char buffer[400];
|
||||
unsigned int pos = 0;
|
||||
unsigned int out_offset = 0;
|
||||
char count = 1;
|
||||
char result[20];
|
||||
|
||||
std::memcpy(&buffer[pos], key, keySize);
|
||||
pos += keySize;
|
||||
|
||||
buffer[pos] = count;
|
||||
pos++;
|
||||
|
||||
unsigned int outlen = 20;
|
||||
std::string output = utils::cryptography::hmac_sha1::process(std::string(buffer, pos), std::string(input, inputSize), &outlen);
|
||||
|
||||
std::memcpy(result, output.data(), 20);
|
||||
std::memcpy(dst, result, 20);
|
||||
out_offset = 20;
|
||||
// second loop
|
||||
while (1)
|
||||
{
|
||||
if (out_offset >= dstSize)
|
||||
return true;
|
||||
|
||||
pos = 0;
|
||||
std::memcpy(&buffer[pos], result, 20);
|
||||
pos += 20;
|
||||
|
||||
std::memcpy(&buffer[pos], key, keySize);
|
||||
pos += keySize;
|
||||
|
||||
count++;
|
||||
buffer[pos] = count;
|
||||
pos++;
|
||||
|
||||
unsigned int outlen2 = 20;
|
||||
std::string output2 = utils::cryptography::hmac_sha1::process(std::string(buffer, pos), std::string(input, inputSize), &outlen2);
|
||||
std::memcpy(result, output2.data(), 20);
|
||||
std::memcpy(&((char*)dst)[out_offset], result, std::min(20u, (dstSize - out_offset)));
|
||||
out_offset += 20;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void derive_keys()
|
||||
{
|
||||
std::string key_1 = utils::cryptography::sha1::compute(packet_buffer);
|
||||
|
||||
char out_1[24];
|
||||
calculate_hmacs(data.m_session_key, 24, dw_key, 294, out_1, 24);
|
||||
|
||||
unsigned int len = 20;
|
||||
std::string data_2(out_1, 24);
|
||||
std::string data_3 = utils::cryptography::hmac_sha1::process(data_2, key_1, &len);
|
||||
|
||||
char out_2[16];
|
||||
calculate_hmacs(data_3.data(), 20, "CLIENTCHAL", 10, out_2, 16);
|
||||
|
||||
char out_3[72];
|
||||
calculate_hmacs(data_3.data(), 20, "BDDATA", 6, out_3, 72);
|
||||
|
||||
std::memcpy(data.m_response, &out_2[8], 8);
|
||||
std::memcpy(data.m_dec_key, &out_3[40], 16);
|
||||
std::memcpy(data.m_enc_key, &out_3[56], 16);
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("[demonware] HmacSHA1 id: %s\n", utils::string::dump_hex(std::string(&out_2[8], 8)).data());
|
||||
printf("[demonware] AES enc key: %s\n", utils::string::dump_hex(std::string(&out_3[40], 16)).data());
|
||||
printf("[demonware] AES dec key: %s\n", utils::string::dump_hex(std::string(&out_3[56], 16)).data());
|
||||
printf("[demonware] Bravo 6, going dark.\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
void calculate_hmacs_s1(const char* data_, unsigned int data_size, const char* key, unsigned int key_size, char* dst, unsigned int dst_size)
|
||||
{
|
||||
char buffer[64];
|
||||
unsigned int pos = 0;
|
||||
unsigned int out_offset = 0;
|
||||
char count = 1;
|
||||
std::string result;
|
||||
|
||||
// buffer add key
|
||||
std::memcpy(&buffer[pos], key, key_size);
|
||||
pos += key_size;
|
||||
|
||||
// buffer add count
|
||||
buffer[pos] = count;
|
||||
pos++;
|
||||
|
||||
// calculate hmac
|
||||
unsigned int outlen = 20;
|
||||
result = utils::cryptography::hmac_sha1::process(std::string(buffer, pos), std::string(data_, data_size), &outlen);
|
||||
|
||||
// save output
|
||||
std::memcpy(dst, result.data(), std::min(20u, (dst_size - out_offset)));
|
||||
out_offset = 20;
|
||||
|
||||
// second loop
|
||||
while (1)
|
||||
{
|
||||
// if we filled the output buffer, exit
|
||||
if (out_offset >= dst_size)
|
||||
break;
|
||||
|
||||
// buffer add last result
|
||||
pos = 0;
|
||||
std::memcpy(&buffer[pos], result.data(), 20);
|
||||
pos += 20;
|
||||
|
||||
// buffer add key
|
||||
std::memcpy(&buffer[pos], key, key_size);
|
||||
pos += key_size;
|
||||
|
||||
// buffer add count
|
||||
count++;
|
||||
buffer[pos] = count;
|
||||
pos++;
|
||||
|
||||
// calculate hmac
|
||||
unsigned int outlen_ = 20;
|
||||
result = utils::cryptography::hmac_sha1::process(std::string(buffer, pos), std::string(data_, data_size), &outlen_);
|
||||
|
||||
// save output
|
||||
std::memcpy(&((char*)dst)[out_offset], result.data(), std::min(20u, (dst_size - out_offset)));
|
||||
out_offset += 20;
|
||||
}
|
||||
}
|
||||
|
||||
void derive_keys_s1()
|
||||
{
|
||||
std::string out_1 = utils::cryptography::sha1::compute(packet_buffer); // out_1 size 20
|
||||
|
||||
unsigned int len = 20;
|
||||
std::string data_3 = utils::cryptography::hmac_sha1::process(data.m_session_key, out_1, &len);
|
||||
|
||||
char out_2[16];
|
||||
calculate_hmacs_s1(data_3.data(), 20, "CLIENTCHAL", 10, out_2, 16);
|
||||
|
||||
char out_3[72];
|
||||
calculate_hmacs_s1(data_3.data(), 20, "BDDATA", 6, out_3, 72);
|
||||
|
||||
std::memcpy(data.m_response, &out_2[8], 8);
|
||||
std::memcpy(data.m_hmac_key, &out_3[20], 20);
|
||||
std::memcpy(data.m_dec_key, &out_3[40], 16);
|
||||
std::memcpy(data.m_enc_key, &out_3[56], 16);
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("[demonware] Response id: %s\n", utils::string::dump_hex(std::string(&out_2[8], 8)).data());
|
||||
printf("[demonware] Hash verify: %s\n", utils::string::dump_hex(std::string(&out_3[20], 20)).data());
|
||||
printf("[demonware] AES dec key: %s\n", utils::string::dump_hex(std::string(&out_3[40], 16)).data());
|
||||
printf("[demonware] AES enc key: %s\n", utils::string::dump_hex(std::string(&out_3[56], 16)).data());
|
||||
printf("[demonware] Bravo 6, going dark.\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
void queue_packet_to_hash(const std::string& packet)
|
||||
{
|
||||
packet_buffer.append(packet);
|
||||
}
|
||||
|
||||
void set_session_key(const std::string& key)
|
||||
{
|
||||
std::memcpy(data.m_session_key, key.data(), 24);
|
||||
}
|
||||
|
||||
std::string get_decrypt_key()
|
||||
{
|
||||
return std::string(data.m_dec_key, 16);
|
||||
}
|
||||
|
||||
std::string get_encrypt_key()
|
||||
{
|
||||
return std::string(data.m_enc_key, 16);
|
||||
}
|
||||
|
||||
std::string get_hmac_key()
|
||||
{
|
||||
return std::string(data.m_hmac_key, 20);
|
||||
}
|
||||
|
||||
std::string get_response_id()
|
||||
{
|
||||
return std::string(data.m_response, 8);
|
||||
}
|
||||
}
|
87
src/client/game/demonware/reply.cpp
Normal file
87
src/client/game/demonware/reply.cpp
Normal file
@ -0,0 +1,87 @@
|
||||
#include <std_include.hpp>
|
||||
#include "demonware.hpp"
|
||||
#include <utils/cryptography.hpp>
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
std::string unencrypted_reply::data()
|
||||
{
|
||||
byte_buffer result;
|
||||
result.set_use_data_types(false);
|
||||
|
||||
result.write_int32(static_cast<int>(this->buffer_.size()) + 2);
|
||||
result.write_bool(false);
|
||||
result.write_byte(this->type());
|
||||
result.write(this->buffer_);
|
||||
|
||||
return result.get_buffer();
|
||||
}
|
||||
|
||||
std::string encrypted_reply::data()
|
||||
{
|
||||
byte_buffer result;
|
||||
result.set_use_data_types(false);
|
||||
|
||||
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
|
||||
|
||||
auto aligned_data = enc_buffer.get_buffer();
|
||||
auto size = aligned_data.size();
|
||||
size = ~15 & (size + 15); // 16 byte align
|
||||
aligned_data.resize(size);
|
||||
|
||||
// seed
|
||||
std::string seed("\x5E\xED\x5E\xED\x5E\xED\x5E\xED\x5E\xED\x5E\xED\x5E\xED\x5E\xED", 16);
|
||||
|
||||
// encrypt
|
||||
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;
|
||||
msg_count++;
|
||||
|
||||
byte_buffer response;
|
||||
response.set_use_data_types(false);
|
||||
|
||||
response.write_int32(30 + static_cast<int>(enc_data.size()));
|
||||
response.write_byte(static_cast<char>(0xAB));
|
||||
response.write_byte(static_cast<char>(0x85));
|
||||
response.write_int32(msg_count);
|
||||
response.write(16, seed.data());
|
||||
response.write(enc_data);
|
||||
|
||||
// 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);
|
||||
hash_data.resize(8);
|
||||
response.write(8, hash_data.data());
|
||||
|
||||
return response.get_buffer();
|
||||
}
|
||||
|
||||
void remote_reply::send(bit_buffer* buffer, const bool encrypted)
|
||||
{
|
||||
std::unique_ptr<typed_reply> reply;
|
||||
|
||||
if (encrypted) reply = std::make_unique<encrypted_reply>(this->type_, buffer);
|
||||
else reply = std::make_unique<unencrypted_reply>(this->type_, buffer);
|
||||
|
||||
this->server_->send_reply(reply.get());
|
||||
}
|
||||
|
||||
void remote_reply::send(byte_buffer* buffer, const bool encrypted)
|
||||
{
|
||||
std::unique_ptr<typed_reply> reply;
|
||||
|
||||
if (encrypted) reply = std::make_unique<encrypted_reply>(this->type_, buffer);
|
||||
else reply = std::make_unique<unencrypted_reply>(this->type_, buffer);
|
||||
|
||||
this->server_->send_reply(reply.get());
|
||||
}
|
||||
|
||||
}
|
155
src/client/game/demonware/reply.hpp
Normal file
155
src/client/game/demonware/reply.hpp
Normal file
@ -0,0 +1,155 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class reply
|
||||
{
|
||||
public:
|
||||
virtual ~reply() = default;
|
||||
virtual std::string data() = 0;
|
||||
};
|
||||
|
||||
class raw_reply : public reply
|
||||
{
|
||||
protected:
|
||||
std::string buffer_;
|
||||
|
||||
public:
|
||||
raw_reply() = default;
|
||||
|
||||
explicit raw_reply(std::string data) : buffer_(std::move(data))
|
||||
{
|
||||
}
|
||||
|
||||
virtual std::string data() override
|
||||
{
|
||||
return this->buffer_;
|
||||
}
|
||||
};
|
||||
|
||||
class typed_reply : public raw_reply
|
||||
{
|
||||
private:
|
||||
uint8_t type_;
|
||||
|
||||
protected:
|
||||
uint8_t type() const { return this->type_; }
|
||||
|
||||
public:
|
||||
typed_reply(uint8_t _type) : type_(_type)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class encrypted_reply final : public typed_reply
|
||||
{
|
||||
public:
|
||||
encrypted_reply(const uint8_t type, bit_buffer* bbuffer) : typed_reply(type)
|
||||
{
|
||||
this->buffer_.append(bbuffer->get_buffer());
|
||||
}
|
||||
|
||||
encrypted_reply(const uint8_t type, byte_buffer* bbuffer) : typed_reply(type)
|
||||
{
|
||||
this->buffer_.append(bbuffer->get_buffer());
|
||||
}
|
||||
|
||||
virtual std::string data() override;
|
||||
};
|
||||
|
||||
class unencrypted_reply final : public typed_reply
|
||||
{
|
||||
public:
|
||||
unencrypted_reply(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)
|
||||
{
|
||||
this->buffer_.append(bbuffer->get_buffer());
|
||||
}
|
||||
|
||||
virtual std::string data() override;
|
||||
};
|
||||
|
||||
class service_server;
|
||||
|
||||
class remote_reply final
|
||||
{
|
||||
private:
|
||||
uint8_t type_;
|
||||
service_server* server_;
|
||||
|
||||
public:
|
||||
remote_reply(service_server* server, uint8_t _type) : type_(_type), server_(server)
|
||||
{
|
||||
}
|
||||
|
||||
void send(bit_buffer* buffer, const bool encrypted);
|
||||
void send(byte_buffer* buffer, const bool encrypted);
|
||||
|
||||
uint8_t type() const { return this->type_; }
|
||||
};
|
||||
|
||||
class service_reply final
|
||||
{
|
||||
private:
|
||||
uint8_t type_;
|
||||
uint32_t error_;
|
||||
remote_reply reply_;
|
||||
std::vector<std::shared_ptr<bdTaskResult>> objects_;
|
||||
|
||||
public:
|
||||
service_reply(service_server* _server, uint8_t _type, uint32_t _error)
|
||||
: type_(_type), error_(_error), reply_(_server, 1)
|
||||
{
|
||||
}
|
||||
|
||||
uint64_t send()
|
||||
{
|
||||
static uint64_t id = 0x0000000000000000;
|
||||
const auto transaction_id = ++id;
|
||||
|
||||
byte_buffer buffer;
|
||||
buffer.write_uint64(transaction_id);
|
||||
buffer.write_uint32(this->error_);
|
||||
buffer.write_byte(this->type_);
|
||||
|
||||
if (!this->error_)
|
||||
{
|
||||
buffer.write_uint32(uint32_t(this->objects_.size()));
|
||||
if (!this->objects_.empty())
|
||||
{
|
||||
buffer.write_uint32(uint32_t(this->objects_.size()));
|
||||
|
||||
for (auto& object : this->objects_)
|
||||
{
|
||||
object->serialize(&buffer);
|
||||
}
|
||||
|
||||
this->objects_.clear();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer.write_uint64(transaction_id);
|
||||
}
|
||||
|
||||
this->reply_.send(&buffer, true);
|
||||
return transaction_id;
|
||||
}
|
||||
|
||||
void add(const std::shared_ptr<bdTaskResult>& object)
|
||||
{
|
||||
this->objects_.push_back(object);
|
||||
}
|
||||
|
||||
void add(bdTaskResult* object)
|
||||
{
|
||||
this->add(std::shared_ptr<bdTaskResult>(object));
|
||||
}
|
||||
};
|
||||
|
||||
}
|
18
src/client/game/demonware/server.hpp
Normal file
18
src/client/game/demonware/server.hpp
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class service_server
|
||||
{
|
||||
public:
|
||||
virtual std::shared_ptr<service_reply> create_reply(uint8_t type, uint32_t error = 0)
|
||||
{
|
||||
auto reply = std::make_shared<service_reply>(this, type, error);
|
||||
return reply;
|
||||
}
|
||||
|
||||
virtual void send_reply(reply* data) = 0;
|
||||
};
|
||||
|
||||
} // namespace demonware
|
181
src/client/game/demonware/servers/server_auth3.cpp
Normal file
181
src/client/game/demonware/servers/server_auth3.cpp
Normal file
@ -0,0 +1,181 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
#include <utils/json.hpp>
|
||||
using json = nlohmann::json;
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
int server_auth3::recv(const char* buf, const int len)
|
||||
{
|
||||
if (len <= 0) return -1;
|
||||
std::lock_guard<std::recursive_mutex> _(this->mutex_);
|
||||
this->incoming_queue_.push(std::string(buf, len));
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
int server_auth3::send(char* buf, int len)
|
||||
{
|
||||
if (len > 0 && !this->outgoing_queue_.empty())
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(this->mutex_);
|
||||
|
||||
len = std::min(len, static_cast<int>(this->outgoing_queue_.size()));
|
||||
for (auto i = 0; i < len; ++i)
|
||||
{
|
||||
buf[i] = this->outgoing_queue_.front();
|
||||
this->outgoing_queue_.pop();
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
void server_auth3::send_reply(reply* data)
|
||||
{
|
||||
if (!data) return;
|
||||
|
||||
std::lock_guard _(this->mutex_);
|
||||
|
||||
//this->reply_sent_ = true;
|
||||
const auto buffer = data->data();
|
||||
for (auto& byte : buffer)
|
||||
{
|
||||
this->outgoing_queue_.push(byte);
|
||||
}
|
||||
}
|
||||
|
||||
void server_auth3::frame()
|
||||
{
|
||||
if (!this->incoming_queue_.empty())
|
||||
{
|
||||
std::lock_guard _(this->mutex_);
|
||||
const auto packet = this->incoming_queue_.front();
|
||||
this->incoming_queue_.pop();
|
||||
|
||||
this->dispatch(packet);
|
||||
}
|
||||
}
|
||||
|
||||
bool server_auth3::pending_data()
|
||||
{
|
||||
std::lock_guard _(this->mutex_);
|
||||
return !this->outgoing_queue_.empty();
|
||||
}
|
||||
|
||||
void server_auth3::dispatch(const std::string& packet)
|
||||
{
|
||||
if (packet.starts_with("POST /auth/")) // user request auth
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("[demonware]: [auth]: user requested authentication.\n");
|
||||
#endif
|
||||
|
||||
//std::string result = "HTTP/1.1 100 Continue\r\n\r\n";
|
||||
//raw_reply reply(result);
|
||||
//this->send_reply(&reply);
|
||||
return;
|
||||
}
|
||||
else // user send data
|
||||
{
|
||||
unsigned int title_id = 0;
|
||||
unsigned int iv_seed = 0;
|
||||
std::string identity = "";
|
||||
std::string token = "";
|
||||
|
||||
json j = json::parse(packet);
|
||||
|
||||
if (j.contains("title_id") && j["title_id"].is_string())
|
||||
title_id = std::stoul(j["title_id"].get<std::string>());
|
||||
|
||||
if (j.contains("iv_seed") && j["iv_seed"].is_string())
|
||||
iv_seed = std::stoul(j["iv_seed"].get<std::string>());
|
||||
|
||||
if (j.contains("extra_data") && j["extra_data"].is_string())
|
||||
{
|
||||
json extra_data = json::parse(j["extra_data"].get<std::string>());
|
||||
|
||||
if (extra_data.contains("token") && extra_data["token"].is_string())
|
||||
{
|
||||
std::string token_b64 = extra_data["token"].get<std::string>();
|
||||
token = utils::cryptography::base64::decode(token_b64);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("[demonware]: [auth]: authenticating user %s\n", std::string(&token.data()[64]).data());
|
||||
#endif
|
||||
|
||||
std::string auth_key(reinterpret_cast<char*>(&token.data()[32]), 24);
|
||||
std::string session_key("\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37\x13\x37", 24);
|
||||
|
||||
// client_ticket
|
||||
auth_ticket_t ticket{};
|
||||
std::memset(&ticket, 0x0, sizeof ticket);
|
||||
ticket.m_magicNumber = 0x0EFBDADDE;
|
||||
ticket.m_type = 0;
|
||||
ticket.m_titleID = title_id;
|
||||
ticket.m_timeIssued = static_cast<uint32_t>(time(nullptr));
|
||||
ticket.m_timeExpires = ticket.m_timeIssued + 30000;
|
||||
ticket.m_licenseID = 0;
|
||||
ticket.m_userID = reinterpret_cast<uint64_t>(&token.data()[56]);
|
||||
strncpy_s(ticket.m_username, sizeof(ticket.m_username), reinterpret_cast<char*>(&token.data()[64]), 64);
|
||||
std::memcpy(ticket.m_sessionKey, session_key.data(), 24);
|
||||
|
||||
const auto iv = utils::cryptography::tiger::compute(std::string(reinterpret_cast<char*>(&iv_seed), 4));
|
||||
std::string ticket_enc = utils::cryptography::des3::encrypt(
|
||||
std::string(reinterpret_cast<char*>(&ticket), sizeof(ticket)), iv, auth_key);
|
||||
std::string ticket_b64 = utils::cryptography::base64::encode((const unsigned char*)ticket_enc.c_str(), 128);
|
||||
|
||||
// server_ticket
|
||||
uint8_t auth_data[128];
|
||||
std::memset(&auth_data, 0, sizeof auth_data);
|
||||
std::memcpy(auth_data, session_key.data(), 24);
|
||||
std::string auth_data_b64 = utils::cryptography::base64::encode(auth_data, 128);
|
||||
|
||||
demonware::set_session_key(session_key);
|
||||
|
||||
// header time
|
||||
char date[64];
|
||||
time_t now = time(0);
|
||||
tm gmtm;
|
||||
gmtime_s(&gmtm, &now);
|
||||
strftime(date, 64, "%a, %d %b %G %T", &gmtm);
|
||||
|
||||
// json content
|
||||
std::string content;
|
||||
content.append("{\"auth_task\": \"29\",");
|
||||
content.append("\"code\": \"700\",");
|
||||
content.append(utils::string::va("\"iv_seed\": \"%u\",", iv_seed));
|
||||
content.append(utils::string::va("\"client_ticket\": \"%s\",", ticket_b64.c_str()));
|
||||
content.append(utils::string::va("\"server_ticket\": \"%s\",", auth_data_b64.c_str()));
|
||||
content.append("\"client_id\": \"\",");
|
||||
content.append("\"account_type\": \"steam\",");
|
||||
content.append("\"crossplay_enabled\": false,");
|
||||
content.append("\"loginqueue_eanbled\": false,");
|
||||
content.append("\"lsg_endpoint\": null,");
|
||||
content.append("}");
|
||||
|
||||
//std::string signature = utils::sha256::compute(content, false);
|
||||
|
||||
// http stuff
|
||||
std::string result;
|
||||
result.append("HTTP/1.1 200 OK\r\n");
|
||||
result.append("Server: TornadoServer/4.5.3\r\n");
|
||||
result.append("Content-Type: application/json\r\n");
|
||||
result.append(utils::string::va("Date: %s GMT\r\n", date));
|
||||
//result.append(utils::va("X-Signature: %s\r\n", signature.data()));
|
||||
result.append(utils::string::va("Content-Length: %d\r\n\r\n", content.size()));
|
||||
result.append(content);
|
||||
printf("%s\n", result.data());
|
||||
raw_reply reply(result);
|
||||
this->send_reply(&reply);
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("[demonware]: [auth]: user successfully authenticated.\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
82
src/client/game/demonware/servers/server_auth3.hpp
Normal file
82
src/client/game/demonware/servers/server_auth3.hpp
Normal file
@ -0,0 +1,82 @@
|
||||
#pragma once
|
||||
#include <utils/cryptography.hpp>
|
||||
|
||||
class server_base
|
||||
{
|
||||
std::string name_;
|
||||
std::uint32_t address_ = 0;
|
||||
|
||||
public:
|
||||
server_base(std::string name) : name_(std::move(name))
|
||||
{
|
||||
this->address_ = utils::cryptography::jenkins_one_at_a_time::compute(this->name_);
|
||||
}
|
||||
|
||||
std::uint32_t address()
|
||||
{
|
||||
return this->address_;
|
||||
}
|
||||
|
||||
virtual void frame()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
virtual int recv(const char* buf, int size)
|
||||
{
|
||||
printf("PACKET\n%s\n", std::string(buf, size).data());
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int send(char* buf, int size)
|
||||
{
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
virtual bool pending_data()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
using server_ptr = std::shared_ptr<server_base>;
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
#pragma pack(push, 1)
|
||||
struct auth_ticket_t
|
||||
{
|
||||
unsigned int m_magicNumber;
|
||||
char m_type;
|
||||
unsigned int m_titleID;
|
||||
unsigned int m_timeIssued;
|
||||
unsigned int m_timeExpires;
|
||||
unsigned __int64 m_licenseID;
|
||||
unsigned __int64 m_userID;
|
||||
char m_username[64];
|
||||
char m_sessionKey[24];
|
||||
char m_usingHashMagicNumber[3];
|
||||
char m_hash[4];
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
class server_auth3 : public server_base
|
||||
{
|
||||
public:
|
||||
explicit server_auth3(std::string name) : server_base(name) {};
|
||||
|
||||
void frame() override;
|
||||
int recv(const char* buf, int len) override;
|
||||
int send(char* buf, int len) override;
|
||||
bool pending_data()override;
|
||||
|
||||
private:
|
||||
std::recursive_mutex mutex_;
|
||||
std::queue<char> outgoing_queue_;
|
||||
std::queue<std::string> incoming_queue_;
|
||||
|
||||
void send_reply(reply* data);
|
||||
void dispatch(const std::string& packet);
|
||||
};
|
||||
|
||||
}
|
223
src/client/game/demonware/servers/server_lobby.cpp
Normal file
223
src/client/game/demonware/servers/server_lobby.cpp
Normal file
@ -0,0 +1,223 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
server_lobby::server_lobby(std::string name) : server_base(std::move(name))
|
||||
{
|
||||
this->register_service<bdAnticheat>();
|
||||
this->register_service<bdBandwidthTest>();
|
||||
this->register_service<bdContentStreaming>();
|
||||
this->register_service<bdDML>();
|
||||
this->register_service<bdEventLog>();
|
||||
this->register_service<bdGroups>();
|
||||
this->register_service<bdStats>();
|
||||
this->register_service<bdStorage>();
|
||||
this->register_service<bdTitleUtilities>();
|
||||
this->register_service<bdProfiles>();
|
||||
this->register_service<bdRichPresence>();
|
||||
this->register_service<bdFacebook>();
|
||||
this->register_service<bdUNK63>();
|
||||
this->register_service<bdUNK80>();
|
||||
this->register_service<bdPresence>();
|
||||
this->register_service<bdUNK104>();
|
||||
this->register_service<bdMatchMaking2>();
|
||||
this->register_service<bdMarketing>();
|
||||
};
|
||||
|
||||
void server_lobby::frame()
|
||||
{
|
||||
if (!this->incoming_queue_.empty())
|
||||
{
|
||||
std::lock_guard _(this->mutex_);
|
||||
const auto packet = this->incoming_queue_.front();
|
||||
this->incoming_queue_.pop();
|
||||
|
||||
this->dispatch(packet);
|
||||
}
|
||||
}
|
||||
|
||||
int server_lobby::recv(const char* buf, int len)
|
||||
{
|
||||
if (len <= 3) return -1;
|
||||
std::lock_guard<std::recursive_mutex> _(this->mutex_);
|
||||
|
||||
this->incoming_queue_.push(std::string(buf, len));
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
int server_lobby::send(char* buf, int len)
|
||||
{
|
||||
if (len > 0 && !this->outgoing_queue_.empty())
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(this->mutex_);
|
||||
|
||||
len = std::min(len, static_cast<int>(this->outgoing_queue_.size()));
|
||||
for (auto i = 0; i < len; ++i)
|
||||
{
|
||||
buf[i] = this->outgoing_queue_.front();
|
||||
this->outgoing_queue_.pop();
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
bool server_lobby::pending_data()
|
||||
{
|
||||
std::lock_guard _(this->mutex_);
|
||||
return !this->outgoing_queue_.empty();
|
||||
}
|
||||
|
||||
void server_lobby::send_reply(reply* data)
|
||||
{
|
||||
if (!data) return;
|
||||
|
||||
std::lock_guard _(this->mutex_);
|
||||
|
||||
const auto buffer = data->data();
|
||||
for (auto& byte : buffer)
|
||||
{
|
||||
this->outgoing_queue_.push(byte);
|
||||
}
|
||||
}
|
||||
|
||||
void server_lobby::dispatch(const std::string& packet)
|
||||
{
|
||||
byte_buffer buffer(packet);
|
||||
buffer.set_use_data_types(false);
|
||||
|
||||
try
|
||||
{
|
||||
while (buffer.has_more_data())
|
||||
{
|
||||
int size;
|
||||
buffer.read_int32(&size);
|
||||
|
||||
if (size <= 0)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("[demonware]: [lobby]: ping packet\n");
|
||||
#endif
|
||||
const std::string zero("\x00\x00\x00\x00", 4);
|
||||
raw_reply reply(zero);
|
||||
this->send_reply(&reply);
|
||||
return;
|
||||
}
|
||||
else if (size == 0xC8) // Connection id
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("[demonware]: [lobby]: received client_header_ack.\n");
|
||||
#endif
|
||||
|
||||
int c8;
|
||||
buffer.read_int32(&c8);
|
||||
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);
|
||||
demonware::queue_packet_to_hash(packet_2);
|
||||
|
||||
raw_reply reply(packet_2);
|
||||
this->send_reply(&reply);
|
||||
#ifdef DEBUG
|
||||
printf("[demonware]: [lobby]: sending server_header_ack.\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
if (buffer.size() < size_t(size)) return;
|
||||
|
||||
uint8_t check_AB;
|
||||
buffer.read_byte(&check_AB);
|
||||
if (check_AB == 0xAB)
|
||||
{
|
||||
uint8_t type;
|
||||
buffer.read_byte(&type);
|
||||
|
||||
if (type == 0x82)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("[demonware]: [lobby]: received client_auth.\n");
|
||||
#endif
|
||||
std::string packet_3(packet.data(), packet.size() - 8); // this 8 are client hash check?
|
||||
|
||||
demonware::queue_packet_to_hash(packet_3);
|
||||
demonware::derive_keys_s1();
|
||||
|
||||
char buff[14] = "\x0A\x00\x00\x00\xAB\x83";
|
||||
std::memcpy(&buff[6], demonware::get_response_id().data(), 8);
|
||||
std::string response(buff, 14);
|
||||
|
||||
raw_reply reply(response);
|
||||
this->send_reply(&reply);
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("[demonware]: [lobby]: sending server_auth_done.\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
else if (type == 0x85)
|
||||
{
|
||||
uint32_t msgCount;
|
||||
buffer.read_uint32(&msgCount);
|
||||
|
||||
char seed[16];
|
||||
buffer.read(16, &seed);
|
||||
|
||||
std::string enc = buffer.get_remaining();
|
||||
|
||||
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());
|
||||
|
||||
byte_buffer serv(dec);
|
||||
serv.set_use_data_types(false);
|
||||
|
||||
uint32_t serv_size;
|
||||
serv.read_uint32(&serv_size);
|
||||
|
||||
uint8_t magic; // 0x86
|
||||
serv.read_byte(&magic);
|
||||
|
||||
uint8_t service_id;
|
||||
serv.read_byte(&service_id);
|
||||
|
||||
this->call_service(service_id, serv.get_remaining());
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
|
||||
printf("[demonware]: [lobby]: ERROR! received unk message.\n");
|
||||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void server_lobby::call_service(std::uint8_t id, const std::string& data)
|
||||
{
|
||||
const auto& it = this->services_.find(id);
|
||||
|
||||
if (it != this->services_.end())
|
||||
{
|
||||
it->second->exec_task(this, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
|
||||
printf("[demonware]: [lobby]: missing service '%s'\n", utils::string::va("%d", id));
|
||||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
40
src/client/game/demonware/servers/server_lobby.hpp
Normal file
40
src/client/game/demonware/servers/server_lobby.hpp
Normal file
@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class server_lobby : public server_base, service_server
|
||||
{
|
||||
public:
|
||||
explicit server_lobby(std::string name);
|
||||
|
||||
void frame() override;
|
||||
int recv(const char* buf, int len) override;
|
||||
int send(char* buf, int len) override;
|
||||
bool pending_data()override;
|
||||
|
||||
template <typename T>
|
||||
void register_service()
|
||||
{
|
||||
static_assert(std::is_base_of<service, T>::value, "service must inherit from service");
|
||||
|
||||
auto service = std::make_unique<T>();
|
||||
const uint8_t id = service->id();
|
||||
|
||||
this->services_[id] = std::move(service);
|
||||
}
|
||||
|
||||
void send_reply(reply* data) override;
|
||||
|
||||
private:
|
||||
std::recursive_mutex mutex_;
|
||||
std::queue<char> outgoing_queue_;
|
||||
std::queue<std::string> incoming_queue_;
|
||||
std::map<std::uint8_t, std::unique_ptr<service>> services_;
|
||||
|
||||
void dispatch(const std::string& packet);
|
||||
void call_service(std::uint8_t type, const std::string& data);
|
||||
|
||||
};
|
||||
|
||||
}
|
0
src/client/game/demonware/servers/server_stun.hpp
Normal file
0
src/client/game/demonware/servers/server_stun.hpp
Normal file
98
src/client/game/demonware/service.hpp
Normal file
98
src/client/game/demonware/service.hpp
Normal file
@ -0,0 +1,98 @@
|
||||
#pragma once
|
||||
#include <utils/string.hpp>
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class task
|
||||
{
|
||||
public:
|
||||
using callback_t = std::function<void(service_server*, uint8_t, byte_buffer*)>;
|
||||
|
||||
private:
|
||||
std::uint8_t id_;
|
||||
std::string name_;
|
||||
callback_t callback_;
|
||||
|
||||
public:
|
||||
virtual ~task() = default;
|
||||
task(task&&) = delete;
|
||||
task(const task&) = delete;
|
||||
task& operator=(const task&) = delete;
|
||||
task(std::uint8_t id, std::string name, callback_t callback) : id_(id), name_(std::move(name)), callback_(callback) { }
|
||||
|
||||
auto id() -> std::uint8_t { return this->id_; }
|
||||
auto name() -> std::string { return this->name_; }
|
||||
|
||||
void exec(service_server* server, byte_buffer* data)
|
||||
{
|
||||
this->callback_(server, this->id_, data);
|
||||
}
|
||||
};
|
||||
|
||||
class service
|
||||
{
|
||||
std::uint8_t id_;
|
||||
std::string name_;
|
||||
std::mutex mutex_;
|
||||
std::map<std::uint8_t, std::unique_ptr<task>> tasks_;
|
||||
|
||||
public:
|
||||
virtual ~service() = default;
|
||||
service(service&&) = delete;
|
||||
service(const service&) = delete;
|
||||
service& operator=(const service&) = delete;
|
||||
service(std::uint8_t id, std::string name) : id_(id), name_(std::move(name)) { }
|
||||
|
||||
auto id() -> std::uint8_t { return this->id_; }
|
||||
auto name() -> std::string { return this->name_; }
|
||||
|
||||
void exec_task(service_server* server, const std::string& data)
|
||||
{
|
||||
std::lock_guard $(this->mutex_);
|
||||
|
||||
byte_buffer buffer(data);
|
||||
|
||||
std::uint8_t task_id;
|
||||
buffer.read_byte(&task_id);
|
||||
|
||||
const auto& it = this->tasks_.find(task_id);
|
||||
|
||||
if (it != this->tasks_.end())
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("[demonware]: [%s]: executing task '%s\n", name_.data(), it->second->name().data());
|
||||
#endif
|
||||
|
||||
it->second->exec(server, &buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
|
||||
printf("[demonware]: [%s]: missing task '%s'\n", name_.data(), utils::string::va("%d", task_id));
|
||||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
template <typename Class, typename T, typename... Args>
|
||||
void register_task(const uint8_t id, std::string name, T(Class::* callback)(Args ...) const)
|
||||
{
|
||||
this->tasks_[id] = std::make_unique<task>(id, std::move(name), [this, callback](Args ... args) -> T
|
||||
{
|
||||
return (reinterpret_cast<Class*>(this)->*callback)(args...);
|
||||
});
|
||||
}
|
||||
|
||||
template <typename Class, typename T, typename... Args>
|
||||
void register_task(const uint8_t id, std::string name, T(Class::* callback)(Args ...))
|
||||
{
|
||||
this->tasks_[id] = std::make_unique<task>(id, std::move(name), [this, callback](Args ... args) -> T
|
||||
{
|
||||
return (reinterpret_cast<Class*>(this)->*callback)(args...);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace demonware
|
@ -1,202 +0,0 @@
|
||||
#include <std_include.hpp>
|
||||
#include "component/demonware.hpp"
|
||||
#include "game/demonware/service_server.hpp"
|
||||
|
||||
#include <utils/cryptography.hpp>
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
std::string unencrypted_reply::get_data()
|
||||
{
|
||||
byte_buffer result;
|
||||
result.set_use_data_types(false);
|
||||
|
||||
result.write_int32(static_cast<int>(this->buffer_.size()) + 2);
|
||||
result.write_bool(false);
|
||||
result.write_byte(this->get_type());
|
||||
result.write(this->buffer_);
|
||||
|
||||
return result.get_buffer();
|
||||
}
|
||||
|
||||
std::string encrypted_reply::get_data()
|
||||
{
|
||||
byte_buffer result;
|
||||
result.set_use_data_types(false);
|
||||
|
||||
byte_buffer enc_buffer;
|
||||
enc_buffer.set_use_data_types(false);
|
||||
enc_buffer.write_int32(0xDEADBEEF);
|
||||
enc_buffer.write_byte(this->get_type());
|
||||
enc_buffer.write(this->buffer_);
|
||||
|
||||
auto data = enc_buffer.get_buffer();
|
||||
|
||||
auto size = enc_buffer.size();
|
||||
size = ~7 & (size + 7); // 8 byte align
|
||||
data.resize(size);
|
||||
|
||||
result.write_int32(static_cast<int>(size) + 5);
|
||||
result.write_byte(true);
|
||||
|
||||
auto seed = 0x13371337;
|
||||
result.write_int32(seed);
|
||||
|
||||
const auto iv = utils::cryptography::tiger::compute(std::string(reinterpret_cast<char*>(&seed), 4));
|
||||
|
||||
const std::string key(reinterpret_cast<char*>(get_key(true)), 24);
|
||||
result.write(utils::cryptography::des3::encrypt(data, iv, key));
|
||||
|
||||
return result.get_buffer();
|
||||
}
|
||||
|
||||
service_server::service_server(std::string _name) : name_(std::move(_name))
|
||||
{
|
||||
this->address_ = utils::cryptography::jenkins_one_at_a_time::compute(this->name_);
|
||||
}
|
||||
|
||||
unsigned long service_server::get_address() const
|
||||
{
|
||||
return this->address_;
|
||||
}
|
||||
|
||||
int service_server::send(const char* buf, const int len)
|
||||
{
|
||||
if (len <= 3) return -1;
|
||||
std::lock_guard<std::recursive_mutex> _(this->mutex_);
|
||||
|
||||
this->incoming_queue_.push(std::string(buf, len));
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
int service_server::recv(char* buf, int len)
|
||||
{
|
||||
if (len > 0 && !this->outgoing_queue_.empty())
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(this->mutex_);
|
||||
|
||||
len = std::min(len, static_cast<int>(this->outgoing_queue_.size()));
|
||||
for (auto i = 0; i < len; ++i)
|
||||
{
|
||||
buf[i] = this->outgoing_queue_.front();
|
||||
this->outgoing_queue_.pop();
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
void service_server::send_reply(reply* data)
|
||||
{
|
||||
if (!data) return;
|
||||
|
||||
std::lock_guard<std::recursive_mutex> _(this->mutex_);
|
||||
|
||||
this->reply_sent_ = true;
|
||||
const auto buffer = data->get_data();
|
||||
for (const auto& byte : buffer)
|
||||
{
|
||||
this->outgoing_queue_.push(byte);
|
||||
}
|
||||
}
|
||||
|
||||
void service_server::call_handler(const uint8_t type, const std::string& data)
|
||||
{
|
||||
if (this->services_.find(type) != this->services_.end())
|
||||
{
|
||||
this->services_[type]->call_service(this, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("DW: Missing handler of type %d\n", type);
|
||||
}
|
||||
}
|
||||
|
||||
void service_server::run_frame()
|
||||
{
|
||||
if (!this->incoming_queue_.empty())
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(this->mutex_);
|
||||
const auto packet = this->incoming_queue_.front();
|
||||
this->incoming_queue_.pop();
|
||||
|
||||
this->parse_packet(packet);
|
||||
}
|
||||
}
|
||||
|
||||
void service_server::parse_packet(const std::string& packet)
|
||||
{
|
||||
byte_buffer buffer(packet);
|
||||
buffer.set_use_data_types(false);
|
||||
|
||||
try
|
||||
{
|
||||
while (buffer.has_more_data())
|
||||
{
|
||||
int size;
|
||||
buffer.read_int32(&size);
|
||||
|
||||
if (size <= 0)
|
||||
{
|
||||
const std::string zero("\x00\x00\x00\x00", 4);
|
||||
|
||||
raw_reply reply(zero);
|
||||
this->send_reply(&reply);
|
||||
return;
|
||||
}
|
||||
else if (size == 200) // Connection id
|
||||
{
|
||||
byte_buffer bbufer;
|
||||
bbufer.write_uint64(0x00000000000000FD);
|
||||
|
||||
auto reply = this->create_message(4);
|
||||
reply->send(&bbufer, false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (buffer.size() < size_t(size)) return;
|
||||
|
||||
byte_buffer p_buffer;
|
||||
p_buffer.set_use_data_types(false);
|
||||
p_buffer.get_buffer().resize(size);
|
||||
buffer.read(size, p_buffer.get_buffer().data());
|
||||
|
||||
bool enc;
|
||||
p_buffer.read_bool(&enc);
|
||||
|
||||
if (enc)
|
||||
{
|
||||
int iv;
|
||||
p_buffer.read_int32(&iv);
|
||||
|
||||
auto iv_hash = utils::cryptography::tiger::compute(std::string(reinterpret_cast<char*>(&iv), 4));
|
||||
|
||||
const std::string key(reinterpret_cast<char*>(get_key(false)), 24);
|
||||
p_buffer = byte_buffer{utils::cryptography::des3::decrypt(p_buffer.get_remaining(), iv_hash, key)};
|
||||
p_buffer.set_use_data_types(false);
|
||||
|
||||
int checksum;
|
||||
p_buffer.read_int32(&checksum);
|
||||
}
|
||||
|
||||
uint8_t type;
|
||||
p_buffer.read_byte(&type);
|
||||
printf("DW: Handling message of type %d (encrypted: %d)\n", type, enc);
|
||||
|
||||
this->reply_sent_ = false;
|
||||
this->call_handler(type, p_buffer.get_remaining());
|
||||
|
||||
if (!this->reply_sent_ && type != 7)
|
||||
{
|
||||
this->create_reply(type)->send();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
#pragma once
|
||||
#include "i_service.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class service_server final : public i_server
|
||||
{
|
||||
public:
|
||||
explicit service_server(std::string name);
|
||||
|
||||
template <typename T>
|
||||
void register_service()
|
||||
{
|
||||
static_assert(std::is_base_of<i_service, T>::value, "Service must inherit from IService");
|
||||
|
||||
auto service = std::make_unique<T>();
|
||||
const uint16_t type = service->getType();
|
||||
|
||||
this->services_[type] = std::move(service);
|
||||
}
|
||||
|
||||
unsigned long get_address() const;
|
||||
|
||||
int send(const char* buf, int len) override;
|
||||
int recv(char* buf, int len) override;
|
||||
void send_reply(reply* data) override;
|
||||
|
||||
void call_handler(uint8_t type, const std::string& data);
|
||||
void run_frame();
|
||||
|
||||
private:
|
||||
std::string name_;
|
||||
|
||||
std::recursive_mutex mutex_;
|
||||
std::queue<char> outgoing_queue_;
|
||||
std::queue<std::string> incoming_queue_;
|
||||
std::map<uint16_t, std::unique_ptr<i_service>> services_;
|
||||
unsigned long address_ = 0;
|
||||
bool reply_sent_ = false;
|
||||
|
||||
void parse_packet(const std::string& packet);
|
||||
};
|
||||
}
|
@ -1,18 +1,27 @@
|
||||
#include <std_include.hpp>
|
||||
#include "bdAnticheat.hpp"
|
||||
#include "../data_types.hpp"
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
bdAnticheat::bdAnticheat()
|
||||
|
||||
bdAnticheat::bdAnticheat() : service(38, "bdAnticheat")
|
||||
{
|
||||
this->register_service(4, &bdAnticheat::report_console_details);
|
||||
this->register_task(2, "unk2", &bdAnticheat::unk2);
|
||||
this->register_task(4, "report console details", &bdAnticheat::report_console_details);
|
||||
}
|
||||
|
||||
void bdAnticheat::report_console_details(i_server* server, [[maybe_unused]] byte_buffer* buffer) const
|
||||
void bdAnticheat::unk2(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO: Read data as soon as needed
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdAnticheat::report_console_details(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO: Read data as soon as needed
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,14 +1,16 @@
|
||||
#pragma once
|
||||
#include "../i_service.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class bdAnticheat final : public i_generic_service<38>
|
||||
|
||||
class bdAnticheat final : public service
|
||||
{
|
||||
public:
|
||||
bdAnticheat();
|
||||
|
||||
private:
|
||||
void report_console_details(i_server* server, byte_buffer* buffer) const;
|
||||
void unk2(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void report_console_details(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,24 +1,27 @@
|
||||
#include <std_include.hpp>
|
||||
#include "bdBandwidthTest.hpp"
|
||||
#include "../data_types.hpp"
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
static uint8_t bandwidth_iw6[51] =
|
||||
{
|
||||
0x0F, 0xC1, 0x1C, 0x37, 0xB8, 0xEF, 0x7C, 0xD6, 0x00, 0x00, 0x04,
|
||||
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0xF4, 0x01, 0x00, 0x00, 0xD0, 0x07,
|
||||
0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x88, 0x13, 0x00, 0x00, 0xF4, 0x01,
|
||||
0x00, 0x00, 0x02, 0x0C, 0x88, 0xB3, 0x04, 0x65, 0x89, 0xBF, 0xC3, 0x6A,
|
||||
0x27, 0x94, 0xD4, 0x8F
|
||||
};
|
||||
|
||||
void bdBandwidthTest::call_service(i_server* server, const std::string& /*data*/)
|
||||
bdBandwidthTest::bdBandwidthTest() : service(18, "bdBandwidthTest")
|
||||
{
|
||||
byte_buffer buffer;
|
||||
buffer.write(sizeof bandwidth_iw6, bandwidth_iw6);
|
||||
|
||||
auto reply = server->create_message(5);
|
||||
reply->send(&buffer, true);
|
||||
this->register_task(204, "unk204", &bdBandwidthTest::unk204);
|
||||
this->register_task(2, "unk2", &bdBandwidthTest::unk2);
|
||||
}
|
||||
|
||||
void bdBandwidthTest::unk204(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO: Read data as soon as needed
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdBandwidthTest::unk2(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,11 +1,16 @@
|
||||
#pragma once
|
||||
#include "../i_service.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class bdBandwidthTest final : public i_generic_service<18>
|
||||
|
||||
class bdBandwidthTest final : public service
|
||||
{
|
||||
public:
|
||||
void call_service(i_server* server, const std::string& data) override;
|
||||
bdBandwidthTest();
|
||||
|
||||
private:
|
||||
void unk204(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk2(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
27
src/client/game/demonware/services/bdContentStreaming.cpp
Normal file
27
src/client/game/demonware/services/bdContentStreaming.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
bdContentStreaming::bdContentStreaming() : service(50, "bdContentStreaming")
|
||||
{
|
||||
this->register_task(2, "unk2", &bdContentStreaming::unk2);
|
||||
this->register_task(3, "unk3", &bdContentStreaming::unk3);
|
||||
}
|
||||
|
||||
void bdContentStreaming::unk2(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdContentStreaming::unk3(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
16
src/client/game/demonware/services/bdContentStreaming.hpp
Normal file
16
src/client/game/demonware/services/bdContentStreaming.hpp
Normal file
@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class bdContentStreaming final : public service
|
||||
{
|
||||
public:
|
||||
bdContentStreaming();
|
||||
|
||||
private:
|
||||
void unk2(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk3(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
27
src/client/game/demonware/services/bdCounters.cpp
Normal file
27
src/client/game/demonware/services/bdCounters.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
bdCounters::bdCounters() : service(23, "bdCounters")
|
||||
{
|
||||
this->register_task(1, "unk1", &bdCounters::unk1);
|
||||
this->register_task(2, "unk2", &bdCounters::unk2);
|
||||
}
|
||||
|
||||
void bdCounters::unk1(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdCounters::unk2(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
16
src/client/game/demonware/services/bdCounters.hpp
Normal file
16
src/client/game/demonware/services/bdCounters.hpp
Normal file
@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class bdCounters final : public service
|
||||
{
|
||||
public:
|
||||
bdCounters();
|
||||
|
||||
private:
|
||||
void unk1(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk2(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
@ -1,15 +1,14 @@
|
||||
#include <std_include.hpp>
|
||||
#include "bdDML.hpp"
|
||||
#include "../data_types.hpp"
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
bdDML::bdDML()
|
||||
bdDML::bdDML() : service(27, "bdDML")
|
||||
{
|
||||
this->register_service(2, &bdDML::get_user_raw_data);
|
||||
this->register_task(2, "get user raw data", &bdDML::get_user_raw_data);
|
||||
}
|
||||
|
||||
void bdDML::get_user_raw_data(i_server* server, byte_buffer* /*buffer*/) const
|
||||
void bdDML::get_user_raw_data(service_server* server, uint8_t type, byte_buffer* /*buffer*/) const
|
||||
{
|
||||
auto result = new bdDMLRawData;
|
||||
result->country_code = "US";
|
||||
@ -22,7 +21,7 @@ namespace demonware
|
||||
result->asn = 0x2119;
|
||||
result->timezone = "+01:00";
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
auto reply = server->create_reply(type);
|
||||
reply->add(result);
|
||||
reply->send();
|
||||
}
|
||||
|
@ -1,14 +1,13 @@
|
||||
#pragma once
|
||||
#include "../i_service.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class bdDML final : public i_generic_service<27>
|
||||
class bdDML final : public service
|
||||
{
|
||||
public:
|
||||
bdDML();
|
||||
|
||||
private:
|
||||
void get_user_raw_data(i_server* server, byte_buffer* buffer) const;
|
||||
void get_user_raw_data(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
}
|
||||
|
@ -1,63 +0,0 @@
|
||||
#include <std_include.hpp>
|
||||
#include "bdDediAuth.hpp"
|
||||
|
||||
#include "game/game.hpp"
|
||||
#include "steam/steam.hpp"
|
||||
|
||||
#include <utils/cryptography.hpp>
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
void bdDediAuth::call_service(i_server* server, const std::string& data)
|
||||
{
|
||||
bit_buffer buffer(data);
|
||||
|
||||
bool more_data;
|
||||
buffer.set_use_data_types(false);
|
||||
buffer.read_bool(&more_data);
|
||||
buffer.set_use_data_types(true);
|
||||
|
||||
uint32_t seed, title_id, ticket_size;
|
||||
buffer.read_uint32(&seed);
|
||||
buffer.read_uint32(&title_id);
|
||||
|
||||
uint8_t ticket[1024];
|
||||
buffer.read_bytes(std::min(ticket_size, static_cast<uint32_t>(sizeof(ticket))), ticket);
|
||||
|
||||
game::bdAuthTicket auth_ticket{};
|
||||
std::memset(&auth_ticket, 0xA, sizeof auth_ticket);
|
||||
|
||||
auth_ticket.m_magicNumber = 0x0EFBDADDE;
|
||||
auth_ticket.m_type = 0;
|
||||
auth_ticket.m_titleID = title_id;
|
||||
auth_ticket.m_userID = steam::SteamUser()->GetSteamID().bits;
|
||||
auth_ticket.m_licenseID = 4;
|
||||
|
||||
auto key = utils::cryptography::tiger::compute(SERVER_CD_KEY);
|
||||
|
||||
strcpy_s(auth_ticket.m_username, "S1MOD Server");
|
||||
std::memcpy(auth_ticket.m_sessionKey, key.data(), 24);
|
||||
auth_ticket.m_timeIssued = static_cast<uint32_t>(time(nullptr));
|
||||
|
||||
uint8_t lsg_ticket[128];
|
||||
ZeroMemory(&lsg_ticket, sizeof lsg_ticket);
|
||||
std::memcpy(lsg_ticket, key.data(), 24);
|
||||
|
||||
const auto iv = utils::cryptography::tiger::compute(std::string(reinterpret_cast<char*>(&seed), 4));
|
||||
|
||||
const std::string enc_key(reinterpret_cast<char*>(&ticket[32]), 24);
|
||||
auto enc_ticket = utils::cryptography::des3::encrypt(
|
||||
std::string(reinterpret_cast<char*>(&auth_ticket), sizeof(auth_ticket)), iv, enc_key);
|
||||
|
||||
bit_buffer response;
|
||||
response.set_use_data_types(false);
|
||||
response.write_bool(false);
|
||||
response.write_uint32(700);
|
||||
response.write_uint32(seed);
|
||||
response.write_bytes(enc_ticket.size(), enc_ticket.data());
|
||||
response.write_bytes(sizeof(lsg_ticket), lsg_ticket);
|
||||
|
||||
auto reply = server->create_message(29);
|
||||
reply->send(&response, false);
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
#pragma once
|
||||
#include "../i_service.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class bdDediAuth final : public i_generic_service<12>
|
||||
{
|
||||
public:
|
||||
void call_service(i_server* server, const std::string& data) override;
|
||||
};
|
||||
}
|
@ -1,73 +0,0 @@
|
||||
#include <std_include.hpp>
|
||||
#include "bdDediRSAAuth.hpp"
|
||||
|
||||
#include "game/game.hpp"
|
||||
#include "steam/steam.hpp"
|
||||
|
||||
#include <utils/cryptography.hpp>
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
void bdDediRSAAuth::call_service(i_server* server, const std::string& data)
|
||||
{
|
||||
bit_buffer buffer(data);
|
||||
|
||||
bool more_data;
|
||||
buffer.set_use_data_types(false);
|
||||
buffer.read_bool(&more_data);
|
||||
buffer.set_use_data_types(true);
|
||||
|
||||
uint32_t seed, title_id, ticket_size;
|
||||
buffer.read_uint32(&seed);
|
||||
buffer.read_uint32(&title_id);
|
||||
|
||||
unsigned char rsa_key[140];
|
||||
buffer.read_bytes(sizeof(rsa_key), rsa_key);
|
||||
|
||||
uint8_t ticket[1024];
|
||||
buffer.read_bytes(std::min(ticket_size, static_cast<uint32_t>(sizeof(ticket))), ticket);
|
||||
|
||||
game::bdAuthTicket auth_ticket{};
|
||||
std::memset(&auth_ticket, 0xA, sizeof auth_ticket);
|
||||
|
||||
auth_ticket.m_magicNumber = 0x0EFBDADDE;
|
||||
auth_ticket.m_type = 0;
|
||||
auth_ticket.m_titleID = title_id;
|
||||
auth_ticket.m_userID = steam::SteamUser()->GetSteamID().bits;
|
||||
|
||||
auto key = utils::cryptography::tiger::compute(SERVER_CD_KEY);
|
||||
|
||||
strcpy_s(auth_ticket.m_username, "S1MOD Server");
|
||||
std::memcpy(auth_ticket.m_sessionKey, key.data(), 24);
|
||||
auth_ticket.m_timeIssued = static_cast<uint32_t>(time(nullptr));
|
||||
|
||||
uint8_t lsg_ticket[128];
|
||||
ZeroMemory(&lsg_ticket, sizeof lsg_ticket);
|
||||
std::memcpy(lsg_ticket, key.data(), 24);
|
||||
|
||||
const auto iv = utils::cryptography::tiger::compute(std::string(reinterpret_cast<char*>(&seed), 4));
|
||||
|
||||
const std::string enc_key(reinterpret_cast<char*>(&ticket[32]), 24);
|
||||
auto enc_ticket = utils::cryptography::des3::encrypt(
|
||||
std::string(reinterpret_cast<char*>(&auth_ticket), sizeof(auth_ticket)), iv, enc_key);
|
||||
|
||||
register_hash(&sha1_desc);
|
||||
register_prng(&yarrow_desc);
|
||||
|
||||
auto encrypted_key = utils::cryptography::rsa::encrypt(std::string(SERVER_CD_KEY, 24),
|
||||
std::string("DW-RSAENC", 10),
|
||||
std::string(PCHAR(rsa_key), sizeof(rsa_key)));
|
||||
|
||||
bit_buffer response;
|
||||
response.set_use_data_types(false);
|
||||
response.write_bool(false);
|
||||
response.write_uint32(700);
|
||||
response.write_uint32(seed);
|
||||
response.write_bytes(enc_ticket.size(), enc_ticket.data());
|
||||
response.write_bytes(sizeof(lsg_ticket), lsg_ticket);
|
||||
response.write_bytes(encrypted_key.size(), encrypted_key.data());
|
||||
|
||||
auto reply = server->create_message(29);
|
||||
reply->send(&response, false);
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
#pragma once
|
||||
#include "../i_service.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class bdDediRSAAuth final : public i_generic_service<26>
|
||||
{
|
||||
public:
|
||||
void call_service(i_server* server, const std::string& data) override;
|
||||
};
|
||||
}
|
19
src/client/game/demonware/services/bdEventLog.cpp
Normal file
19
src/client/game/demonware/services/bdEventLog.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
bdEventLog::bdEventLog() : service(67, "bdEventLog")
|
||||
{
|
||||
this->register_task(6, "unk6", &bdEventLog::unk6);
|
||||
}
|
||||
|
||||
void bdEventLog::unk6(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
15
src/client/game/demonware/services/bdEventLog.hpp
Normal file
15
src/client/game/demonware/services/bdEventLog.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class bdEventLog final : public service
|
||||
{
|
||||
public:
|
||||
bdEventLog();
|
||||
|
||||
private:
|
||||
void unk6(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
43
src/client/game/demonware/services/bdFacebook.cpp
Normal file
43
src/client/game/demonware/services/bdFacebook.cpp
Normal file
@ -0,0 +1,43 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
bdFacebook::bdFacebook() : service(36, "bdFacebook")
|
||||
{
|
||||
this->register_task(1, "unk1", &bdFacebook::unk1);
|
||||
this->register_task(3, "unk3", &bdFacebook::unk3);
|
||||
this->register_task(7, "unk7", &bdFacebook::unk7);
|
||||
this->register_task(8, "unk8", &bdFacebook::unk8);
|
||||
}
|
||||
|
||||
void bdFacebook::unk1(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdFacebook::unk3(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdFacebook::unk7(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdFacebook::unk8(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
18
src/client/game/demonware/services/bdFacebook.hpp
Normal file
18
src/client/game/demonware/services/bdFacebook.hpp
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class bdFacebook final : public service
|
||||
{
|
||||
public:
|
||||
bdFacebook();
|
||||
|
||||
private:
|
||||
void unk1(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk3(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk7(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk8(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
#include <std_include.hpp>
|
||||
#include "bdGroup.hpp"
|
||||
#include "../data_types.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
bdGroup::bdGroup()
|
||||
{
|
||||
this->register_service(1, &bdGroup::set_groups);
|
||||
this->register_service(4, &bdGroup::get_groups);
|
||||
}
|
||||
|
||||
void bdGroup::set_groups(i_server* server, byte_buffer* /*buffer*/) const
|
||||
{
|
||||
//uint32_t groupCount;
|
||||
// TODO: Implement array reading
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdGroup::get_groups(i_server* server, byte_buffer* buffer)
|
||||
{
|
||||
uint32_t group_count;
|
||||
buffer->read_array_header(8, &group_count);
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
|
||||
buffer->set_use_data_types(false);
|
||||
|
||||
for (uint32_t i = 0; i < group_count; ++i)
|
||||
{
|
||||
auto* count = new bdGroupCount;
|
||||
buffer->read_uint32(&count->group_id);
|
||||
|
||||
if (count->group_id < ARRAYSIZE(this->groups))
|
||||
{
|
||||
this->groups[count->group_id] = 999;
|
||||
count->group_count = this->groups[count->group_id];
|
||||
}
|
||||
|
||||
reply->add(count);
|
||||
}
|
||||
|
||||
buffer->set_use_data_types(true);
|
||||
|
||||
reply->send();
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
#pragma once
|
||||
#include "../i_service.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class bdGroup final : public i_generic_service<28>
|
||||
{
|
||||
public:
|
||||
bdGroup();
|
||||
|
||||
private:
|
||||
void set_groups(i_server* server, byte_buffer* buffer) const;
|
||||
void get_groups(i_server* server, byte_buffer* buffer);
|
||||
|
||||
uint32_t groups[512]{};
|
||||
};
|
||||
}
|
27
src/client/game/demonware/services/bdGroups.cpp
Normal file
27
src/client/game/demonware/services/bdGroups.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
bdGroups::bdGroups() : service(28, "bdGroup")
|
||||
{
|
||||
this->register_task(1, "set_groups", &bdGroups::set_groups);
|
||||
this->register_task(4, "unk4", &bdGroups::unk4);
|
||||
}
|
||||
|
||||
void bdGroups::set_groups(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdGroups::unk4(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
16
src/client/game/demonware/services/bdGroups.hpp
Normal file
16
src/client/game/demonware/services/bdGroups.hpp
Normal file
@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class bdGroups final : public service
|
||||
{
|
||||
public:
|
||||
bdGroups();
|
||||
|
||||
private:
|
||||
void set_groups(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk4(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
#include <std_include.hpp>
|
||||
#include "bdLSGHello.hpp"
|
||||
#include "component/demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
void bdLSGHello::call_service(i_server* server, const std::string& data)
|
||||
{
|
||||
bit_buffer buffer(data);
|
||||
|
||||
bool more_data;
|
||||
buffer.set_use_data_types(false);
|
||||
buffer.read_bool(&more_data);
|
||||
buffer.set_use_data_types(true);
|
||||
|
||||
uint32_t seed, title_id;
|
||||
buffer.read_uint32(&title_id);
|
||||
buffer.read_uint32(&seed);
|
||||
|
||||
uint8_t ticket[128];
|
||||
buffer.read_bytes(sizeof(ticket), ticket);
|
||||
|
||||
set_key(true, ticket);
|
||||
set_key(false, ticket);
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
#pragma once
|
||||
#include "../i_service.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class bdLSGHello final : public i_generic_service<7>
|
||||
{
|
||||
public:
|
||||
void call_service(i_server* server, const std::string& data) override;
|
||||
};
|
||||
}
|
19
src/client/game/demonware/services/bdMarketing.cpp
Normal file
19
src/client/game/demonware/services/bdMarketing.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
bdMarketing::bdMarketing() : service(139, "bdMarketing")
|
||||
{
|
||||
this->register_task(3, "unk3", &bdMarketing::unk3);
|
||||
}
|
||||
|
||||
void bdMarketing::unk3(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
15
src/client/game/demonware/services/bdMarketing.hpp
Normal file
15
src/client/game/demonware/services/bdMarketing.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class bdMarketing final : public service
|
||||
{
|
||||
public:
|
||||
bdMarketing();
|
||||
|
||||
private:
|
||||
void unk3(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
@ -1,107 +0,0 @@
|
||||
#include <std_include.hpp>
|
||||
#include "bdMatchMaking.hpp"
|
||||
#include "../data_types.hpp"
|
||||
#include "steam/steam.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
std::map<uint64_t, std::shared_ptr<MatchMakingInfo>> sessions;
|
||||
|
||||
void UpdateSession(const std::string& data)
|
||||
{
|
||||
byte_buffer buffer(data);
|
||||
|
||||
auto mmInfo = std::make_shared<MatchMakingInfo>();
|
||||
mmInfo->symmetric = true;
|
||||
mmInfo->deserialize(&buffer);
|
||||
mmInfo->symmetric = false;
|
||||
|
||||
sessions[mmInfo->session_id.session_id] = mmInfo;
|
||||
}
|
||||
|
||||
void DeleteSession(const std::string& data)
|
||||
{
|
||||
byte_buffer buffer(data);
|
||||
|
||||
bdSessionID id;
|
||||
id.deserialize(&buffer);
|
||||
|
||||
const auto session = sessions.find(id.session_id);
|
||||
if (session != sessions.end())
|
||||
{
|
||||
sessions.erase(session);
|
||||
}
|
||||
}
|
||||
|
||||
bdMatchMaking::bdMatchMaking()
|
||||
{
|
||||
this->register_service(1, &bdMatchMaking::create_session);
|
||||
this->register_service(2, &bdMatchMaking::update_session);
|
||||
this->register_service(3, &bdMatchMaking::delete_session);
|
||||
this->register_service(10, &bdMatchMaking::get_performance);
|
||||
this->register_service(16, &bdMatchMaking::find_sessions_two_pass);
|
||||
}
|
||||
|
||||
void bdMatchMaking::create_session(i_server* server, byte_buffer* /*buffer*/) const
|
||||
{
|
||||
auto* id = new bdSessionID;
|
||||
id->session_id = steam::SteamUser()->GetSteamID().bits;
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->add(id);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdMatchMaking::update_session(i_server* server, byte_buffer* buffer) const
|
||||
{
|
||||
MatchMakingInfo mmInfo;
|
||||
mmInfo.session_id.deserialize(buffer);
|
||||
mmInfo.deserialize(buffer);
|
||||
|
||||
byte_buffer out_data;
|
||||
mmInfo.symmetric = true;
|
||||
mmInfo.serialize(&out_data);
|
||||
|
||||
byte_buffer addr_buf(mmInfo.host_addr);
|
||||
bdCommonAddr addr;
|
||||
addr.deserialize(&addr_buf);
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdMatchMaking::delete_session(i_server* server, byte_buffer* buffer) const
|
||||
{
|
||||
bdSessionID id;
|
||||
id.deserialize(buffer);
|
||||
|
||||
byte_buffer out_data;
|
||||
id.serialize(&out_data);
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdMatchMaking::get_performance(i_server* server, byte_buffer* /*buffer*/) const
|
||||
{
|
||||
auto* result = new bdPerformanceValue;
|
||||
result->user_id = steam::SteamUser()->GetSteamID().bits;
|
||||
result->performance = 10;
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->add(result);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdMatchMaking::find_sessions_two_pass(i_server* server, byte_buffer* /*buffer*/) const
|
||||
{
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
|
||||
for (auto& session : sessions)
|
||||
{
|
||||
reply->add(session.second);
|
||||
}
|
||||
|
||||
reply->send();
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
#include "../i_service.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class bdMatchMaking final : public i_generic_service<21>
|
||||
{
|
||||
public:
|
||||
bdMatchMaking();
|
||||
|
||||
private:
|
||||
void create_session(i_server* server, byte_buffer* buffer) const;
|
||||
void update_session(i_server* server, byte_buffer* buffer) const;
|
||||
void delete_session(i_server* server, byte_buffer* buffer) const;
|
||||
void get_performance(i_server* server, byte_buffer* buffer) const;
|
||||
void find_sessions_two_pass(i_server* server, byte_buffer* buffer) const;
|
||||
};
|
||||
}
|
51
src/client/game/demonware/services/bdMatchMaking2.cpp
Normal file
51
src/client/game/demonware/services/bdMatchMaking2.cpp
Normal file
@ -0,0 +1,51 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
bdMatchMaking2::bdMatchMaking2() : service(138, "bdMatchMaking2")
|
||||
{
|
||||
this->register_task(1, "unk1", &bdMatchMaking2::unk1);
|
||||
this->register_task(2, "unk2", &bdMatchMaking2::unk2);
|
||||
this->register_task(3, "unk3", &bdMatchMaking2::unk3);
|
||||
this->register_task(5, "unk5", &bdMatchMaking2::unk5);
|
||||
this->register_task(16, "unk16", &bdMatchMaking2::unk16);
|
||||
}
|
||||
|
||||
void bdMatchMaking2::unk1(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdMatchMaking2::unk2(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdMatchMaking2::unk3(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdMatchMaking2::unk5(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdMatchMaking2::unk16(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
19
src/client/game/demonware/services/bdMatchMaking2.hpp
Normal file
19
src/client/game/demonware/services/bdMatchMaking2.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class bdMatchMaking2 final : public service
|
||||
{
|
||||
public:
|
||||
bdMatchMaking2();
|
||||
|
||||
private:
|
||||
void unk1(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk2(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk3(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk5(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk16(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
27
src/client/game/demonware/services/bdPresence.cpp
Normal file
27
src/client/game/demonware/services/bdPresence.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
bdPresence::bdPresence() : service(103, "bdPresence")
|
||||
{
|
||||
this->register_task(1, "unk1", &bdPresence::unk1);
|
||||
this->register_task(3, "unk3", &bdPresence::unk3);
|
||||
}
|
||||
|
||||
void bdPresence::unk1(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdPresence::unk3(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
16
src/client/game/demonware/services/bdPresence.hpp
Normal file
16
src/client/game/demonware/services/bdPresence.hpp
Normal file
@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class bdPresence final : public service
|
||||
{
|
||||
public:
|
||||
bdPresence();
|
||||
|
||||
private:
|
||||
void unk1(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk3(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
19
src/client/game/demonware/services/bdProfiles.cpp
Normal file
19
src/client/game/demonware/services/bdProfiles.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
bdProfiles::bdProfiles() : service(8, "bdProfiles")
|
||||
{
|
||||
this->register_task(3, "unk3", &bdProfiles::unk3);
|
||||
}
|
||||
|
||||
void bdProfiles::unk3(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
15
src/client/game/demonware/services/bdProfiles.hpp
Normal file
15
src/client/game/demonware/services/bdProfiles.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class bdProfiles final : public service
|
||||
{
|
||||
public:
|
||||
bdProfiles();
|
||||
|
||||
private:
|
||||
void unk3(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
@ -1,136 +0,0 @@
|
||||
#include <std_include.hpp>
|
||||
#include "bdRelayService.hpp"
|
||||
#include "../data_types.hpp"
|
||||
#include "steam/steam.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class DebugObjectUCD : public i_serializable
|
||||
{
|
||||
public:
|
||||
uint64_t user_id;
|
||||
std::string platform;
|
||||
std::vector<uint64_t> user_ids;
|
||||
std::vector<std::string> user_files;
|
||||
|
||||
void serialize(byte_buffer* buffer) override
|
||||
{
|
||||
buffer->write_uint64(this->user_id);
|
||||
buffer->write_string(this->platform);
|
||||
|
||||
buffer->write_array_header(10, INT(this->user_ids.size()), sizeof(uint64_t));
|
||||
buffer->set_use_data_types(false);
|
||||
for (size_t i = 0; i < this->user_ids.size(); i++)
|
||||
{
|
||||
buffer->write_uint64(this->user_ids[i]);
|
||||
}
|
||||
buffer->set_use_data_types(true);
|
||||
|
||||
auto stringSize = this->user_files.size();
|
||||
for (size_t i = 0; i < this->user_files.size(); i++)
|
||||
{
|
||||
stringSize += this->user_files[i].length();
|
||||
}
|
||||
|
||||
buffer->write_array_header(16, INT(this->user_files.size()), INT(stringSize / this->user_files.size()));
|
||||
|
||||
buffer->set_use_data_types(false);
|
||||
for (size_t i = 0; i < this->user_files.size(); i++)
|
||||
{
|
||||
buffer->write_string(this->user_files[i]);
|
||||
}
|
||||
buffer->set_use_data_types(true);
|
||||
}
|
||||
|
||||
void deserialize(byte_buffer* /*buffer*/) override
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class DebugObjectUNO : public i_serializable
|
||||
{
|
||||
public:
|
||||
std::vector<uint64_t> user_ids;
|
||||
std::vector<std::string> user_files;
|
||||
|
||||
void serialize(byte_buffer* buffer) override
|
||||
{
|
||||
buffer->write_array_header(10, INT(this->user_ids.size()), sizeof(uint64_t));
|
||||
|
||||
buffer->set_use_data_types(false);
|
||||
for (size_t i = 0; i < this->user_ids.size(); i++)
|
||||
{
|
||||
buffer->write_uint64(this->user_ids[i]);
|
||||
}
|
||||
buffer->set_use_data_types(true);
|
||||
|
||||
auto stringSize = this->user_files.size();
|
||||
for (size_t i = 0; i < this->user_files.size(); i++)
|
||||
{
|
||||
stringSize += this->user_files[i].length();
|
||||
}
|
||||
|
||||
buffer->write_array_header(16, INT(this->user_files.size()), INT(stringSize / this->user_files.size()));
|
||||
|
||||
buffer->set_use_data_types(false);
|
||||
for (size_t i = 0; i < this->user_files.size(); i++)
|
||||
{
|
||||
buffer->write_string(this->user_files[i]);
|
||||
}
|
||||
buffer->set_use_data_types(true);
|
||||
}
|
||||
|
||||
void deserialize(byte_buffer* /*buffer*/) override
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
bdRelayService::bdRelayService()
|
||||
{
|
||||
this->register_service(3, &bdRelayService::get_credentials);
|
||||
this->register_service(4, &bdRelayService::get_credentials_from_ticket);
|
||||
}
|
||||
|
||||
void bdRelayService::get_credentials(i_server* server, byte_buffer* buffer) const
|
||||
{
|
||||
uint32_t unk1;
|
||||
uint64_t user_id;
|
||||
std::string platform;
|
||||
|
||||
// User info.
|
||||
buffer->read_uint32(&unk1);
|
||||
buffer->read_uint64(&user_id);
|
||||
buffer->read_string(&platform);
|
||||
|
||||
auto* result = new DebugObjectUCD;
|
||||
result->user_id = steam::SteamUser()->GetSteamID().bits;
|
||||
result->user_ids.push_back(steam::SteamUser()->GetSteamID().bits);
|
||||
result->user_ids.push_back(0x00659CD6);
|
||||
result->user_files.push_back("pc");
|
||||
result->user_files.push_back("ucd");
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->add(result);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdRelayService::get_credentials_from_ticket(i_server* server, byte_buffer* buffer) const
|
||||
{
|
||||
std::string ticket;
|
||||
buffer->read_string(&ticket);
|
||||
|
||||
auto* result = new DebugObjectUNO;
|
||||
|
||||
// Create fake info.
|
||||
result->user_ids.push_back(0x1A586A45744DA396);
|
||||
result->user_ids.push_back(steam::SteamUser()->GetSteamID().bits);
|
||||
result->user_ids.push_back(16326195462233142067);
|
||||
result->user_files.push_back("youtube");
|
||||
result->user_files.push_back("steam");
|
||||
result->user_files.push_back("uno");
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->add(result);
|
||||
reply->send();
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../i_service.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class bdRelayService final : public i_generic_service<86>
|
||||
{
|
||||
public:
|
||||
bdRelayService();
|
||||
|
||||
private:
|
||||
void get_credentials(i_server* server, byte_buffer* buffer) const;
|
||||
void get_credentials_from_ticket(i_server* server, byte_buffer* buffer) const;
|
||||
};
|
||||
}
|
27
src/client/game/demonware/services/bdRichPresence.cpp
Normal file
27
src/client/game/demonware/services/bdRichPresence.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
bdRichPresence::bdRichPresence() : service(68, "bdRichPresence")
|
||||
{
|
||||
this->register_task(1, "unk1", &bdRichPresence::unk1);
|
||||
this->register_task(2, "unk2", &bdRichPresence::unk2);
|
||||
}
|
||||
|
||||
void bdRichPresence::unk1(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdRichPresence::unk2(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
16
src/client/game/demonware/services/bdRichPresence.hpp
Normal file
16
src/client/game/demonware/services/bdRichPresence.hpp
Normal file
@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class bdRichPresence final : public service
|
||||
{
|
||||
public:
|
||||
bdRichPresence();
|
||||
|
||||
private:
|
||||
void unk1(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk2(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
51
src/client/game/demonware/services/bdStats.cpp
Normal file
51
src/client/game/demonware/services/bdStats.cpp
Normal file
@ -0,0 +1,51 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
bdStats::bdStats() : service(4, "bdStats")
|
||||
{
|
||||
this->register_task(1, "unk1", &bdStats::unk1);
|
||||
this->register_task(3, "unk3", &bdStats::unk3); // leaderboards
|
||||
this->register_task(4, "unk4", &bdStats::unk4);
|
||||
this->register_task(8, "unk8", &bdStats::unk8);
|
||||
this->register_task(11, "unk11", &bdStats::unk11);
|
||||
}
|
||||
|
||||
void bdStats::unk1(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdStats::unk3(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdStats::unk4(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdStats::unk8(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdStats::unk11(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
19
src/client/game/demonware/services/bdStats.hpp
Normal file
19
src/client/game/demonware/services/bdStats.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class bdStats final : public service
|
||||
{
|
||||
public:
|
||||
bdStats();
|
||||
|
||||
private:
|
||||
void unk1(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk3(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk4(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk8(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk11(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
#include <std_include.hpp>
|
||||
#include "bdSteamAuth.hpp"
|
||||
|
||||
#include "game/structs.hpp"
|
||||
#include "steam/steam.hpp"
|
||||
|
||||
#include <utils/cryptography.hpp>
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
void bdSteamAuth::call_service(i_server* server, const std::string& data)
|
||||
{
|
||||
bit_buffer buffer(data);
|
||||
|
||||
bool more_data;
|
||||
buffer.set_use_data_types(false);
|
||||
buffer.read_bool(&more_data);
|
||||
buffer.set_use_data_types(true);
|
||||
|
||||
uint32_t seed, title_id, ticket_size;
|
||||
buffer.read_uint32(&seed);
|
||||
buffer.read_uint32(&title_id);
|
||||
buffer.read_uint32(&ticket_size);
|
||||
|
||||
uint8_t ticket[1024];
|
||||
buffer.read_bytes(std::min(ticket_size, static_cast<uint32_t>(sizeof(ticket))), ticket);
|
||||
|
||||
game::bdAuthTicket auth_ticket{};
|
||||
std::memset(&auth_ticket, 0xA, sizeof auth_ticket);
|
||||
|
||||
auth_ticket.m_magicNumber = 0x0EFBDADDE;
|
||||
auth_ticket.m_type = 0;
|
||||
auth_ticket.m_titleID = title_id;
|
||||
auth_ticket.m_userID = steam::SteamUser()->GetSteamID().bits;
|
||||
|
||||
auto key = utils::cryptography::tiger::compute("S1MOD");
|
||||
|
||||
strcpy_s(auth_ticket.m_username, "S1MOD User");
|
||||
std::memcpy(auth_ticket.m_sessionKey, key.data(), 24);
|
||||
auth_ticket.m_timeIssued = static_cast<uint32_t>(time(nullptr));
|
||||
|
||||
uint8_t lsg_ticket[128];
|
||||
ZeroMemory(&lsg_ticket, sizeof lsg_ticket);
|
||||
std::memcpy(lsg_ticket, key.data(), 24);
|
||||
|
||||
const auto iv = utils::cryptography::tiger::compute(std::string(reinterpret_cast<char*>(&seed), 4));
|
||||
|
||||
const std::string enc_key(reinterpret_cast<char*>(&ticket[32]), 24);
|
||||
auto enc_ticket = utils::cryptography::des3::encrypt(
|
||||
std::string(reinterpret_cast<char*>(&auth_ticket), sizeof(auth_ticket)), iv, enc_key);
|
||||
|
||||
bit_buffer response;
|
||||
response.set_use_data_types(false);
|
||||
response.write_bool(false);
|
||||
response.write_uint32(700);
|
||||
response.write_uint32(seed);
|
||||
response.write_bytes(enc_ticket.size(), enc_ticket.data());
|
||||
response.write_bytes(sizeof(lsg_ticket), lsg_ticket);
|
||||
|
||||
auto reply = server->create_message(29);
|
||||
reply->send(&response, false);
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
#pragma once
|
||||
#include "../i_service.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class bdSteamAuth final : public i_generic_service<28>
|
||||
{
|
||||
public:
|
||||
void call_service(i_server* server, const std::string& data) override;
|
||||
};
|
||||
}
|
@ -1,324 +1,178 @@
|
||||
#include <std_include.hpp>
|
||||
#include "bdStorage.hpp"
|
||||
|
||||
#include "../data_types.hpp"
|
||||
|
||||
#include <utils/compression.hpp>
|
||||
#include <utils/cryptography.hpp>
|
||||
#include <utils/nt.hpp>
|
||||
#include <utils/io.hpp>
|
||||
#include <utils/string.hpp>
|
||||
#include "../demonware.hpp"
|
||||
#include "utils/nt.hpp"
|
||||
#include "utils/io.hpp"
|
||||
#include "game/game.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
bdStorage::bdStorage()
|
||||
{
|
||||
this->register_service(1, &bdStorage::set_legacy_user_file);
|
||||
this->register_service(3, &bdStorage::get_legacy_user_file);
|
||||
this->register_service(5, &bdStorage::list_legacy_user_files);
|
||||
this->register_service(6, &bdStorage::list_publisher_files);
|
||||
this->register_service(7, &bdStorage::get_publisher_file);
|
||||
this->register_service(8, &bdStorage::update_legacy_user_file);
|
||||
this->register_service(10, &bdStorage::set_user_file);
|
||||
this->register_service(11, &bdStorage::delete_user_file);
|
||||
this->register_service(12, &bdStorage::get_user_file);
|
||||
bdStorage::bdStorage() : service(10, "bdStorage")
|
||||
{
|
||||
this->register_task(6, "list publisher files", &bdStorage::list_publisher_files);
|
||||
this->register_task(7, "get publisher file", &bdStorage::get_publisher_file);
|
||||
this->register_task(10, "set user file", &bdStorage::set_user_file);
|
||||
this->register_task(12, "get user file", &bdStorage::get_user_file);
|
||||
this->register_task(13, "unk13", &bdStorage::unk13);
|
||||
|
||||
this->map_publisher_resource("motd-.*\\.txt", DW_MOTD);
|
||||
this->map_publisher_resource("mm\\.cfg", DW_MM_CONFIG);
|
||||
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("entitlement_config_[Tt][Uu][0-9]+\\.info", DW_ENTITLEMENT_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_[Tt][Uu][0-9]+\\.info", DW_ENTITLEMENT_CONFIG);
|
||||
this->map_publisher_resource("codPointStoreConfig_[Tt][Uu][0-9]+\\.csv", DW_CODPOINTS_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);
|
||||
}
|
||||
|
||||
publisher_resources_.emplace_back(std::regex{"heatmap\\.raw"}, generate_heatmap());
|
||||
}
|
||||
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);
|
||||
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("[demonware]: [bdStorage]: missing publisher file: %s\n", name.data());
|
||||
#endif
|
||||
|
||||
printf("DW: Missing publisher file: %s\n", name.data());
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
void bdStorage::list_publisher_files(service_server* server, uint8_t type, byte_buffer* buffer)
|
||||
{
|
||||
uint32_t date;
|
||||
uint16_t num_results, offset;
|
||||
std::string filename, data;
|
||||
|
||||
std::string bdStorage::get_user_file_path(const std::string& name)
|
||||
{
|
||||
return "players2/user/" + name;
|
||||
}
|
||||
buffer->read_uint32(&date);
|
||||
buffer->read_uint16(&num_results);
|
||||
buffer->read_uint16(&offset);
|
||||
buffer->read_string(&filename);
|
||||
|
||||
std::string bdStorage::generate_heatmap()
|
||||
{
|
||||
uint8_t map[256][256];
|
||||
auto reply = server->create_reply(type);
|
||||
|
||||
for (auto y = 0; y < 256; ++y)
|
||||
{
|
||||
for (auto x = 0; x < 256; ++x)
|
||||
{
|
||||
auto data = uint8_t(rand());
|
||||
if (data % 15 == 0)
|
||||
{
|
||||
data = 0xF | ((data & 0x7) << 4) | 0x10;
|
||||
}
|
||||
else
|
||||
{
|
||||
data = 0;
|
||||
}
|
||||
if (this->load_publisher_resource(filename, data))
|
||||
{
|
||||
auto* info = new bdFileInfo;
|
||||
|
||||
map[y][x] = data;
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
return utils::compression::zlib::compress(std::string(LPSTR(map), sizeof map));
|
||||
}
|
||||
reply->add(info);
|
||||
}
|
||||
|
||||
void bdStorage::set_legacy_user_file(i_server* server, byte_buffer* buffer) const
|
||||
{
|
||||
bool priv;
|
||||
std::string filename, data;
|
||||
reply->send();
|
||||
}
|
||||
|
||||
buffer->read_string(&filename);
|
||||
buffer->read_bool(&priv);
|
||||
buffer->read_blob(&data);
|
||||
void bdStorage::get_publisher_file(service_server* server, uint8_t type, byte_buffer* buffer)
|
||||
{
|
||||
std::string filename;
|
||||
buffer->read_string(&filename);
|
||||
|
||||
const auto id = *reinterpret_cast<const uint64_t*>(utils::cryptography::sha1::compute(filename).data());
|
||||
std::string id_string = utils::string::va("%llX", id);
|
||||
#ifdef DEBUG
|
||||
printf("[demonware]: [bdStorage]: loading publisher file: %s\n", filename.data());
|
||||
#endif
|
||||
|
||||
printf("DW: Storing user file '%s' as %s\n", filename.data(), id_string.data());
|
||||
std::string data;
|
||||
|
||||
const auto path = get_user_file_path(id_string);
|
||||
utils::io::write_file(path, data);
|
||||
if (this->load_publisher_resource(filename, data))
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("[demonware]: [bdStorage]: sending publisher file: %s, size: %lld\n", filename.data(), data.size());
|
||||
#endif
|
||||
|
||||
auto* info = new bdFileInfo;
|
||||
auto reply = server->create_reply(type);
|
||||
reply->add(new bdFileData(data));
|
||||
reply->send();
|
||||
}
|
||||
else
|
||||
{
|
||||
server->create_reply(type, game::BD_NO_FILE)->send();
|
||||
}
|
||||
}
|
||||
|
||||
info->file_id = id;
|
||||
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 = 0;
|
||||
info->priv = priv;
|
||||
std::string bdStorage::get_user_file_path(const std::string& name)
|
||||
{
|
||||
return "players2/user/" + name;
|
||||
}
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->add(info);
|
||||
reply->send();
|
||||
}
|
||||
void bdStorage::set_user_file(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
bool priv;
|
||||
uint64_t owner;
|
||||
std::string game, filename, data;
|
||||
|
||||
void bdStorage::update_legacy_user_file(i_server* server, byte_buffer* buffer) const
|
||||
{
|
||||
uint64_t id;
|
||||
std::string data;
|
||||
buffer->read_string(&game);
|
||||
buffer->read_string(&filename);
|
||||
buffer->read_bool(&priv);
|
||||
buffer->read_blob(&data);
|
||||
buffer->read_uint64(&owner);
|
||||
|
||||
buffer->read_uint64(&id);
|
||||
buffer->read_blob(&data);
|
||||
const auto path = get_user_file_path(filename);
|
||||
utils::io::write_file(path, data);
|
||||
|
||||
std::string id_string = utils::string::va("%llX", id);
|
||||
auto* info = new bdFileInfo;
|
||||
|
||||
printf("DW: Updating user file %s\n", id_string.data());
|
||||
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;
|
||||
|
||||
const auto path = get_user_file_path(id_string);
|
||||
utils::io::write_file(path, data);
|
||||
auto reply = server->create_reply(type);
|
||||
reply->add(info);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
auto* info = new bdFileInfo;
|
||||
void bdStorage::get_user_file(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
uint64_t owner{};
|
||||
std::string game, filename, platform, data;
|
||||
|
||||
info->file_id = id;
|
||||
info->filename = "<>";
|
||||
info->create_time = uint32_t(time(nullptr));
|
||||
info->modified_time = info->create_time;
|
||||
info->file_size = uint32_t(data.size());
|
||||
info->owner_id = 0;
|
||||
info->priv = false;
|
||||
buffer->read_string(&game);
|
||||
buffer->read_string(&filename);
|
||||
buffer->read_uint64(&owner);
|
||||
buffer->read_string(&platform);
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->add(info);
|
||||
reply->send();
|
||||
}
|
||||
#ifdef DEBUG
|
||||
printf("[demonware]: [bdStorage]: user file: %s, %s, %s\n", game.data(), filename.data(), platform.data());
|
||||
#endif
|
||||
|
||||
void bdStorage::get_legacy_user_file(i_server* server, byte_buffer* buffer) const
|
||||
{
|
||||
std::string filename, data;
|
||||
buffer->read_string(&filename);
|
||||
const auto path = get_user_file_path(filename);
|
||||
if (utils::io::read_file(path, &data))
|
||||
{
|
||||
auto reply = server->create_reply(type);
|
||||
reply->add(new bdFileData(data));
|
||||
reply->send();
|
||||
}
|
||||
else
|
||||
{
|
||||
server->create_reply(type, game::BD_NO_FILE)->send();
|
||||
}
|
||||
}
|
||||
|
||||
const auto id = *reinterpret_cast<const uint64_t*>(utils::cryptography::sha1::compute(filename).data());
|
||||
std::string id_string = utils::string::va("%llX", id);
|
||||
|
||||
printf("DW: Loading user file: %s (%s)\n", filename.data(), id_string.data());
|
||||
|
||||
const auto path = get_user_file_path(id_string);
|
||||
if (utils::io::read_file(path, &data))
|
||||
{
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->add(new bdFileData(data));
|
||||
reply->send();
|
||||
}
|
||||
else
|
||||
{
|
||||
server->create_reply(this->get_sub_type(), game::BD_NO_FILE)->send();
|
||||
}
|
||||
}
|
||||
|
||||
void bdStorage::list_legacy_user_files(i_server* server, byte_buffer* buffer) const
|
||||
{
|
||||
uint64_t unk;
|
||||
uint32_t date;
|
||||
uint16_t num_results, offset;
|
||||
std::string filename, data;
|
||||
|
||||
buffer->read_uint64(&unk);
|
||||
buffer->read_uint32(&date);
|
||||
buffer->read_uint16(&num_results);
|
||||
buffer->read_uint16(&offset);
|
||||
buffer->read_string(&filename);
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
|
||||
const auto path = get_user_file_path(filename);
|
||||
if (utils::io::read_file(path, &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;
|
||||
|
||||
reply->add(info);
|
||||
}
|
||||
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdStorage::list_publisher_files(i_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);
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
|
||||
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;
|
||||
|
||||
reply->add(info);
|
||||
}
|
||||
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdStorage::get_publisher_file(i_server* server, byte_buffer* buffer)
|
||||
{
|
||||
std::string filename;
|
||||
buffer->read_string(&filename);
|
||||
|
||||
printf("DW: Loading publisher file: %s\n", filename.data());
|
||||
|
||||
std::string data;
|
||||
if (this->load_publisher_resource(filename, data))
|
||||
{
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->add(new bdFileData(data));
|
||||
reply->send();
|
||||
}
|
||||
else
|
||||
{
|
||||
server->create_reply(this->get_sub_type(), game::BD_NO_FILE)->send();
|
||||
}
|
||||
}
|
||||
|
||||
void bdStorage::delete_user_file(i_server* server, byte_buffer* buffer) const
|
||||
{
|
||||
uint64_t owner;
|
||||
std::string game, filename;
|
||||
|
||||
buffer->read_string(&game);
|
||||
buffer->read_string(&filename);
|
||||
buffer->read_uint64(&owner);
|
||||
|
||||
// Really remove the file?
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdStorage::set_user_file(i_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);
|
||||
|
||||
const auto path = get_user_file_path(filename);
|
||||
utils::io::write_file(path, 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 = 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->get_sub_type());
|
||||
reply->add(info);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdStorage::get_user_file(i_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);
|
||||
|
||||
const auto path = get_user_file_path(filename);
|
||||
if (utils::io::read_file(path, &data))
|
||||
{
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
reply->add(new bdFileData(data));
|
||||
reply->send();
|
||||
}
|
||||
else
|
||||
{
|
||||
server->create_reply(this->get_sub_type(), game::BD_NO_FILE)->send();
|
||||
}
|
||||
}
|
||||
}
|
||||
void bdStorage::unk13(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
} // namespace demonware
|
||||
|
@ -1,30 +1,26 @@
|
||||
#pragma once
|
||||
#include "../i_service.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class bdStorage final : public i_generic_service<10>
|
||||
{
|
||||
public:
|
||||
bdStorage();
|
||||
|
||||
private:
|
||||
std::vector<std::pair<std::regex, std::string>> publisher_resources_;
|
||||
class bdStorage final : public service
|
||||
{
|
||||
public:
|
||||
bdStorage();
|
||||
|
||||
void set_legacy_user_file(i_server* server, byte_buffer* buffer) const;
|
||||
void update_legacy_user_file(i_server* server, byte_buffer* buffer) const;
|
||||
void get_legacy_user_file(i_server* server, byte_buffer* buffer) const;
|
||||
void list_legacy_user_files(i_server* server, byte_buffer* buffer) const;
|
||||
void list_publisher_files(i_server* server, byte_buffer* buffer);
|
||||
void get_publisher_file(i_server* server, byte_buffer* buffer);
|
||||
void delete_user_file(i_server* server, byte_buffer* buffer) const;
|
||||
void set_user_file(i_server* server, byte_buffer* buffer) const;
|
||||
void get_user_file(i_server* server, byte_buffer* buffer) const;
|
||||
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);
|
||||
|
||||
static std::string get_user_file_path(const std::string& name);
|
||||
static std::string generate_heatmap();
|
||||
};
|
||||
}
|
||||
void list_publisher_files(service_server* server, uint8_t type, byte_buffer* buffer);
|
||||
void get_publisher_file(service_server* server, uint8_t type, byte_buffer* buffer);
|
||||
void set_user_file(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void get_user_file(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk13(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
|
||||
static std::string get_user_file_path(const std::string& name);
|
||||
};
|
||||
|
||||
} // namespace demonware
|
||||
|
@ -1,20 +1,19 @@
|
||||
#include <std_include.hpp>
|
||||
#include "bdTitleUtilities.hpp"
|
||||
#include "../data_types.hpp"
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
bdTitleUtilities::bdTitleUtilities()
|
||||
bdTitleUtilities::bdTitleUtilities() : service(12, "bdTitleUtilities")
|
||||
{
|
||||
this->register_service(6, &bdTitleUtilities::get_server_time);
|
||||
this->register_task(6, "get server time", &bdTitleUtilities::get_server_time);
|
||||
}
|
||||
|
||||
void bdTitleUtilities::get_server_time(i_server* server, byte_buffer* /*buffer*/) const
|
||||
void bdTitleUtilities::get_server_time(service_server* server, uint8_t type, byte_buffer* /*buffer*/) const
|
||||
{
|
||||
const auto time_result = new bdTimeStamp;
|
||||
time_result->unix_time = uint32_t(time(nullptr));
|
||||
|
||||
auto reply = server->create_reply(this->get_sub_type());
|
||||
auto reply = server->create_reply(type);
|
||||
reply->add(time_result);
|
||||
reply->send();
|
||||
}
|
||||
|
@ -1,14 +1,13 @@
|
||||
#pragma once
|
||||
#include "../i_service.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class bdTitleUtilities final : public i_generic_service<12>
|
||||
class bdTitleUtilities final : public service
|
||||
{
|
||||
public:
|
||||
bdTitleUtilities();
|
||||
|
||||
private:
|
||||
void get_server_time(i_server* server, byte_buffer* buffer) const;
|
||||
void get_server_time(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
}
|
||||
|
19
src/client/game/demonware/services/bdUNK104.cpp
Normal file
19
src/client/game/demonware/services/bdUNK104.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
bdUNK104::bdUNK104() : service(104, "bdUNK104")
|
||||
{
|
||||
this->register_task(1, "unk1", &bdUNK104::unk1);
|
||||
}
|
||||
|
||||
void bdUNK104::unk1(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
15
src/client/game/demonware/services/bdUNK104.hpp
Normal file
15
src/client/game/demonware/services/bdUNK104.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class bdUNK104 final : public service
|
||||
{
|
||||
public:
|
||||
bdUNK104();
|
||||
|
||||
private:
|
||||
void unk1(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
19
src/client/game/demonware/services/bdUNK63.cpp
Normal file
19
src/client/game/demonware/services/bdUNK63.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
bdUNK63::bdUNK63() : service(63, "bdUNK63")
|
||||
{
|
||||
//this->register_task(6, "unk6", &bdUNK63::unk6);
|
||||
}
|
||||
|
||||
void bdUNK63::unk(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
15
src/client/game/demonware/services/bdUNK63.hpp
Normal file
15
src/client/game/demonware/services/bdUNK63.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class bdUNK63 final : public service
|
||||
{
|
||||
public:
|
||||
bdUNK63();
|
||||
|
||||
private:
|
||||
void unk(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
59
src/client/game/demonware/services/bdUNK80.cpp
Normal file
59
src/client/game/demonware/services/bdUNK80.cpp
Normal file
@ -0,0 +1,59 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../demonware.hpp"
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
bdUNK80::bdUNK80() : service(80, "bdUNK80")
|
||||
{
|
||||
this->register_task(42, "unk42", &bdUNK80::unk42);
|
||||
this->register_task(49, "unk49", &bdUNK80::unk49);
|
||||
this->register_task(60, "unk60", &bdUNK80::unk60);
|
||||
this->register_task(130, "unk130", &bdUNK80::unk130);
|
||||
this->register_task(165, "unk165", &bdUNK80::unk165);
|
||||
this->register_task(193, "unk193", &bdUNK80::unk193);
|
||||
}
|
||||
|
||||
void bdUNK80::unk42(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdUNK80::unk49(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdUNK80::unk60(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdUNK80::unk130(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdUNK80::unk165(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdUNK80::unk193(service_server* server, uint8_t type, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(type);
|
||||
reply->send();
|
||||
}
|
||||
|
||||
}
|
20
src/client/game/demonware/services/bdUNK80.hpp
Normal file
20
src/client/game/demonware/services/bdUNK80.hpp
Normal file
@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
|
||||
class bdUNK80 final : public service
|
||||
{
|
||||
public:
|
||||
bdUNK80();
|
||||
|
||||
private:
|
||||
void unk42(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk49(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk60(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk130(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk165(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
void unk193(service_server* server, uint8_t type, byte_buffer* buffer) const;
|
||||
};
|
||||
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
#include <std_include.hpp>
|
||||
#include <utility>
|
||||
|
||||
#include "component/demonware.hpp"
|
||||
#include "game/demonware/stun_server.hpp"
|
||||
#include "byte_buffer.hpp"
|
||||
|
||||
#include <utils/cryptography.hpp>
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
stun_server::stun_server(std::string _name) : name_(std::move(_name))
|
||||
{
|
||||
this->address_ = utils::cryptography::jenkins_one_at_a_time::compute(this->name_);
|
||||
}
|
||||
|
||||
unsigned long stun_server::get_address() const
|
||||
{
|
||||
return this->address_;
|
||||
}
|
||||
|
||||
void stun_server::ip_discovery(SOCKET s, const sockaddr* to, const int tolen) const
|
||||
{
|
||||
const uint32_t ip = 0x0100007f;
|
||||
|
||||
byte_buffer buffer;
|
||||
buffer.set_use_data_types(false);
|
||||
buffer.write_byte(31); // type
|
||||
buffer.write_byte(2); // version
|
||||
buffer.write_byte(0); // version
|
||||
buffer.write_uint32(ip); // external ip
|
||||
buffer.write_uint16(3074); // port
|
||||
|
||||
send_datagram_packet(s, buffer.get_buffer(), to, tolen);
|
||||
}
|
||||
|
||||
void stun_server::nat_discovery(SOCKET s, const sockaddr* to, const int tolen) const
|
||||
{
|
||||
const uint32_t ip = 0x0100007f;
|
||||
|
||||
byte_buffer buffer;
|
||||
buffer.set_use_data_types(false);
|
||||
buffer.write_byte(21); // type
|
||||
buffer.write_byte(2); // version
|
||||
buffer.write_byte(0); // version
|
||||
buffer.write_uint32(ip); // external ip
|
||||
buffer.write_uint16(3074); // port
|
||||
buffer.write_uint32(this->get_address()); // server ip
|
||||
buffer.write_uint16(3074); // server port
|
||||
|
||||
send_datagram_packet(s, buffer.get_buffer(), to, tolen);
|
||||
}
|
||||
|
||||
int stun_server::send(const SOCKET s, const char* buf, const int len, const sockaddr* to, const int tolen) const
|
||||
{
|
||||
uint8_t type, version, padding;
|
||||
|
||||
byte_buffer buffer(std::string(buf, len));
|
||||
buffer.set_use_data_types(false);
|
||||
buffer.read_byte(&type);
|
||||
buffer.read_byte(&version);
|
||||
buffer.read_byte(&padding);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case 30:
|
||||
this->ip_discovery(s, to, tolen);
|
||||
break;
|
||||
case 20:
|
||||
this->nat_discovery(s, to, tolen);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace demonware
|
||||
{
|
||||
class stun_server final
|
||||
{
|
||||
public:
|
||||
explicit stun_server(std::string name);
|
||||
|
||||
unsigned long get_address() const;
|
||||
|
||||
int send(SOCKET s, const char* buf, int len, const sockaddr* to, int tolen) const;
|
||||
|
||||
private:
|
||||
std::string name_;
|
||||
unsigned long address_;
|
||||
|
||||
void ip_discovery(SOCKET s, const sockaddr* to, int tolen) const;
|
||||
void nat_discovery(SOCKET s, const sockaddr* to, int tolen) const;
|
||||
};
|
||||
}
|
@ -8,12 +8,16 @@
|
||||
#define DW_ENTITLEMENT_CONFIG 302
|
||||
#define DW_SOCIAL_CONFIG 303
|
||||
#define DW_MM_CONFIG 304
|
||||
#define DW_MOTD 305
|
||||
#define DW_PLAYLISTS 306
|
||||
#define DW_CODPOINTS_CONFIG 305
|
||||
#define DW_LOOT_CONFIG 306
|
||||
#define DW_STORE_CONFIG 307
|
||||
#define DW_MOTD 308
|
||||
#define DW_FASTFILE 309
|
||||
#define DW_PLAYLISTS 310
|
||||
|
||||
#define MENU_MAIN 307
|
||||
#define MENU_MAIN 311
|
||||
|
||||
#define TLS_DLL 308
|
||||
#define RUNNER 309
|
||||
#define TLS_DLL 312
|
||||
#define RUNNER 313
|
||||
|
||||
#define ICON_IMAGE 310
|
||||
#define ICON_IMAGE 314
|
||||
|
@ -101,6 +101,9 @@ IMAGE_LOGO BITMAP "resources/logo.bmp"
|
||||
DW_ENTITLEMENT_CONFIG RCDATA "resources/dw/entitlement_config.info"
|
||||
DW_SOCIAL_CONFIG RCDATA "resources/dw/social_tu22.cfg"
|
||||
DW_MM_CONFIG RCDATA "resources/dw/mm.cfg"
|
||||
DW_CODPOINTS_CONFIG RCDATA "resources/dw/codPointStoreConfig_tu19.csv"
|
||||
DW_LOOT_CONFIG RCDATA "resources/dw/lootConfig_tu19.csv"
|
||||
DW_STORE_CONFIG RCDATA "resources/dw/winStoreConfig_tu19.csv"
|
||||
DW_MOTD RCDATA "resources/dw/motd-english.txt"
|
||||
DW_PLAYLISTS RCDATA "resources/dw/playlists_tu22.aggr"
|
||||
|
||||
|
30
src/client/resources/dw/codPointStoreConfig_tu19.csv
Normal file
30
src/client/resources/dw/codPointStoreConfig_tu19.csv
Normal file
@ -0,0 +1,30 @@
|
||||
# ----------- COD POINT STORE CONFIG -----------
|
||||
|
||||
# visibililty
|
||||
# 0 - Show
|
||||
# 1 - Hide
|
||||
# 2 - Coming Soon
|
||||
|
||||
#type=version
|
||||
version,3
|
||||
|
||||
#type=category,#key,#category_id,#title,#visibility
|
||||
category,SUPDRP,1,CODPOINT_CAT_A,0
|
||||
category,WEEKLY,2,CODPOINT_CAT_B,2
|
||||
category,COMSOON,3,CODPOINT_CAT_C,2
|
||||
|
||||
|
||||
#type=product,#key,#sku_id,#category_id,#title,#description,#image,#visibility,#displayAsFirstGuid
|
||||
product,SSD,0x40000002,1,CODPOINT_PROD_SD,CODPOINT_PROD_DESC_SD,s1_supply_drop,0,1
|
||||
product,CSD,0x40000001,1,CODPOINT_PROD_ASD,CODPOINT_PROD_DESC_ASD,s1_supply_drop_mtx_1,0,0
|
||||
product,CSD3,0x40000004,1,CODPOINT_PROD_ASD3,CODPOINT_PROD_DESC_ASD3,s1_supply_drop_mtx_3,0,0
|
||||
product,BAL8,0x40000003,1,CODPOINT_FEATURED_ITEM,CODPOINT_FEATURED_ITEM_DESC,,0,1
|
||||
|
||||
|
||||
# IGS Products to advertise when the player has insufficient funds
|
||||
#type=igsproduct,#productId
|
||||
igsproduct,supdrp46
|
||||
igsproduct,supdrp50
|
||||
igsproduct,supdrp47
|
||||
igsproduct,supdrp48
|
||||
igsproduct,supdrp71
|
|
BIN
src/client/resources/dw/ffotd-1.22.1.ff
Normal file
BIN
src/client/resources/dw/ffotd-1.22.1.ff
Normal file
Binary file not shown.
1046
src/client/resources/dw/lootConfig_tu19.csv
Normal file
1046
src/client/resources/dw/lootConfig_tu19.csv
Normal file
File diff suppressed because it is too large
Load Diff
207
src/client/resources/dw/winStoreConfig_tu19.csv
Normal file
207
src/client/resources/dw/winStoreConfig_tu19.csv
Normal file
@ -0,0 +1,207 @@
|
||||
#Game Language to offerids mapping
|
||||
#english,EN
|
||||
#french,FR
|
||||
#frenchcan,FR
|
||||
#german,DE-LV
|
||||
#austrian,DE-FV
|
||||
#italian,IT
|
||||
#spanish,ES
|
||||
#british,EN
|
||||
#russian,RU
|
||||
#polish,PL
|
||||
#korean,EN
|
||||
#japanese,EN-JA
|
||||
#fulljap,JA
|
||||
|
||||
#visibility refer to igsProductVisibility_e
|
||||
# 0 - Visible Always
|
||||
# 1 - Hide Always ( Hide in store and in Front End )
|
||||
# 2 - Visible for season pass holders ( Hide in store if player does not own season pass )
|
||||
# 3 - Visible for non season pass holders ( Hide in store if player owns season pass )
|
||||
# 4 - Hide in CAC / CAO ( Show in Store,Hide in Front End )
|
||||
# 5 - Early Access ( Hide in the store,Show in Front End )
|
||||
|
||||
version,version_id,10
|
||||
|
||||
#type = product,UID,Product ID,Image Name,dlcName,category,#Language List separated by space delimiter,#visibility,#productgroup,#seenIndex,#name
|
||||
product,product_1,317660,img_store_season_pass,seasonpass,seasonpass,all,0,,,# Season Pass
|
||||
|
||||
product,product_2,318791,img_store_mappacks_havok,dlc2,mappacks,all,0,,,# Havoc
|
||||
product,product_3,318792,img_store_mappacks_ascendance,dlc3,mappacks,all,0,,32,# Ascendance
|
||||
product,product_4,318793,img_store_mappacks_supremacy,dlc4,mappacks,all,0,,,# Supremacy
|
||||
product,product_5,318794,img_store_mappacks_havok,dlc5,mappacks,all,0,,,# Reckoning
|
||||
|
||||
# MDLC 2.5 - Standard Packs
|
||||
product,product_137,343596,img_store_personpacks_ice,mdlc62,personpacks,all,0,,34,# Ice Pack
|
||||
product,product_138,343597,img_store_personpacks_disco,mdlc63,personpacks,all,0,,35,# Disco Pack
|
||||
product,product_139,343598,img_store_personpacks_cards,mdlc64,personpacks,all,0,,36,# Cards Pack
|
||||
product,product_140,343599,img_store_personpacks_jackpot,mdlc65,personpacks,all,0,,37,# Jackpot Pack
|
||||
product,product_141,343590,img_store_personpacks_blackout,mdlc66,personpacks,all,0,,38,# BLOPS3 Pack
|
||||
|
||||
# MDLC 2 - Standard Packs
|
||||
product,product_6,343591,img_store_personpacks_tiki,mdlc34,personpacks,all,0,,,# Tiki
|
||||
product,product_7,343592,img_store_personpacks_gasfire,mdlc35,personpacks,all,0,,,# Gas Fire
|
||||
product,product_8,343593,img_store_personpacks_leaf,mdlc36,personpacks,all,0,,,# Leaf
|
||||
product,product_9,343594,img_store_personpacks_psych,mdlc37,personpacks,all,0,,,# Psychadelic
|
||||
|
||||
product,product_10,331060,img_store_personpacks_magma,mdlc7,personpacks,all,0,,,# Magma
|
||||
product,product_11,331061,img_store_personpacks_lightning,mdlc8,personpacks,all,0,,,# Lightning
|
||||
product,product_12,331062,img_store_personpacks_hide,mdlc9,personpacks,all,0,,,# Hide
|
||||
product,product_13,331063,img_store_personpacks_nanotech,mdlc10,personpacks,all,0,,,# Nanotech
|
||||
|
||||
# MDLC 2.5 Premium Personalization Packs
|
||||
product,product_136,343590,img_store_personpacks_premium_blackout,mdlc61,PREMPERSONPACKS,all,0,,33,# BLOPS3 Prem Pack
|
||||
|
||||
# MDLC 2 - Premium Personalization Packs
|
||||
product,product_14,343596,img_store_personpacks_premium_tiki,mdlc38,prempersonpacks,all,0,,,# Premium Tiki
|
||||
product,product_15,343597,img_store_personpacks_premium_gasfire,mdlc39,prempersonpacks,all,0,,,# Premium Gas Fire
|
||||
product,product_16,343598,img_store_personpacks_premium_leaf,mdlc40,prempersonpacks,all,0,,,# Premium Leaf
|
||||
product,product_17,343599,img_store_personpacks_premium_psych,mdlc41,prempersonpacks,all,0,,,# Premium Psychadelic
|
||||
|
||||
product,product_18,343600,img_store_personpacks_premium_cod_champs,mdlc42,prempersonpacks,all,0,,,# Premium Cod Champs
|
||||
product,product_19,331064,img_store_personpacks_premium_magma,mdlc11,prempersonpacks,all,0,,,# Premium Magma
|
||||
product,product_20,331065,img_store_personpacks_premium_lightning,mdlc12,prempersonpacks,all,0,,,# Premium Lightning
|
||||
product,product_21,331066,img_store_personpacks_premium_hide,mdlc13,prempersonpacks,all,0,,,# Premium Hide
|
||||
product,product_22,331067,img_store_personpacks_premium_nanotech,mdlc14,prempersonpacks,all,0,,,# Premium Nanotech
|
||||
|
||||
# MDLC 2 - Exo Packs
|
||||
product,product_23,343601,img_store_operatorpacks_cowboy,mdlc101,operatorpacks,all,0,,,# Cowboy
|
||||
product,product_24,343602,img_store_operatorpacks_surfer,mdlc43,operatorpacks,all,0,,,# Surfer
|
||||
product,product_25,343604,img_store_operatorpacks_octopus,mdlc45,operatorpacks,all,0,,,# Octopus
|
||||
# MDLC 2 - Lady Gear Exo Packs
|
||||
product,product_26,345600,img_store_operatorpacks_rose_camo,mdlc59,OPERATORPACKS,all,0,,,# Rose Camo / Passionate
|
||||
product,product_27,345601,img_store_operatorpacks_white_blue,mdlc60,OPERATORPACKS,all,0,,,# White Blue / Tenacious
|
||||
|
||||
product,product_28,5f3f93ca-03ab-4fdd-aa00-63f17fb08d79,img_store_operatorpacks_steam_punk,mdlc15,operatorpacks,all,0,,,# Steam Punk
|
||||
product,product_29,beb1715c-5825-4ae3-844d-1f72231f9306,img_store_operatorpacks_panda,mdlc16,operatorpacks,all,0,,,# Panda
|
||||
product,product_30,05e1b887-e323-4aaf-b95b-12e9512f76aa,img_store_operatorpacks_bali_mask,mdlc17,operatorpacks,all,0,,,#Bali Mask
|
||||
product,product_31,33c64260-e212-4794-8abe-9810f04471e7,img_store_operatorpacks_classic_biker,mdlc18,operatorpacks,all,0,,,#Classic Biker
|
||||
|
||||
# MDLC 2 - Flags
|
||||
product,product_32,334460,img_store_flag_packs_argentinia,mdlc46,flagpacks,all,0,,,# Argentina Flag
|
||||
product,product_33,343605,img_store_flag_packs_austria,mdlc47,flagpacks,all,0,,,# Austria Flag
|
||||
product,product_34,333086,img_store_flag_packs_brazil,mdlc26,flagpacks,all,0,,,# Brazil Flag
|
||||
product,product_35,343606,img_store_flag_packs_columbia,mdlc48,flagpacks,all,0,,,# Columbia Flag
|
||||
product,product_36,343607,img_store_flag_packs_ireland,mdlc49,flagpacks,all,0,,,# Ireland Flag
|
||||
product,product_37,343608,img_store_flag_packs_new_zealand,mdlc50,flagpacks,all,0,,,# New Zealand Flag
|
||||
product,product_38,343609,img_store_flag_packs_portugal,mdlc51,flagpacks,all,0,,,# Portugal Flag
|
||||
|
||||
product,product_39,331072,img_store_flag_packs_usa,mdlc19,flagpacks,all,0,,,# USA Flag
|
||||
product,product_40,333080,img_store_flag_packs_uk,mdlc20,flagpacks,all,0,,,# UK Flag
|
||||
product,product_41,333081,img_store_flag_packs_canada,mdlc21,flagpacks,all,0,,,# Canada Flag
|
||||
product,product_42,333082,img_store_flag_packs_france,mdlc22,flagpacks,all,0,,,# France Flag
|
||||
product,product_43,333083,img_store_flag_packs_germany,mdlc23,flagpacks,all,0,,,# Germany Flag
|
||||
product,product_44,333084,img_store_flag_packs_australia,mdlc24,flagpacks,all,0,,,# Australia Flag
|
||||
product,product_45,333087,img_store_flag_packs_italy,mdlc27,flagpacks,all,0,,,# Italy Flag
|
||||
product,product_46,333088,img_store_flag_packs_spain,mdlc28,flagpacks,all,0,,,# Spain Flag
|
||||
product,product_47,334220,img_store_flag_packs_netherlands,mdlc29,flagpacks,all,0,,,# Netherlands Flag
|
||||
product,product_48,334221,img_store_flag_packs_japan,mdlc30,flagpacks,all,0,,,# Japan Flag
|
||||
|
||||
product,product_49,343610,img_store_cac_slots,mdlc52,otheritems,all,0,,,# Create A Class Slots
|
||||
product,product_50,343612,img_store_armory_slots1,mdlc54,otheritems,all,0,armoryslots,,# Armory Slots
|
||||
product,product_51,343613,img_store_armory_slots2,mdlc55,otheritems,all,0,armoryslots,,# Armory Slots
|
||||
product,product_52,343614,img_store_armory_slots3,mdlc56,otheritems,all,0,armoryslots,,# Armory Slots
|
||||
product,product_53,343615,img_store_armory_slots4,mdlc57,otheritems,all,0,armoryslots,,# Armory Slots
|
||||
product,product_54,343616,img_store_armory_slots5,mdlc58,otheritems,all,0,armoryslots,,# Armory Slots
|
||||
product,product_55,318790,img_store_mappacks_atlas_gorge,dlc1,otheritems,all,0,,,# Atlas Gorge
|
||||
|
||||
product,product_56,00000,img_store_supplydrops_1,mdlc61,supplydrops,all,0,supplydrops_1,,# Supply Drops 1
|
||||
product,product_57,76a554fb-c4b4-4a3e-b913-dcd0c61de638,img_store_supplydrops_1,mdlc62,supplydrops,all,0,supplydrops_1,,# Supply Drops 1
|
||||
product,product_58,ed37f45c-1d3c-451c-87c3-0bb46ca51fa6,img_store_supplydrops_1,mdlc63,supplydrops,all,0,supplydrops_1,,# Supply Drops 1
|
||||
product,product_59,518865ed-dfae-4d8a-836e-e0e5dc2c3d08,img_store_supplydrops_1,mdlc64,supplydrops,all,0,supplydrops_1,,# Supply Drops 1
|
||||
product,product_60,3b9f4478-900d-43f9-b4b1-eb1f901ce961,img_store_supplydrops_1,mdlc65,supplydrops,all,0,supplydrops_1,,# Supply Drops 1
|
||||
product,product_61,f20bfb05-cca9-4a61-971b-c6c620b928b0,img_store_supplydrops_1,mdlc66,supplydrops,all,0,supplydrops_1,,# Supply Drops 1
|
||||
product,product_62,a75ee2b8-42f6-46b1-a45f-db6e64a98872,img_store_supplydrops_1,mdlc67,supplydrops,all,0,supplydrops_1,,# Supply Drops 1
|
||||
product,product_63,20f97f87-52a7-461e-8b78-9a54080bd400,img_store_supplydrops_1,mdlc68,supplydrops,all,0,supplydrops_1,,# Supply Drops 1
|
||||
product,product_64,f03ad620-bc8a-4f4f-a3b0-3630347b8a30,img_store_supplydrops_1,mdlc69,supplydrops,all,0,supplydrops_1,,# Supply Drops 1
|
||||
product,product_65,ebe31b71-f8cc-4f0d-9915-6a13d53af74b,img_store_supplydrops_1,mdlc70,supplydrops,all,0,supplydrops_1,,# Supply Drops 1
|
||||
product,product_111,b05003d8-bf77-4d04-a0cc-d8a36425b813,img_store_supplydrops_1,supdrp72,supplydrops,all,0,supplydrops_1,22,# Supply Drops 1
|
||||
product,product_112,2b7b516c-8e7e-45b7-92fd-dc2040c08d6e,img_store_supplydrops_1,supdrp73,supplydrops,all,0,supplydrops_1,22,# Supply Drops 1
|
||||
product,product_113,5de14218-1543-4fc5-ae89-eb4037109234,img_store_supplydrops_1,supdrp74,supplydrops,all,0,supplydrops_1,22,# Supply Drops 1
|
||||
product,product_114,3404d799-4341-46de-95ea-c6bdd47c8e39,img_store_supplydrops_1,supdrp75,supplydrops,all,0,supplydrops_1,22,# Supply Drops 1
|
||||
product,product_115,3f05faaf-a59b-4807-ad58-0bd28f520cc9,img_store_supplydrops_1,supdrp76,supplydrops,all,0,supplydrops_1,22,# Supply Drops 1
|
||||
|
||||
product,product_66,6031ecd6-a183-4c71-9022-9685dde26ebd,img_store_supplydrops_3,mdlc91,supplydrops,all,0,supplydrops_3,,# Supply Drops 3
|
||||
product,product_67,6aebd756-0b60-4ad4-8639-d27db2ae79e0,img_store_supplydrops_3,mdlc92,supplydrops,all,0,supplydrops_3,,# Supply Drops 3
|
||||
product,product_68,93a0c86c-c7af-464c-88d7-6e0519d482f4,img_store_supplydrops_3,mdlc93,supplydrops,all,0,supplydrops_3,,# Supply Drops 3
|
||||
product,product_69,6ca3fa67-8844-4128-89e0-8d4b7b8c5e3a,img_store_supplydrops_3,mdlc94,supplydrops,all,0,supplydrops_3,,# Supply Drops 3
|
||||
product,product_70,55c76436-50d8-401e-8761-b9ceeb18c7c4,img_store_supplydrops_3,mdlc95,supplydrops,all,0,supplydrops_3,,# Supply Drops 3
|
||||
product,product_71,844742d6-baa0-4079-892e-649a45564b56,img_store_supplydrops_3,mdlc96,supplydrops,all,0,supplydrops_3,,# Supply Drops 3
|
||||
product,product_72,605fb575-1482-4e0f-8934-165e290d26ca,img_store_supplydrops_3,mdlc97,supplydrops,all,0,supplydrops_3,,# Supply Drops 3
|
||||
product,product_73,64d0e219-b602-4906-b714-895d020bae2a,img_store_supplydrops_3,mdlc98,supplydrops,all,0,supplydrops_3,,# Supply Drops 3
|
||||
product,product_74,fc0e23af-fc91-4711-b3ca-a45c3ab03049,img_store_supplydrops_3,mdlc99,supplydrops,all,0,supplydrops_3,,# Supply Drops 3
|
||||
product,product_75,e9886801-697b-4b40-93bd-6f9b37b6102b,img_store_supplydrops_3,mdlc100,supplydrops,all,0,supplydrops_3,,# Supply Drops 3
|
||||
product,product_116,3c32e23a-514d-487c-9733-c9c8ec6fd55b,img_store_supplydrops_3,supdrp77,supplydrops,all,0,supplydrops_3,23,# Supply Drops 3
|
||||
product,product_117,906884d7-2864-4cd2-b725-1129c111abab,img_store_supplydrops_3,supdrp78,supplydrops,all,0,supplydrops_3,23,# Supply Drops 3
|
||||
product,product_118,28e9c053-da80-4f8a-b1b3-26cf9e6cad59,img_store_supplydrops_3,supdrp79,supplydrops,all,0,supplydrops_3,23,# Supply Drops 3
|
||||
product,product_119,13668620-fb95-4e3b-b15b-05ca33cb90dc,img_store_supplydrops_3,supdrp80,supplydrops,all,0,supplydrops_3,23,# Supply Drops 3
|
||||
product,product_120,e9e772ce-aeb5-4831-9672-f2ab1c0459f5,img_store_supplydrops_3,supdrp81,supplydrops,all,0,supplydrops_3,23,# Supply Drops 3
|
||||
|
||||
product,product_76,156f40b5-3683-4c26-a6d0-f2358701df53,img_store_supplydrops_5,mdlc71,supplydrops,all,0,supplydrops_5,,# Supply Drops 5
|
||||
product,product_77,3ec7cec9-91ff-4931-8785-e7092495c5cb,img_store_supplydrops_5,mdlc72,supplydrops,all,0,supplydrops_5,,# Supply Drops 5
|
||||
product,product_78,29af6a13-c4ce-469c-aee1-82bdcef9307f,img_store_supplydrops_5,mdlc73,supplydrops,all,0,supplydrops_5,,# Supply Drops 5
|
||||
product,product_79,92334032-5350-4319-ad0b-a5dac31e491f,img_store_supplydrops_5,mdlc74,supplydrops,all,0,supplydrops_5,,# Supply Drops 5
|
||||
product,product_80,9974b492-3253-4873-97cc-68a47117f09f,img_store_supplydrops_5,mdlc75,supplydrops,all,0,supplydrops_5,,# Supply Drops 5
|
||||
product,product_81,d3a71cec-ceb3-452a-baa1-97ce8360cee8,img_store_supplydrops_5,mdlc76,supplydrops,all,0,supplydrops_5,,# Supply Drops 5
|
||||
product,product_82,93e9ba95-0738-4302-9880-33774f4e4b2a,img_store_supplydrops_5,mdlc77,supplydrops,all,0,supplydrops_5,,# Supply Drops 5
|
||||
product,product_83,5998caba-5f9f-475c-bc45-a4f2d9386105,img_store_supplydrops_5,mdlc78,supplydrops,all,0,supplydrops_5,,# Supply Drops 5
|
||||
product,product_84,5afa84ac-abe3-4db9-917e-29933134d4be,img_store_supplydrops_5,mdlc79,supplydrops,all,0,supplydrops_5,,# Supply Drops 5
|
||||
product,product_85,4f7350d9-90aa-4f91-a974-8fe399280d7c,img_store_supplydrops_5,mdlc80,supplydrops,all,0,supplydrops_5,,# Supply Drops 5
|
||||
product,product_121,19938ec4-0047-4d17-8002-97c6584413fa,img_store_supplydrops_5,supdrp82,supplydrops,all,0,supplydrops_5,24,# Supply Drops 5
|
||||
product,product_122,e2bb0ca8-66cc-4658-a34c-0c80babdb0df,img_store_supplydrops_5,supdrp83,supplydrops,all,0,supplydrops_5,24,# Supply Drops 5
|
||||
product,product_123,411f8663-77fd-4821-8eef-8e213ba1f4ed,img_store_supplydrops_5,supdrp84,supplydrops,all,0,supplydrops_5,24,# Supply Drops 5
|
||||
product,product_124,2a9140a1-946b-4a07-a790-6f7d4ee541d7,img_store_supplydrops_5,supdrp85,supplydrops,all,0,supplydrops_5,24,# Supply Drops 5
|
||||
product,product_125,af7f50e7-dc1b-4b14-b78d-61ae560b2a00,img_store_supplydrops_5,supdrp86,supplydrops,all,0,supplydrops_5,24,# Supply Drops 5
|
||||
|
||||
product,product_86,5de0f259-b94b-40a9-a2ea-dba2f95f8b87,img_store_supplydrops_10,mdlc81,supplydrops,all,0,supplydrops_10,,# Supply Drops 10
|
||||
product,product_87,89f452a5-5c6f-4d8e-a203-35de25a73805,img_store_supplydrops_10,mdlc82,supplydrops,all,0,supplydrops_10,,# Supply Drops 10
|
||||
product,product_88,c503ee82-39c2-4a0e-93fe-e9acfc846a81,img_store_supplydrops_10,mdlc83,supplydrops,all,0,supplydrops_10,,# Supply Drops 10
|
||||
product,product_89,e2c670f6-567b-4bd1-ae36-c2f039e22add,img_store_supplydrops_10,mdlc84,supplydrops,all,0,supplydrops_10,,# Supply Drops 10
|
||||
product,product_90,b38a63b5-2c14-445f-a9d7-31ad59b4fe5c,img_store_supplydrops_10,mdlc85,supplydrops,all,0,supplydrops_10,,# Supply Drops 10
|
||||
product,product_91,8c448893-0809-4c4f-be73-fa574be15333,img_store_supplydrops_10,mdlc86,supplydrops,all,0,supplydrops_10,,# Supply Drops 10
|
||||
product,product_92,82a96d7b-859b-46a9-a7c7-ba082558066b,img_store_supplydrops_10,mdlc87,supplydrops,all,0,supplydrops_10,,# Supply Drops 10
|
||||
product,product_93,9bc7070b-4a5a-4d39-9957-734eafd3f8e0,img_store_supplydrops_10,mdlc88,supplydrops,all,0,supplydrops_10,,# Supply Drops 10
|
||||
product,product_94,dda9be88-d5cc-4827-aecf-40e9598f4adb,img_store_supplydrops_10,mdlc89,supplydrops,all,0,supplydrops_10,,# Supply Drops 10
|
||||
product,product_95,4067a17b-23c7-4999-a514-8ed9041e8a02,img_store_supplydrops_10,mdlc90,supplydrops,all,0,supplydrops_10,,# Supply Drops 10
|
||||
product,product_126,10cd1171-2eb4-4dcb-a281-372b747319f6,img_store_supplydrops_10,supdrp87,supplydrops,all,0,supplydrops_10,25,# Supply Drops 10
|
||||
product,product_127,8706ff47-4cc7-4957-a4f3-d9589be39d78,img_store_supplydrops_10,supdrp88,supplydrops,all,0,supplydrops_10,25,# Supply Drops 10
|
||||
product,product_128,ff9063ee-79ef-4b4a-8e22-df83f700e292,img_store_supplydrops_10,supdrp89,supplydrops,all,0,supplydrops_10,25,# Supply Drops 10
|
||||
product,product_129,31cdd8b7-2c6a-414b-8e02-a2d7f6f64f12,img_store_supplydrops_10,supdrp90,supplydrops,all,0,supplydrops_10,25,# Supply Drops 10
|
||||
product,product_130,de53b351-a6ab-4089-a30b-0396f6fad455,img_store_supplydrops_10,supdrp91,supplydrops,all,0,supplydrops_10,25,# Supply Drops 10
|
||||
|
||||
# Consumable Supply Drops
|
||||
product,product_96,c5f202f9-3386-4d8b-9f5f-fc4f16f78ed3,img_store_supplydrops_1,supdrp46,supplydrops_v2,all,0,,26,# Consumable Supply Drops 1
|
||||
product,product_97,0463b195-81cb-43c8-87a4-814043492ac1,img_store_supplydrops_3,supdrp50,supplydrops_v2,all,0,,27,# Consumable Supply Drops 3
|
||||
product,product_98,ef8577d9-0cab-433d-8955-8dd96089218e,img_store_supplydrops_5,supdrp47,supplydrops_v2,all,0,,28,# Consumable Supply Drops 5
|
||||
product,product_99,4b49d2af-d9ed-4f4a-8aa1-0fc3c2e70f87,img_store_supplydrops_10,supdrp48,supplydrops_v2,all,0,,29,# Consumable Supply Drops 10
|
||||
product,product_100,ca0012ef-1206-4173-8979-d2d4f3d66a57,img_store_supplydrops_20,supdrp71,supplydrops_v2,all,0,,31,# Consumable Supply Drops 20
|
||||
|
||||
# More Durable Supply Drops
|
||||
product,product_101,48a1c3f1-c47f-4752-95c8-658630e29cd1,img_store_supplydrops_20,supdrp61,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
product,product_102,e0556d68-6bbf-4fce-affb-28c4eec8eb25,img_store_supplydrops_20,supdrp62,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
product,product_103,d627860d-bf3a-4972-9eb5-51a68bf4eb44,img_store_supplydrops_20,supdrp63,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
product,product_104,641bb491-7dda-42c9-850f-a9d6774236a0,img_store_supplydrops_20,supdrp64,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
product,product_105,c53a24c9-c07b-468d-bbc5-1d57ccdfd82c,img_store_supplydrops_20,supdrp65,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
product,product_106,fcc7f36b-3158-4129-a13d-8437924eb9ee,img_store_supplydrops_20,supdrp66,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
product,product_107,a21a0bda-abed-47a2-9d97-40bede8bfd7b,img_store_supplydrops_20,supdrp67,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
product,product_108,c7492ab3-7a7c-46d7-8efd-2a6ecd844dd7,img_store_supplydrops_20,supdrp68,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
product,product_109,e6a955fb-c723-42f7-b391-615dce049592,img_store_supplydrops_20,supdrp69,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
product,product_110,a4f8bf5c-4af4-4f4b-9996-e0816475ff6b,img_store_supplydrops_20,supdrp70,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
product,product_131,0b917713-e3a1-406b-9a61-dd1afa2212f5,img_store_supplydrops_20,supdrp92,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
product,product_132,69377444-37e1-4b99-8008-376a1da8d886,img_store_supplydrops_20,supdrp93,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
product,product_133,c3ae1aee-1445-4601-9577-033496317972,img_store_supplydrops_20,supdrp94,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
product,product_134,7d66fdd5-ebac-4893-be48-439867faccda,img_store_supplydrops_20,supdrp95,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
product,product_135,466f1cd8-ce9e-4ee8-ad7b-79d9e8c4e57b,img_store_supplydrops_20,supdrp96,supplydrops,all,0,supplydrops_20,30,# Supply Drops 20
|
||||
|
||||
#MDLC 4 OHM Standalone
|
||||
product,product_142,343595,img_store_ohm,mdlc70,OTHERITEMS,all,0,,,#OHM Standalone Pack
|
||||
|
||||
#type = category,UID,category ID,title,Language List separated by space delimiter,visibility (0-show,1-hide)
|
||||
category,category_1,0,seasonpass,LUA_MENU_STORE_SEASON_PASS,all,0
|
||||
category,category_2,2,mappacks,LUA_MENU_STORE_MAP_PACKS,all,0
|
||||
category,category_3,3,prempersonpacks,LUA_MENU_STORE_PREMIUM_PERSONALIZATION_PACKS,all,0
|
||||
category,category_4,4,personpacks,LUA_MENU_STORE_PERSONALIZATION_PACKS,all,0
|
||||
category,category_5,5,operatorpacks,LUA_MENU_STORE_PREMIUM_EXO_PACKS,all,0
|
||||
category,category_6,6,flagpacks,LUA_MENU_STORE_EXO_PACKS,all,0
|
||||
category,category_7,7,supplydrops,LUA_MENU_STORE_SUPPLYDROPS,all,0
|
||||
category,category_8,8,otheritems,LUA_MENU_STORE_ADDITIONAL_ITEMS,all,0
|
|
@ -1,104 +1,105 @@
|
||||
#include <std_include.hpp>
|
||||
#include "steam/steam.hpp"
|
||||
#include "../steam.hpp"
|
||||
|
||||
namespace steam
|
||||
{
|
||||
bool apps::BIsSubscribed()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool apps::BIsLowViolence()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool apps::BIsSubscribed()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool apps::BIsCybercafe()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool apps::BIsLowViolence()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool apps::BIsVACBanned()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool apps::BIsCybercafe()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* apps::GetCurrentGameLanguage()
|
||||
{
|
||||
return "english";
|
||||
}
|
||||
bool apps::BIsVACBanned()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* apps::GetAvailableGameLanguages()
|
||||
{
|
||||
return "english";
|
||||
}
|
||||
const char* apps::GetCurrentGameLanguage()
|
||||
{
|
||||
return "english";
|
||||
}
|
||||
|
||||
bool apps::BIsSubscribedApp(unsigned int appID)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
const char* apps::GetAvailableGameLanguages()
|
||||
{
|
||||
return "english";
|
||||
}
|
||||
|
||||
bool apps::BIsDlcInstalled(unsigned int appID)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool apps::BIsSubscribedApp(unsigned int appID)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned int apps::GetEarliestPurchaseUnixTime(unsigned int nAppID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool apps::BIsDlcInstalled(unsigned int appID)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool apps::BIsSubscribedFromFreeWeekend()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
unsigned int apps::GetEarliestPurchaseUnixTime(unsigned int nAppID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int apps::GetDLCCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool apps::BIsSubscribedFromFreeWeekend()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool apps::BGetDLCDataByIndex(int iDLC, unsigned int* pAppID, bool* pbAvailable, char* pchName,
|
||||
int cchNameBufferSize)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int apps::GetDLCCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void apps::InstallDLC(unsigned int nAppID)
|
||||
{
|
||||
}
|
||||
bool apps::BGetDLCDataByIndex(int iDLC, unsigned int* pAppID, bool* pbAvailable, char* pchName, int cchNameBufferSize)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void apps::UninstallDLC(unsigned int nAppID)
|
||||
{
|
||||
}
|
||||
void apps::InstallDLC(unsigned int nAppID)
|
||||
{
|
||||
}
|
||||
|
||||
void apps::RequestAppProofOfPurchaseKey(unsigned int nAppID)
|
||||
{
|
||||
}
|
||||
void apps::UninstallDLC(unsigned int nAppID)
|
||||
{
|
||||
}
|
||||
|
||||
bool apps::GetCurrentBetaName(char *pchName, int cchNameBufferSize)
|
||||
{
|
||||
strncpy_s(pchName, cchNameBufferSize, "public", cchNameBufferSize);
|
||||
return true;
|
||||
}
|
||||
void apps::RequestAppProofOfPurchaseKey(unsigned int nAppID)
|
||||
{
|
||||
}
|
||||
|
||||
bool apps::MarkContentCorrupt(bool bMissingFilesOnly)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool apps::GetCurrentBetaName(char* pchName, int cchNameBufferSize)
|
||||
{
|
||||
strncpy_s(pchName, cchNameBufferSize, "public", cchNameBufferSize);
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned int apps::GetInstalledDepots(int *pvecDepots, unsigned int cMaxDepots)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool apps::MarkContentCorrupt(bool bMissingFilesOnly)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned int apps::GetAppInstallDir(unsigned int appID, char *pchFolder, unsigned int cchFolderBufferSize)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned int apps::GetInstalledDepots(int* pvecDepots, unsigned int cMaxDepots)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool apps::BIsAppInstalled(unsigned int appID)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
unsigned int apps::GetAppInstallDir(unsigned int appID, char* pchFolder, unsigned int cchFolderBufferSize)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool apps::BIsAppInstalled(unsigned int appID)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace steam
|
||||
|
@ -2,31 +2,32 @@
|
||||
|
||||
namespace steam
|
||||
{
|
||||
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);
|
||||
};
|
||||
}
|
||||
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
|
||||
|
@ -1,312 +1,313 @@
|
||||
#include <std_include.hpp>
|
||||
#include "steam/steam.hpp"
|
||||
#include "../steam.hpp"
|
||||
|
||||
namespace steam
|
||||
{
|
||||
const char* friends::GetPersonaName()
|
||||
{
|
||||
return "GlaDos";
|
||||
}
|
||||
|
||||
unsigned long long friends::SetPersonaName(const char* pchPersonaName)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
const char* friends::GetPersonaName()
|
||||
{
|
||||
return "1337";
|
||||
}
|
||||
|
||||
int friends::GetPersonaState()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
unsigned long long friends::SetPersonaName(const char* pchPersonaName)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int friends::GetFriendCount(int eFriendFlags)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int friends::GetPersonaState()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
steam_id friends::GetFriendByIndex(int iFriend, int iFriendFlags)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
int friends::GetFriendCount(int eFriendFlags)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int friends::GetFriendRelationship(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
steam_id friends::GetFriendByIndex(int iFriend, int iFriendFlags)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
|
||||
int friends::GetFriendPersonaState(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int friends::GetFriendRelationship(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* friends::GetFriendPersonaName(steam_id steamIDFriend)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
int friends::GetFriendPersonaState(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool friends::GetFriendGamePlayed(steam_id steamIDFriend, void* pFriendGameInfo)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
const char* friends::GetFriendPersonaName(steam_id steamIDFriend)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
const char* friends::GetFriendPersonaNameHistory(steam_id steamIDFriend, int iPersonaName)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
bool friends::GetFriendGamePlayed(steam_id steamIDFriend, void* pFriendGameInfo)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool friends::HasFriend(steam_id steamIDFriend, int eFriendFlags)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
const char* friends::GetFriendPersonaNameHistory(steam_id steamIDFriend, int iPersonaName)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
int friends::GetClanCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool friends::HasFriend(steam_id steamIDFriend, int eFriendFlags)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
steam_id friends::GetClanByIndex(int iClan)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
int friends::GetClanCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* friends::GetClanName(steam_id steamIDClan)
|
||||
{
|
||||
return "3arc";
|
||||
}
|
||||
steam_id friends::GetClanByIndex(int iClan)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
|
||||
const char* friends::GetClanTag(steam_id steamIDClan)
|
||||
{
|
||||
return this->GetClanName(steamIDClan);
|
||||
}
|
||||
const char* friends::GetClanName(steam_id steamIDClan)
|
||||
{
|
||||
return "3arc";
|
||||
}
|
||||
|
||||
bool friends::GetClanActivityCounts(steam_id steamID, int* pnOnline, int* pnInGame, int* pnChatting)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
const char* friends::GetClanTag(steam_id steamIDClan)
|
||||
{
|
||||
return this->GetClanName(steamIDClan);
|
||||
}
|
||||
|
||||
unsigned long long friends::DownloadClanActivityCounts(steam_id groupIDs[], int nIds)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool friends::GetClanActivityCounts(steam_id steamID, int* pnOnline, int* pnInGame, int* pnChatting)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int friends::GetFriendCountFromSource(steam_id steamIDSource)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned long long friends::DownloadClanActivityCounts(steam_id groupIDs[], int nIds)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
steam_id friends::GetFriendFromSourceByIndex(steam_id steamIDSource, int iFriend)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
int friends::GetFriendCountFromSource(steam_id steamIDSource)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool friends::IsUserInSource(steam_id steamIDUser, steam_id steamIDSource)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
steam_id friends::GetFriendFromSourceByIndex(steam_id steamIDSource, int iFriend)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
|
||||
void friends::SetInGameVoiceSpeaking(steam_id steamIDUser, bool bSpeaking)
|
||||
{
|
||||
}
|
||||
bool friends::IsUserInSource(steam_id steamIDUser, steam_id steamIDSource)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void friends::ActivateGameOverlay(const char* pchDialog)
|
||||
{
|
||||
}
|
||||
void friends::SetInGameVoiceSpeaking(steam_id steamIDUser, bool bSpeaking)
|
||||
{
|
||||
}
|
||||
|
||||
void friends::ActivateGameOverlayToUser(const char* pchDialog, steam_id steamID)
|
||||
{
|
||||
}
|
||||
void friends::ActivateGameOverlay(const char* pchDialog)
|
||||
{
|
||||
}
|
||||
|
||||
void friends::ActivateGameOverlayToWebPage(const char* pchURL)
|
||||
{
|
||||
}
|
||||
void friends::ActivateGameOverlayToUser(const char* pchDialog, steam_id steamID)
|
||||
{
|
||||
}
|
||||
|
||||
void friends::ActivateGameOverlayToStore(unsigned int nAppID, unsigned int eFlag)
|
||||
{
|
||||
OutputDebugStringA("Store requested!");
|
||||
}
|
||||
void friends::ActivateGameOverlayToWebPage(const char* pchURL)
|
||||
{
|
||||
}
|
||||
|
||||
void friends::SetPlayedWith(steam_id steamIDUserPlayedWith)
|
||||
{
|
||||
}
|
||||
void friends::ActivateGameOverlayToStore(unsigned int nAppID, unsigned int eFlag)
|
||||
{
|
||||
}
|
||||
|
||||
void friends::ActivateGameOverlayInviteDialog(steam_id steamIDLobby)
|
||||
{
|
||||
}
|
||||
void friends::SetPlayedWith(steam_id steamIDUserPlayedWith)
|
||||
{
|
||||
}
|
||||
|
||||
int friends::GetSmallFriendAvatar(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
void friends::ActivateGameOverlayInviteDialog(steam_id steamIDLobby)
|
||||
{
|
||||
}
|
||||
|
||||
int friends::GetMediumFriendAvatar(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int friends::GetSmallFriendAvatar(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int friends::GetLargeFriendAvatar(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int friends::GetMediumFriendAvatar(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool friends::RequestUserInformation(steam_id steamIDUser, bool bRequireNameOnly)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int friends::GetLargeFriendAvatar(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long friends::RequestClanOfficerList(steam_id steamIDClan)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool friends::RequestUserInformation(steam_id steamIDUser, bool bRequireNameOnly)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
steam_id friends::GetClanOwner(steam_id steamIDClan)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
unsigned long long friends::RequestClanOfficerList(steam_id steamIDClan)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int friends::GetClanOfficerCount(steam_id steamIDClan)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
steam_id friends::GetClanOwner(steam_id steamIDClan)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
|
||||
steam_id friends::GetClanOfficerByIndex(steam_id steamIDClan, int iOfficer)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
int friends::GetClanOfficerCount(steam_id steamIDClan)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int friends::GetUserRestrictions()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
steam_id friends::GetClanOfficerByIndex(steam_id steamIDClan, int iOfficer)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
|
||||
bool friends::SetRichPresence(const char* pchKey, const char* pchValue)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
int friends::GetUserRestrictions()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void friends::ClearRichPresence()
|
||||
{
|
||||
}
|
||||
bool friends::SetRichPresence(const char* pchKey, const char* pchValue)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const char* friends::GetFriendRichPresence(steam_id steamIDFriend, const char* pchKey)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
void friends::ClearRichPresence()
|
||||
{
|
||||
}
|
||||
|
||||
int friends::GetFriendRichPresenceKeyCount(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
const char* friends::GetFriendRichPresence(steam_id steamIDFriend, const char* pchKey)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
const char* friends::GetFriendRichPresenceKeyByIndex(steam_id steamIDFriend, int iKey)
|
||||
{
|
||||
return "a";
|
||||
}
|
||||
int friends::GetFriendRichPresenceKeyCount(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void friends::RequestFriendRichPresence(steam_id steamIDFriend)
|
||||
{
|
||||
}
|
||||
const char* friends::GetFriendRichPresenceKeyByIndex(steam_id steamIDFriend, int iKey)
|
||||
{
|
||||
return "a";
|
||||
}
|
||||
|
||||
bool friends::InviteUserToGame(steam_id steamIDFriend, const char* pchConnectString)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
void friends::RequestFriendRichPresence(steam_id steamIDFriend)
|
||||
{
|
||||
}
|
||||
|
||||
int friends::GetCoplayFriendCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool friends::InviteUserToGame(steam_id steamIDFriend, const char* pchConnectString)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
steam_id friends::GetCoplayFriend(int iCoplayFriend)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
int friends::GetCoplayFriendCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int friends::GetFriendCoplayTime(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
steam_id friends::GetCoplayFriend(int iCoplayFriend)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
|
||||
unsigned int friends::GetFriendCoplayGame(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int friends::GetFriendCoplayTime(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long friends::JoinClanChatRoom(steam_id steamIDClan)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned int friends::GetFriendCoplayGame(steam_id steamIDFriend)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool friends::LeaveClanChatRoom(steam_id steamIDClan)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
unsigned long long friends::JoinClanChatRoom(steam_id steamIDClan)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int friends::GetClanChatMemberCount(steam_id steamIDClan)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool friends::LeaveClanChatRoom(steam_id steamIDClan)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
steam_id friends::GetChatMemberByIndex(steam_id steamIDClan, int iUser)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
int friends::GetClanChatMemberCount(steam_id steamIDClan)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool friends::SendClanChatMessage(steam_id steamIDClanChat, const char *pchText)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
steam_id friends::GetChatMemberByIndex(steam_id steamIDClan, int iUser)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
|
||||
int friends::GetClanChatMessage(steam_id steamIDClanChat, int iMessage, void *prgchText, int cchTextMax, unsigned int *peChatEntryType, steam_id *pSteamIDChatter)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool friends::SendClanChatMessage(steam_id steamIDClanChat, const char* pchText)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool friends::IsClanChatAdmin(steam_id steamIDClanChat, steam_id steamIDUser)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int friends::GetClanChatMessage(steam_id steamIDClanChat, int iMessage, void* prgchText, int cchTextMax, unsigned int* peChatEntryType, steam_id* pSteamIDChatter)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool friends::IsClanChatWindowOpenInSteam(steam_id steamIDClanChat)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool friends::IsClanChatAdmin(steam_id steamIDClanChat, steam_id steamIDUser)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool friends::OpenClanChatWindowInSteam(steam_id steamIDClanChat)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool friends::IsClanChatWindowOpenInSteam(steam_id steamIDClanChat)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool friends::CloseClanChatWindowInSteam(steam_id steamIDClanChat)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool friends::OpenClanChatWindowInSteam(steam_id steamIDClanChat)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool friends::SetListenForFriendsMessages(bool bInterceptEnabled)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool friends::CloseClanChatWindowInSteam(steam_id steamIDClanChat)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool friends::ReplyToFriendMessage(steam_id steamIDFriend, const char *pchMsgToSend)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool friends::SetListenForFriendsMessages(bool bInterceptEnabled)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int friends::GetFriendMessage(steam_id steamIDFriend, int iMessageID, void *pvData, int cubData, unsigned int *peChatEntryType)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool friends::ReplyToFriendMessage(steam_id steamIDFriend, const char* pchMsgToSend)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned long long friends::GetFollowerCount(steam_id steamID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int friends::GetFriendMessage(steam_id steamIDFriend, int iMessageID, void* pvData, int cubData, unsigned int* peChatEntryType)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long friends::IsFollowing(steam_id steamID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned long long friends::GetFollowerCount(steam_id steamID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long friends::EnumerateFollowingList(unsigned int unStartIndex)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
unsigned long long friends::IsFollowing(steam_id steamID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long friends::EnumerateFollowingList(unsigned int unStartIndex)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace steam
|
||||
|
@ -2,73 +2,75 @@
|
||||
|
||||
namespace steam
|
||||
{
|
||||
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);
|
||||
};
|
||||
}
|
||||
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
|
@ -1,204 +1,204 @@
|
||||
#include <std_include.hpp>
|
||||
#include "steam/steam.hpp"
|
||||
#include "../steam.hpp"
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
void game_server::SetProduct(const char* pchProductName)
|
||||
{
|
||||
}
|
||||
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::SetGameDescription(const char* pchGameDescription)
|
||||
{
|
||||
}
|
||||
void game_server::SetProduct(const char* pchProductName)
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::SetModDir(const char* pchModDir)
|
||||
{
|
||||
}
|
||||
void game_server::SetGameDescription(const char* pchGameDescription)
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::SetDedicatedServer(bool bDedicatedServer)
|
||||
{
|
||||
}
|
||||
void game_server::SetModDir(const char* pchModDir)
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::LogOn(const char* pszAccountName, const char* pszPassword)
|
||||
{
|
||||
}
|
||||
void game_server::SetDedicatedServer(bool bDedicatedServer)
|
||||
{
|
||||
}
|
||||
|
||||
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::LogOn(const char* pszAccountName, const char* pszPassword)
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::LogOff()
|
||||
{
|
||||
}
|
||||
void game_server::LogOnAnonymous()
|
||||
{
|
||||
auto* const retvals = calloc(1, 1);
|
||||
const auto result = callbacks::register_call();
|
||||
callbacks::return_call(retvals, 0, 101, result);
|
||||
}
|
||||
|
||||
bool game_server::BLoggedOn()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void game_server::LogOff()
|
||||
{
|
||||
}
|
||||
|
||||
bool game_server::BSecure()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool game_server::BLoggedOn()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
steam_id game_server::GetSteamID()
|
||||
{
|
||||
return SteamUser()->GetSteamID();
|
||||
}
|
||||
bool game_server::BSecure()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool game_server::WasRestartRequested()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
steam_id game_server::GetSteamID()
|
||||
{
|
||||
return SteamUser()->GetSteamID();
|
||||
}
|
||||
|
||||
void game_server::SetMaxPlayerCount(int cPlayersMax)
|
||||
{
|
||||
}
|
||||
bool game_server::WasRestartRequested()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void game_server::SetBotPlayerCount(int cBotPlayers)
|
||||
{
|
||||
}
|
||||
void game_server::SetMaxPlayerCount(int cPlayersMax)
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::SetServerName(const char* pszServerName)
|
||||
{
|
||||
}
|
||||
void game_server::SetBotPlayerCount(int cBotPlayers)
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::SetMapName(const char* pszMapName)
|
||||
{
|
||||
}
|
||||
void game_server::SetServerName(const char* pszServerName)
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::SetPasswordProtected(bool bPasswordProtected)
|
||||
{
|
||||
}
|
||||
void game_server::SetMapName(const char* pszMapName)
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::SetSpectatorPort(unsigned short unSpectatorPort)
|
||||
{
|
||||
}
|
||||
void game_server::SetPasswordProtected(bool bPasswordProtected)
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::SetSpectatorServerName(const char* pszSpectatorServerName)
|
||||
{
|
||||
}
|
||||
void game_server::SetSpectatorPort(unsigned short unSpectatorPort)
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::ClearAllKeyValues()
|
||||
{
|
||||
}
|
||||
void game_server::SetSpectatorServerName(const char* pszSpectatorServerName)
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::SetKeyValue(const char* pKey, const char* pValue)
|
||||
{
|
||||
}
|
||||
void game_server::ClearAllKeyValues()
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::SetGameTags(const char* pchGameTags)
|
||||
{
|
||||
}
|
||||
void game_server::SetKeyValue(const char* pKey, const char* pValue)
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::SetGameData(const char* pchGameData)
|
||||
{
|
||||
}
|
||||
void game_server::SetGameTags(const char* pchGameTags)
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::SetRegion(const char* pchRegionName)
|
||||
{
|
||||
}
|
||||
void game_server::SetGameData(const char* pchGameData)
|
||||
{
|
||||
}
|
||||
|
||||
int game_server::SendUserConnectAndAuthenticate(unsigned int unIPClient, const void* pvAuthBlob,
|
||||
unsigned int cubAuthBlobSize, steam_id* pSteamIDUser)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
void game_server::SetRegion(const char* pchRegionName)
|
||||
{
|
||||
}
|
||||
|
||||
steam_id game_server::CreateUnauthenticatedUserConnection()
|
||||
{
|
||||
return SteamUser()->GetSteamID();
|
||||
}
|
||||
int game_server::SendUserConnectAndAuthenticate(unsigned int unIPClient, const void* pvAuthBlob, unsigned int cubAuthBlobSize, steam_id* pSteamIDUser)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void game_server::SendUserDisconnect(steam_id steamIDUser)
|
||||
{
|
||||
}
|
||||
steam_id game_server::CreateUnauthenticatedUserConnection()
|
||||
{
|
||||
return SteamUser()->GetSteamID();
|
||||
}
|
||||
|
||||
bool game_server::BUpdateUserData(steam_id steamIDUser, const char* pchPlayerName, unsigned int uScore)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
void game_server::SendUserDisconnect(steam_id steamIDUser)
|
||||
{
|
||||
}
|
||||
|
||||
int game_server::GetAuthSessionTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool game_server::BUpdateUserData(steam_id steamIDUser, const char* pchPlayerName, unsigned int uScore)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int game_server::BeginAuthSession(const void* pAuthTicket, int cbAuthTicket, steam_id steamID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int game_server::GetAuthSessionTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void game_server::EndAuthSession(steam_id steamID)
|
||||
{
|
||||
}
|
||||
int game_server::BeginAuthSession(const void* pAuthTicket, int cbAuthTicket, steam_id steamID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void game_server::CancelAuthTicket(int hAuthTicket)
|
||||
{
|
||||
}
|
||||
void game_server::EndAuthSession(steam_id steamID)
|
||||
{
|
||||
}
|
||||
|
||||
int game_server::UserHasLicenseForApp(steam_id steamID, unsigned int appID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
void game_server::CancelAuthTicket(int hAuthTicket)
|
||||
{
|
||||
}
|
||||
|
||||
bool game_server::RequestUserGroupStatus(steam_id steamIDUser, steam_id steamIDGroup)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int game_server::UserHasLicenseForApp(steam_id steamID, unsigned int appID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void game_server::GetGameplayStats()
|
||||
{
|
||||
}
|
||||
bool game_server::RequestUserGroupStatus(steam_id steamIDUser, steam_id steamIDGroup)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned long long game_server::GetServerReputation()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
void game_server::GetGameplayStats()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned int game_server::GetPublicIP()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned long long game_server::GetServerReputation()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool game_server::HandleIncomingPacket(const void* pData, int cbData, unsigned int srcIP, unsigned short srcPort)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
unsigned int game_server::GetPublicIP()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int game_server::GetNextOutgoingPacket(void* pOut, int cbMaxOut, unsigned int* pNetAdr, unsigned short* pPort)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool game_server::HandleIncomingPacket(const void* pData, int cbData, unsigned int srcIP, unsigned short srcPort)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void game_server::EnableHeartbeats(bool bActive)
|
||||
{
|
||||
}
|
||||
int game_server::GetNextOutgoingPacket(void* pOut, int cbMaxOut, unsigned int* pNetAdr, unsigned short* pPort)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void game_server::SetHeartbeatInterval(int iHeartbeatInterval)
|
||||
{
|
||||
}
|
||||
void game_server::EnableHeartbeats(bool bActive)
|
||||
{
|
||||
}
|
||||
|
||||
void game_server::ForceHeartbeat()
|
||||
{
|
||||
}
|
||||
void game_server::SetHeartbeatInterval(int iHeartbeatInterval)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned long long game_server::AssociateWithClan(steam_id clanID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
void game_server::ForceHeartbeat()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned long long game_server::ComputeNewPlayerCompatibility(steam_id steamID)
|
||||
{
|
||||
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
|
@ -2,54 +2,56 @@
|
||||
|
||||
namespace steam
|
||||
{
|
||||
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);
|
||||
};
|
||||
}
|
||||
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
|
||||
|
@ -1,227 +1,233 @@
|
||||
#include <std_include.hpp>
|
||||
|
||||
#include "steam/steam.hpp"
|
||||
|
||||
#include <utils/string.hpp>
|
||||
#include "../steam.hpp"
|
||||
|
||||
namespace steam
|
||||
{
|
||||
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;
|
||||
}
|
||||
int matchmaking::GetFavoriteGameCount()
|
||||
{
|
||||
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::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::RemoveFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort,
|
||||
unsigned short nQueryPort, unsigned int unFlags)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
unsigned long long matchmaking::RequestLobbyList()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool matchmaking::RemoveFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort,
|
||||
unsigned short nQueryPort, unsigned int unFlags)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void matchmaking::AddRequestLobbyListStringFilter(const char* pchKeyToMatch, const char* pchValueToMatch,
|
||||
int eComparisonType)
|
||||
{
|
||||
}
|
||||
unsigned long long matchmaking::RequestLobbyList()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void matchmaking::AddRequestLobbyListNumericalFilter(const char* pchKeyToMatch, int nValueToMatch,
|
||||
int eComparisonType)
|
||||
{
|
||||
}
|
||||
void matchmaking::AddRequestLobbyListStringFilter(const char* pchKeyToMatch, const char* pchValueToMatch,
|
||||
int eComparisonType)
|
||||
{
|
||||
}
|
||||
|
||||
void matchmaking::AddRequestLobbyListNearValueFilter(const char* pchKeyToMatch, int nValueToBeCloseTo)
|
||||
{
|
||||
}
|
||||
void matchmaking::AddRequestLobbyListNumericalFilter(const char* pchKeyToMatch, int nValueToMatch,
|
||||
int eComparisonType)
|
||||
{
|
||||
}
|
||||
|
||||
void matchmaking::AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable)
|
||||
{
|
||||
}
|
||||
void matchmaking::AddRequestLobbyListNearValueFilter(const char* pchKeyToMatch, int nValueToBeCloseTo)
|
||||
{
|
||||
}
|
||||
|
||||
void matchmaking::AddRequestLobbyListDistanceFilter(int eLobbyDistanceFilter)
|
||||
{
|
||||
}
|
||||
void matchmaking::AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable)
|
||||
{
|
||||
}
|
||||
|
||||
void matchmaking::AddRequestLobbyListResultCountFilter(int cMaxResults)
|
||||
{
|
||||
}
|
||||
void matchmaking::AddRequestLobbyListDistanceFilter(int eLobbyDistanceFilter)
|
||||
{
|
||||
}
|
||||
|
||||
void matchmaking::AddRequestLobbyListCompatibleMembersFilter(steam_id steamID)
|
||||
{
|
||||
}
|
||||
void matchmaking::AddRequestLobbyListResultCountFilter(int cMaxResults)
|
||||
{
|
||||
}
|
||||
|
||||
steam_id matchmaking::GetLobbyByIndex(int iLobby)
|
||||
{
|
||||
return steam_id();
|
||||
}
|
||||
void matchmaking::AddRequestLobbyListCompatibleMembersFilter(steam_id steamID)
|
||||
{
|
||||
}
|
||||
|
||||
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;
|
||||
steam_id matchmaking::GetLobbyByIndex(int iLobby)
|
||||
{
|
||||
steam_id id;
|
||||
|
||||
id.raw.account_id = 1337132;
|
||||
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;
|
||||
return id;
|
||||
}
|
||||
|
||||
callbacks::return_call(retvals, sizeof(lobby_created), lobby_created::callback_id, result);
|
||||
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;
|
||||
|
||||
matchmaking::JoinLobby(id);
|
||||
id.raw.account_id = SteamUser()->GetSteamID().raw.account_id;
|
||||
id.raw.universe = 1;
|
||||
id.raw.account_type = 8;
|
||||
id.raw.account_instance = 0x40000;
|
||||
|
||||
return result;
|
||||
}
|
||||
retvals->m_e_result = 1;
|
||||
retvals->m_ul_steam_id_lobby = id;
|
||||
|
||||
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_created), lobby_created::callback_id, result);
|
||||
|
||||
callbacks::return_call(retvals, sizeof(lobby_enter), lobby_enter::callback_id, result);
|
||||
matchmaking::JoinLobby(id);
|
||||
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void matchmaking::LeaveLobby(steam_id 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);
|
||||
|
||||
bool matchmaking::InviteUserToLobby(steam_id steamIDLobby, steam_id steamIDInvitee)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int matchmaking::GetNumLobbyMembers(steam_id steamIDLobby)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
void matchmaking::LeaveLobby(steam_id steamIDLobby)
|
||||
{
|
||||
|
||||
steam_id matchmaking::GetLobbyMemberByIndex(steam_id steamIDLobby, int iMember)
|
||||
{
|
||||
return SteamUser()->GetSteamID();
|
||||
}
|
||||
}
|
||||
|
||||
const char* matchmaking::GetLobbyData(steam_id steamIDLobby, const char* pchKey)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
bool matchmaking::InviteUserToLobby(steam_id steamIDLobby, steam_id steamIDInvitee)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool matchmaking::SetLobbyData(steam_id steamIDLobby, const char* pchKey, const char* pchValue)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
int matchmaking::GetNumLobbyMembers(steam_id steamIDLobby)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int matchmaking::GetLobbyDataCount(steam_id steamIDLobby)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
steam_id matchmaking::GetLobbyMemberByIndex(steam_id steamIDLobby, int iMember)
|
||||
{
|
||||
return SteamUser()->GetSteamID();
|
||||
}
|
||||
|
||||
bool matchmaking::GetLobbyDataByIndex(steam_id steamIDLobby, int iLobbyData, char* pchKey, int cchKeyBufferSize,
|
||||
char* pchValue, int cchValueBufferSize)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
const char* matchmaking::GetLobbyData(steam_id steamIDLobby, const char* pchKey)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
bool matchmaking::DeleteLobbyData(steam_id steamIDLobby, const char* pchKey)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool matchmaking::SetLobbyData(steam_id steamIDLobby, const char* pchKey, const char* pchValue)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const char* matchmaking::GetLobbyMemberData(steam_id steamIDLobby, steam_id steamIDUser, const char* pchKey)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
int matchmaking::GetLobbyDataCount(steam_id steamIDLobby)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void matchmaking::SetLobbyMemberData(steam_id steamIDLobby, const char* pchKey, const char* pchValue)
|
||||
{
|
||||
}
|
||||
bool matchmaking::GetLobbyDataByIndex(steam_id steamIDLobby, int iLobbyData, char* pchKey, int cchKeyBufferSize,
|
||||
char* pchValue, int cchValueBufferSize)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool matchmaking::SendLobbyChatMsg(steam_id steamIDLobby, const void* pvMsgBody, int cubMsgBody)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool matchmaking::DeleteLobbyData(steam_id steamIDLobby, const char* pchKey)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int matchmaking::GetLobbyChatEntry(steam_id steamIDLobby, int iChatID, steam_id* pSteamIDUser, void* pvData,
|
||||
int cubData, int* peChatEntryType)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
const char* matchmaking::GetLobbyMemberData(steam_id steamIDLobby, steam_id steamIDUser, const char* pchKey)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
bool matchmaking::RequestLobbyData(steam_id steamIDLobby)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
void matchmaking::SetLobbyMemberData(steam_id steamIDLobby, const char* pchKey, const char* pchValue)
|
||||
{
|
||||
}
|
||||
|
||||
void matchmaking::SetLobbyGameServer(steam_id steamIDLobby, unsigned int unGameServerIP,
|
||||
unsigned short unGameServerPort, steam_id steamIDGameServer)
|
||||
{
|
||||
}
|
||||
bool matchmaking::SendLobbyChatMsg(steam_id steamIDLobby, const void* pvMsgBody, int cubMsgBody)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool matchmaking::GetLobbyGameServer(steam_id steamIDLobby, unsigned int* punGameServerIP,
|
||||
unsigned short* punGameServerPort, steam_id* psteamIDGameServer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int matchmaking::GetLobbyChatEntry(steam_id steamIDLobby, int iChatID, steam_id* pSteamIDUser, void* pvData,
|
||||
int cubData, int* peChatEntryType)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool matchmaking::SetLobbyMemberLimit(steam_id steamIDLobby, int cMaxMembers)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool matchmaking::RequestLobbyData(steam_id steamIDLobby)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int matchmaking::GetLobbyMemberLimit(steam_id steamIDLobby)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
void matchmaking::SetLobbyGameServer(steam_id steamIDLobby, unsigned int unGameServerIP,
|
||||
unsigned short unGameServerPort, steam_id steamIDGameServer)
|
||||
{
|
||||
}
|
||||
|
||||
bool matchmaking::SetLobbyType(steam_id steamIDLobby, int eLobbyType)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool matchmaking::GetLobbyGameServer(steam_id steamIDLobby, unsigned int* punGameServerIP,
|
||||
unsigned short* punGameServerPort, steam_id* psteamIDGameServer)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool matchmaking::SetLobbyJoinable(steam_id steamIDLobby, bool bLobbyJoinable)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool matchmaking::SetLobbyMemberLimit(steam_id steamIDLobby, int cMaxMembers)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
steam_id matchmaking::GetLobbyOwner(steam_id steamIDLobby)
|
||||
{
|
||||
return SteamUser()->GetSteamID();
|
||||
}
|
||||
int matchmaking::GetLobbyMemberLimit(steam_id steamIDLobby)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool matchmaking::SetLobbyOwner(steam_id steamIDLobby, steam_id steamIDNewOwner)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool matchmaking::SetLobbyType(steam_id steamIDLobby, int eLobbyType)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool matchmaking::SetLinkedLobby(steam_id steamIDLobby, steam_id steamIDLobby2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
bool matchmaking::SetLobbyJoinable(steam_id steamIDLobby, bool bLobbyJoinable)
|
||||
{
|
||||
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
|
||||
|
@ -2,78 +2,80 @@
|
||||
|
||||
namespace steam
|
||||
{
|
||||
struct lobby_created final
|
||||
{
|
||||
enum { callback_id = 513 };
|
||||
|
||||
int m_e_result;
|
||||
int m_pad;
|
||||
steam_id m_ul_steam_id_lobby;
|
||||
};
|
||||
struct lobby_created final
|
||||
{
|
||||
enum { callback_id = 513 };
|
||||
|
||||
struct lobby_enter final
|
||||
{
|
||||
enum { callback_id = 504 };
|
||||
int m_e_result;
|
||||
int m_pad;
|
||||
steam_id m_ul_steam_id_lobby;
|
||||
};
|
||||
|
||||
steam_id m_ul_steam_id_lobby;
|
||||
int m_rgf_chat_permissions;
|
||||
bool m_b_locked;
|
||||
int m_e_chat_room_enter_response;
|
||||
};
|
||||
struct lobby_enter final
|
||||
{
|
||||
enum { callback_id = 504 };
|
||||
|
||||
class matchmaking
|
||||
{
|
||||
public:
|
||||
~matchmaking() = default;
|
||||
steam_id m_ul_steam_id_lobby;
|
||||
int m_rgf_chat_permissions;
|
||||
bool m_b_locked;
|
||||
int m_e_chat_room_enter_response;
|
||||
};
|
||||
|
||||
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);
|
||||
};
|
||||
}
|
||||
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
|
||||
|
@ -1,121 +1,123 @@
|
||||
#include <std_include.hpp>
|
||||
#include "steam/steam.hpp"
|
||||
#include "../steam.hpp"
|
||||
|
||||
namespace steam
|
||||
{
|
||||
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::SendP2PPacket(steam_id steamIDRemote, const void* pubData, unsigned int cubData, int eP2PSendType)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool networking::ReadP2PPacket(void* pubDest, unsigned int cubDest, unsigned int* pcubMsgSize,
|
||||
steam_id* psteamIDRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool networking::IsP2PPacketAvailable(unsigned int* pcubMsgSize, int idk)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool networking::AcceptP2PSessionWithUser(steam_id steamIDRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool networking::ReadP2PPacket(void* pubDest, unsigned int cubDest, unsigned int* pcubMsgSize,
|
||||
steam_id* psteamIDRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool networking::CloseP2PSessionWithUser(steam_id steamIDRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool networking::AcceptP2PSessionWithUser(steam_id steamIDRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool networking::CloseP2PChannelWithUser(steam_id steamIDRemote, int iVirtualPort)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool networking::CloseP2PSessionWithUser(steam_id steamIDRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool networking::GetP2PSessionState(steam_id steamIDRemote, void* pConnectionState)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool networking::CloseP2PChannelWithUser(steam_id steamIDRemote, int iVirtualPort)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool networking::AllowP2PPacketRelay(bool bAllow)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool networking::GetP2PSessionState(steam_id steamIDRemote, void* pConnectionState)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned int networking::CreateListenSocket(int nVirtualP2PPort, unsigned int nIP, unsigned short nPort,
|
||||
bool bAllowUseOfPacketRelay)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
bool networking::AllowP2PPacketRelay(bool bAllow)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned int networking::CreateP2PConnectionSocket(steam_id steamIDTarget, int nVirtualPort, int nTimeoutSec,
|
||||
bool bAllowUseOfPacketRelay)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
unsigned int networking::CreateListenSocket(int nVirtualP2PPort, unsigned int nIP, unsigned short nPort,
|
||||
bool bAllowUseOfPacketRelay)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
unsigned int networking::CreateConnectionSocket(unsigned int nIP, unsigned short nPort, int nTimeoutSec)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
unsigned int networking::CreateP2PConnectionSocket(steam_id steamIDTarget, int nVirtualPort, int nTimeoutSec,
|
||||
bool bAllowUseOfPacketRelay)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool networking::DestroySocket(unsigned int hSocket, bool bNotifyRemoteEnd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
unsigned int networking::CreateConnectionSocket(unsigned int nIP, unsigned short nPort, int nTimeoutSec)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool networking::DestroyListenSocket(unsigned int hSocket, bool bNotifyRemoteEnd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool networking::DestroySocket(unsigned int hSocket, bool bNotifyRemoteEnd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool networking::SendDataOnSocket(unsigned int hSocket, void* pubData, unsigned int cubData, bool bReliable)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool networking::DestroyListenSocket(unsigned int hSocket, bool bNotifyRemoteEnd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool networking::IsDataAvailableOnSocket(unsigned int hSocket, unsigned int* pcubMsgSize)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool networking::SendDataOnSocket(unsigned int hSocket, void* pubData, unsigned int cubData, bool bReliable)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool networking::RetrieveDataFromSocket(unsigned int hSocket, void* pubDest, unsigned int cubDest,
|
||||
unsigned int* pcubMsgSize)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool networking::IsDataAvailableOnSocket(unsigned int hSocket, unsigned int* pcubMsgSize)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool networking::IsDataAvailable(unsigned int hListenSocket, unsigned int* pcubMsgSize, unsigned int* phSocket)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool networking::RetrieveDataFromSocket(unsigned int hSocket, void* pubDest, unsigned int cubDest,
|
||||
unsigned int* pcubMsgSize)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool networking::RetrieveData(unsigned int hListenSocket, void* pubDest, unsigned int cubDest,
|
||||
unsigned int* pcubMsgSize, unsigned int* phSocket)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool networking::IsDataAvailable(unsigned int hListenSocket, 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::RetrieveData(unsigned int hListenSocket, void* pubDest, unsigned int cubDest,
|
||||
unsigned int* pcubMsgSize, unsigned int* phSocket)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool networking::GetListenSocketInfo(unsigned int hListenSocket, unsigned int* pnIP, unsigned short* pnPort)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool networking::GetSocketInfo(unsigned int hSocket, steam_id* pSteamIDRemote, int* peSocketStatus,
|
||||
unsigned int* punIPRemote, unsigned short* punPortRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int networking::GetSocketConnectionType(unsigned int hSocket)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool networking::GetListenSocketInfo(unsigned int hListenSocket, unsigned int* pnIP, unsigned short* pnPort)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int networking::GetMaxPacketSize(unsigned int hSocket)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
int networking::GetSocketConnectionType(unsigned int hSocket)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int networking::GetMaxPacketSize(unsigned int hSocket)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace steam
|
||||
|
@ -2,38 +2,40 @@
|
||||
|
||||
namespace steam
|
||||
{
|
||||
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);
|
||||
};
|
||||
}
|
||||
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
|
@ -1,283 +1,285 @@
|
||||
#include <std_include.hpp>
|
||||
#include "steam/steam.hpp"
|
||||
#include "../steam.hpp"
|
||||
|
||||
namespace steam
|
||||
{
|
||||
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;
|
||||
}
|
||||
bool remote_storage::FileWrite(const char* pchFile, const void* pvData, int cubData)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool remote_storage::FileForget(const char* pchFile)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int remote_storage::FileRead(const char* pchFile, void* pvData, int cubDataToRead)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool remote_storage::FileDelete(const char* pchFile)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool remote_storage::FileForget(const char* pchFile)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::FileShare(const char* pchFile)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool remote_storage::FileDelete(const char* pchFile)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool remote_storage::SetSyncPlatforms(const char* pchFile, unsigned int eRemoteStoragePlatform)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
unsigned long long remote_storage::FileShare(const char* pchFile)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::FileWriteStreamOpen(const char* pchFile)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool remote_storage::SetSyncPlatforms(const char* pchFile, unsigned int eRemoteStoragePlatform)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int remote_storage::FileWriteStreamWriteChunk(unsigned long long hStream, const void* pvData, int cubData)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
unsigned long long remote_storage::FileWriteStreamOpen(const char* pchFile)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int remote_storage::FileWriteStreamClose(unsigned long long hStream)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
int remote_storage::FileWriteStreamWriteChunk(unsigned long long hStream, const void* pvData, int cubData)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int remote_storage::FileWriteStreamCancel(unsigned long long hStream)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
int remote_storage::FileWriteStreamClose(unsigned long long hStream)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool remote_storage::FileExists(const char* pchFile)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int remote_storage::FileWriteStreamCancel(unsigned long long hStream)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool remote_storage::FilePersisted(const char* pchFile)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool remote_storage::FileExists(const char* pchFile)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int remote_storage::GetFileSize(const char* pchFile)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool remote_storage::FilePersisted(const char* pchFile)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
long long remote_storage::GetFileTimestamp(const char* pchFile)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int remote_storage::GetFileSize(const char* pchFile)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned remote_storage::GetSyncPlatforms(const char* pchFile)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
long long remote_storage::GetFileTimestamp(const char* pchFile)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int remote_storage::GetFileCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned remote_storage::GetSyncPlatforms(const char* pchFile)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* remote_storage::GetFileNameAndSize(int iFile, int* pnFileSizeInBytes)
|
||||
{
|
||||
*pnFileSizeInBytes = 0;
|
||||
return "";
|
||||
}
|
||||
int remote_storage::GetFileCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool remote_storage::GetQuota(int* pnTotalBytes, int* puAvailableBytes)
|
||||
{
|
||||
*pnTotalBytes = 0x10000000;
|
||||
*puAvailableBytes = 0x10000000;
|
||||
return false;
|
||||
}
|
||||
const char* remote_storage::GetFileNameAndSize(int iFile, int* pnFileSizeInBytes)
|
||||
{
|
||||
*pnFileSizeInBytes = 0;
|
||||
return "";
|
||||
}
|
||||
|
||||
bool remote_storage::IsCloudEnabledForAccount()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool remote_storage::GetQuota(int* pnTotalBytes, int* puAvailableBytes)
|
||||
{
|
||||
*pnTotalBytes = 0x10000000;
|
||||
*puAvailableBytes = 0x10000000;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool remote_storage::IsCloudEnabledForApp()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool remote_storage::IsCloudEnabledForAccount()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void remote_storage::SetCloudEnabledForApp(bool bEnabled)
|
||||
{
|
||||
}
|
||||
bool remote_storage::IsCloudEnabledForApp()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::UGCDownload(unsigned long long hContent, unsigned int uUnk)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
void remote_storage::SetCloudEnabledForApp(bool bEnabled)
|
||||
{
|
||||
}
|
||||
|
||||
bool remote_storage::GetUGCDownloadProgress(unsigned long long hContent, unsigned int* puDownloadedBytes,
|
||||
unsigned int* puTotalBytes)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
unsigned long long remote_storage::UGCDownload(unsigned long long hContent, unsigned int uUnk)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool remote_storage::GetUGCDetails(unsigned long long hContent, unsigned int* pnAppID, char** ppchName,
|
||||
int* pnFileSizeInBytes, steam_id* pSteamIDOwner)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool remote_storage::GetUGCDownloadProgress(unsigned long long hContent, unsigned int* puDownloadedBytes,
|
||||
unsigned int* puTotalBytes)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int remote_storage::UGCRead(unsigned long long hContent, void* pvData, int cubDataToRead, unsigned int uOffset)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool remote_storage::GetUGCDetails(unsigned long long hContent, unsigned int* pnAppID, char** ppchName,
|
||||
int* pnFileSizeInBytes, steam_id* pSteamIDOwner)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int remote_storage::GetCachedUGCCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int remote_storage::UGCRead(unsigned long long hContent, void* pvData, int cubDataToRead, unsigned int uOffset)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::GetCachedUGCHandle(int iCachedContent)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int remote_storage::GetCachedUGCCount()
|
||||
{
|
||||
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::GetCachedUGCHandle(int iCachedContent)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::CreatePublishedFileUpdateRequest(unsigned long long unPublishedFileId)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
bool remote_storage::UpdatePublishedFileFile(unsigned long long hUpdateRequest, const char* pchFile)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
unsigned long long remote_storage::CreatePublishedFileUpdateRequest(unsigned long long unPublishedFileId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool remote_storage::UpdatePublishedFilePreviewFile(unsigned long long hUpdateRequest, const char* pchPreviewFile)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool remote_storage::UpdatePublishedFileFile(unsigned long long hUpdateRequest, const char* pchFile)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool remote_storage::UpdatePublishedFileTitle(unsigned long long hUpdateRequest, const char* pchTitle)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool remote_storage::UpdatePublishedFilePreviewFile(unsigned long long hUpdateRequest, const char* pchPreviewFile)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool remote_storage::UpdatePublishedFileDescription(unsigned long long hUpdateRequest, const char* pchDescription)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool remote_storage::UpdatePublishedFileTitle(unsigned long long hUpdateRequest, const char* pchTitle)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool remote_storage::UpdatePublishedFileVisibility(unsigned long long hUpdateRequest, unsigned int eVisibility)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool remote_storage::UpdatePublishedFileDescription(unsigned long long hUpdateRequest, const char* pchDescription)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool remote_storage::UpdatePublishedFileTags(unsigned long long hUpdateRequest, int* pTags)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool remote_storage::UpdatePublishedFileVisibility(unsigned long long hUpdateRequest, unsigned int eVisibility)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::CommitPublishedFileUpdate(unsigned long long hUpdateRequest)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool remote_storage::UpdatePublishedFileTags(unsigned long long hUpdateRequest, int* pTags)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::GetPublishedFileDetails(unsigned long long unPublishedFileId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned long long remote_storage::CommitPublishedFileUpdate(unsigned long long hUpdateRequest)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::DeletePublishedFile(unsigned long long unPublishedFileId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned long long remote_storage::GetPublishedFileDetails(unsigned long long unPublishedFileId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::EnumerateUserPublishedFiles(unsigned int uStartIndex)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned long long remote_storage::DeletePublishedFile(unsigned long long unPublishedFileId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::SubscribePublishedFile(unsigned long long unPublishedFileId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned long long remote_storage::EnumerateUserPublishedFiles(unsigned int uStartIndex)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::EnumerateUserSubscribedFiles(unsigned int uStartIndex)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned long long remote_storage::SubscribePublishedFile(unsigned long long unPublishedFileId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::UnsubscribePublishedFile(unsigned long long unPublishedFileId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned long long remote_storage::EnumerateUserSubscribedFiles(unsigned int uStartIndex)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool remote_storage::UpdatePublishedFileSetChangeDescription(unsigned long long hUpdateRequest,
|
||||
const char* cszDescription)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
unsigned long long remote_storage::UnsubscribePublishedFile(unsigned long long unPublishedFileId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::GetPublishedItemVoteDetails(unsigned long long unPublishedFileId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool remote_storage::UpdatePublishedFileSetChangeDescription(unsigned long long hUpdateRequest,
|
||||
const char* cszDescription)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::UpdateUserPublishedItemVote(unsigned long long unPublishedFileId, bool bVoteUp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned long long remote_storage::GetPublishedItemVoteDetails(unsigned long long unPublishedFileId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::GetUserPublishedItemVoteDetails(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::EnumerateUserSharedWorkshopFiles(unsigned int nAppId, steam_id creatorSteamID,
|
||||
unsigned int uStartIndex, int* pRequiredTags,
|
||||
int* pExcludedTags)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned long long remote_storage::GetUserPublishedItemVoteDetails(unsigned long long unPublishedFileId)
|
||||
{
|
||||
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::EnumerateUserSharedWorkshopFiles(unsigned int nAppId, steam_id creatorSteamID,
|
||||
unsigned int uStartIndex, int* pRequiredTags,
|
||||
int* pExcludedTags)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::SetUserPublishedFileAction(unsigned long long unPublishedFileId,
|
||||
unsigned int eAction)
|
||||
{
|
||||
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::EnumeratePublishedFilesByUserAction(
|
||||
unsigned int eAction, unsigned int uStartIndex)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
unsigned long long remote_storage::SetUserPublishedFileAction(unsigned long long unPublishedFileId,
|
||||
unsigned int eAction)
|
||||
{
|
||||
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::EnumeratePublishedFilesByUserAction(
|
||||
unsigned int eAction, unsigned int uStartIndex)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long remote_storage::UGCDownloadToLocation(unsigned long long hContent, const char* cszLocation,
|
||||
unsigned int uUnk)
|
||||
{
|
||||
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
|
||||
|
@ -2,62 +2,64 @@
|
||||
|
||||
namespace steam
|
||||
{
|
||||
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);
|
||||
};
|
||||
}
|
||||
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
|
@ -1,164 +1,167 @@
|
||||
#include <std_include.hpp>
|
||||
#include "steam/steam.hpp"
|
||||
|
||||
#include <utils/cryptography.hpp>
|
||||
#include "../steam.hpp"
|
||||
|
||||
#include "component/auth.hpp"
|
||||
|
||||
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();
|
||||
printf("STEAMBITS: %llu\n", id.bits);
|
||||
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)
|
||||
{
|
||||
// Generate the authentication ticket
|
||||
const auto id = this->GetSteamID();
|
||||
unsigned long long user::RequestEncryptedAppTicket(void* pUserData, int cbUserData)
|
||||
{
|
||||
printf("[steam_api]: [user]: request encrypted app ticket\n");
|
||||
// Generate the authentication ticket
|
||||
const auto id = this->GetSteamID();
|
||||
|
||||
auth_ticket = "S1";
|
||||
auth_ticket.resize(32);
|
||||
auth_ticket.append(reinterpret_cast<char*>(pUserData), cbUserData);
|
||||
auth_ticket.append(reinterpret_cast<const char*>(&id.bits), sizeof(id.bits));
|
||||
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)
|
||||
{
|
||||
if (cbMaxTicket < 0 || auth_ticket.empty()) return false;
|
||||
bool user::GetEncryptedAppTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket)
|
||||
{
|
||||
printf("[steam_api]: [user]: sending encrypted app ticket\n");
|
||||
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;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace steam
|
@ -2,54 +2,56 @@
|
||||
|
||||
namespace steam
|
||||
{
|
||||
struct encrypted_app_ticket_response final
|
||||
{
|
||||
enum { callback_id = 154 };
|
||||
|
||||
int m_e_result;
|
||||
};
|
||||
struct encrypted_app_ticket_response final
|
||||
{
|
||||
enum { callback_id = 154 };
|
||||
|
||||
struct get_auth_session_ticket_response
|
||||
{
|
||||
enum { callback_id = 163 };
|
||||
|
||||
unsigned int m_h_auth_ticket;
|
||||
int m_e_result;
|
||||
};
|
||||
int m_e_result;
|
||||
};
|
||||
|
||||
class user
|
||||
{
|
||||
public:
|
||||
~user() = default;
|
||||
struct get_auth_session_ticket_response
|
||||
{
|
||||
enum { callback_id = 163 };
|
||||
|
||||
virtual int GetHSteamUser();
|
||||
virtual bool LoggedOn();
|
||||
virtual steam_id GetSteamID();
|
||||
unsigned int m_h_auth_ticket;
|
||||
int m_e_result;
|
||||
};
|
||||
|
||||
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);
|
||||
};
|
||||
}
|
||||
class user
|
||||
{
|
||||
public:
|
||||
~user() = default;
|
||||
|
||||
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
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user