mirror of
https://github.com/XLabsProject/s1x-client.git
synced 2023-08-02 15:02:12 +02:00
Unlock variants and enable virtuallobby
This commit is contained in:
parent
3397d0435b
commit
796a8931a0
@ -81,7 +81,7 @@ namespace bots
|
||||
|
||||
command::add("spawnBot", [](const command::params& params)
|
||||
{
|
||||
if (!game::SV_Loaded()) return;
|
||||
if (!game::SV_Loaded() || game::VirtualLobby_Loaded()) return;
|
||||
|
||||
auto num_bots = 1;
|
||||
if (params.size() == 2)
|
||||
|
@ -150,6 +150,9 @@ namespace dedicated
|
||||
return;
|
||||
}
|
||||
|
||||
// Disable VirtualLobby
|
||||
dvars::override::Dvar_RegisterBool("virtualLobbyEnabled", false, game::DVAR_FLAG_NONE | game::DVAR_FLAG_READ);
|
||||
|
||||
// Disable r_preloadShaders
|
||||
dvars::override::Dvar_RegisterBool("r_preloadShaders", false, game::DVAR_FLAG_NONE | game::DVAR_FLAG_READ);
|
||||
|
||||
|
@ -56,8 +56,11 @@ namespace fastfiles
|
||||
return;
|
||||
}
|
||||
|
||||
const char* name = params.get(1);
|
||||
game::DB_LoadXAssets(&name, 1u, game::DBSyncMode::DB_LOAD_SYNC);
|
||||
game::XZoneInfo info;
|
||||
info.name = params.get(1);
|
||||
info.allocFlags = 1;
|
||||
info.freeFlags = 0;
|
||||
game::DB_LoadXAssets(&info, 1u, game::DBSyncMode::DB_LOAD_SYNC);
|
||||
});
|
||||
|
||||
command::add("materiallist", [](const command::params& params)
|
||||
|
@ -78,6 +78,9 @@ namespace gameplay
|
||||
utils::hook::jump(0x14014DF91, pm_bouncing_stub_mp, true);
|
||||
dvars::pm_bouncing = game::Dvar_RegisterBool("pm_bouncing", false,
|
||||
game::DVAR_FLAG_REPLICATED, "Enable bouncing");
|
||||
|
||||
// Change jump_slowdownEnable dvar flags to just "replicated"
|
||||
utils::hook::set<uint8_t>(0x140135992, game::DVAR_FLAG_REPLICATED);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -103,6 +103,12 @@ namespace map_rotation
|
||||
else if (key == "map")
|
||||
{
|
||||
store_new_rotation(rotation, i + 2);
|
||||
if (!game::SV_MapExists(value.data()))
|
||||
{
|
||||
printf("map_rotation: '%s' map doesn't exist!\n", value.data());
|
||||
launch_default_map();
|
||||
return;
|
||||
}
|
||||
launch_map(value);
|
||||
return;
|
||||
}
|
||||
|
@ -68,6 +68,9 @@ namespace party
|
||||
|
||||
perform_game_initialization();
|
||||
|
||||
// exit from virtuallobby
|
||||
reinterpret_cast<void(*)()>(0x14020EB90)();
|
||||
|
||||
// CL_ConnectFromParty
|
||||
char session_info[0x100] = {};
|
||||
reinterpret_cast<void(*)(int, char*, const game::netadr_s*, const char*, const char*)>(0x140209360)(
|
||||
@ -212,7 +215,7 @@ namespace party
|
||||
|
||||
auto* current_mapname = game::Dvar_FindVar("mapname");
|
||||
if (current_mapname && utils::string::to_lower(current_mapname->current.string) ==
|
||||
utils::string::to_lower(mapname) && game::SV_Loaded())
|
||||
utils::string::to_lower(mapname) && (game::SV_Loaded() && !game::VirtualLobby_Loaded()))
|
||||
{
|
||||
printf("Restarting map: %s\n", mapname.data());
|
||||
command::execute("map_restart", false);
|
||||
@ -228,6 +231,13 @@ namespace party
|
||||
}
|
||||
command::execute(utils::string::va("ui_mapname %s", mapname.data()), true);
|
||||
|
||||
/*auto* maxclients = game::Dvar_FindVar("sv_maxclients");
|
||||
if (maxclients)
|
||||
{
|
||||
command::execute(utils::string::va("ui_maxclients %i", maxclients->current.integer), true);
|
||||
command::execute(utils::string::va("party_maxplayers %i", maxclients->current.integer), true);
|
||||
}*/
|
||||
|
||||
// StartServer
|
||||
reinterpret_cast<void(*)(unsigned int)>(0x140492260)(0);
|
||||
|
||||
@ -238,7 +248,7 @@ namespace party
|
||||
|
||||
void send_disconnect()
|
||||
{
|
||||
if (game::CL_IsCgameInitialized())
|
||||
if (game::CL_IsCgameInitialized() && !game::VirtualLobby_Loaded())
|
||||
{
|
||||
// CL_ForwardCommandToServer
|
||||
reinterpret_cast<void (*)(int, const char*)>(0x14020B310)(0, "disconnect");
|
||||
@ -284,7 +294,7 @@ namespace party
|
||||
|
||||
command::add("map_restart", []()
|
||||
{
|
||||
if (!game::SV_Loaded())
|
||||
if (!game::SV_Loaded() || game::VirtualLobby_Loaded())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -296,7 +306,7 @@ namespace party
|
||||
|
||||
command::add("fast_restart", []()
|
||||
{
|
||||
if (game::SV_Loaded())
|
||||
if (game::SV_Loaded() && !game::VirtualLobby_Loaded())
|
||||
{
|
||||
game::SV_FastRestart(0);
|
||||
}
|
||||
|
@ -18,25 +18,6 @@ namespace patches
|
||||
{
|
||||
namespace
|
||||
{
|
||||
game::dvar_t* register_virtual_lobby_enabled_stub(const char* name, bool /*value*/,
|
||||
unsigned int /*flags*/,
|
||||
const char* description)
|
||||
{
|
||||
return game::Dvar_RegisterBool(name, false, game::DVAR_FLAG_READ, description);
|
||||
}
|
||||
|
||||
game::dvar_t* register_virtual_lobby_stubs(const char* name, bool value,
|
||||
unsigned int /*flags*/,
|
||||
const char* description)
|
||||
{
|
||||
if (game::Com_GetCurrentCoDPlayMode() == game::CODPLAYMODE_CORE)
|
||||
{
|
||||
value = true;
|
||||
}
|
||||
|
||||
return game::Dvar_RegisterBool(name, value, game::DVAR_FLAG_READ, description);
|
||||
}
|
||||
|
||||
utils::hook::detour live_get_local_client_name_hook;
|
||||
|
||||
const char* live_get_local_client_name()
|
||||
@ -80,7 +61,7 @@ namespace patches
|
||||
}
|
||||
|
||||
game::dvar_t* register_cg_fov_stub(const char* name, float value, float min, float /*max*/,
|
||||
const unsigned int flags,
|
||||
const unsigned int /*flags*/,
|
||||
const char* description)
|
||||
{
|
||||
return game::Dvar_RegisterFloat(name, value, min, 160, game::DVAR_FLAG_SAVED, description);
|
||||
@ -90,8 +71,7 @@ namespace patches
|
||||
unsigned int /*flags*/,
|
||||
const char* desc)
|
||||
{
|
||||
// changed max value from 2.0f -> 5.0f and min value from 0.5f -> 0.1f
|
||||
return game::Dvar_RegisterFloat(name, 1.0f, 0.1f, 5.0f, game::DVAR_FLAG_SAVED, desc);
|
||||
return game::Dvar_RegisterFloat(name, 1.0f, 0.2f, 5.0f, game::DVAR_FLAG_SAVED, desc);
|
||||
}
|
||||
|
||||
int dvar_command_patch() // game makes this return an int and compares with eax instead of al -_-
|
||||
@ -193,7 +173,7 @@ namespace patches
|
||||
// Unlock fps in main menu
|
||||
utils::hook::set<BYTE>(SELECT_VALUE(0x140144F5B, 0x140213C3B), 0xEB);
|
||||
|
||||
// Unlock fps
|
||||
// Unlock com_maxfps
|
||||
utils::hook::call(SELECT_VALUE(0x1402F8726, 0x1403CF8CA), register_com_maxfps_stub);
|
||||
|
||||
// Unlock cg_fov
|
||||
@ -230,11 +210,6 @@ namespace patches
|
||||
|
||||
static void patch_mp()
|
||||
{
|
||||
// Disable virtualLobby
|
||||
utils::hook::call(0x1403CFDCC, register_virtual_lobby_enabled_stub); // virtualLobbyEnabled
|
||||
//utils::hook::call(0x14013E0C0, register_virtual_lobby_stubs); // virtualLobbyReady
|
||||
utils::hook::call(0x1403CFE6A, register_virtual_lobby_stubs); // virtualLobbyAllocated
|
||||
|
||||
// Use name dvar
|
||||
live_get_local_client_name_hook.create(0x1404D47F0, &live_get_local_client_name);
|
||||
|
||||
@ -256,6 +231,7 @@ namespace patches
|
||||
// unlock all items
|
||||
utils::hook::jump(0x1403BD790, is_item_unlocked); // LiveStorage_IsItemUnlockedFromTable_LocalClient
|
||||
utils::hook::jump(0x1403BD290, is_item_unlocked); // LiveStorage_IsItemUnlockedFromTable
|
||||
utils::hook::jump(0x1403BAF60, is_item_unlocked); // idk ( unlocks loot etc )
|
||||
|
||||
// disable emblems
|
||||
dvars::override::Dvar_RegisterInt("emblems_active", 0, 0, 0, game::DVAR_FLAG_NONE);
|
||||
|
@ -5,9 +5,17 @@ namespace demonware
|
||||
{
|
||||
bdMarketing::bdMarketing() : service(139, "bdMarketing")
|
||||
{
|
||||
this->register_task(2, &bdMarketing::unk2);
|
||||
this->register_task(3, &bdMarketing::unk3);
|
||||
}
|
||||
|
||||
void bdMarketing::unk2(service_server* server, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
auto reply = server->create_reply(this->task_id());
|
||||
reply->send();
|
||||
}
|
||||
|
||||
void bdMarketing::unk3(service_server* server, byte_buffer* buffer) const
|
||||
{
|
||||
// TODO:
|
||||
|
@ -8,6 +8,7 @@ namespace demonware
|
||||
bdMarketing();
|
||||
|
||||
private:
|
||||
void unk2(service_server* server, byte_buffer* buffer) const;
|
||||
void unk3(service_server* server, byte_buffer* buffer) const;
|
||||
};
|
||||
}
|
||||
|
@ -23,6 +23,11 @@ namespace game
|
||||
return sv_cmd_args->argv[sv_cmd_args->nesting][index];
|
||||
}
|
||||
|
||||
bool VirtualLobby_Loaded()
|
||||
{
|
||||
return *mp::virtualLobby_loaded == 1;
|
||||
}
|
||||
|
||||
namespace environment
|
||||
{
|
||||
launcher::mode mode = launcher::mode::none;
|
||||
|
@ -63,6 +63,8 @@ namespace game
|
||||
|
||||
int SV_Cmd_Argc();
|
||||
const char* SV_Cmd_Argv(int index);
|
||||
|
||||
bool VirtualLobby_Loaded();
|
||||
}
|
||||
|
||||
#include "symbols.hpp"
|
||||
|
@ -9,6 +9,11 @@ namespace game
|
||||
typedef vec_t vec3_t[3];
|
||||
typedef vec_t vec4_t[4];
|
||||
|
||||
enum scr_string_t
|
||||
{
|
||||
scr_string_t_dummy = 0x0,
|
||||
};
|
||||
|
||||
enum Sys_Folder
|
||||
{
|
||||
SF_ZONE = 0x0,
|
||||
@ -812,6 +817,13 @@ namespace game
|
||||
DB_LOAD_SYNC_SKIP_ALWAYS_LOADED = 0x5,
|
||||
};
|
||||
|
||||
struct XZoneInfo
|
||||
{
|
||||
const char* name;
|
||||
int allocFlags;
|
||||
int freeFlags;
|
||||
};
|
||||
|
||||
enum XAssetType
|
||||
{
|
||||
ASSET_TYPE_PHYSPRESET,
|
||||
|
@ -36,7 +36,7 @@ namespace game
|
||||
|
||||
WEAK symbol<void(XAssetType type, void(__cdecl* func)(XAssetHeader, void*), void* inData, bool includeOverride)> DB_EnumXAssets_FastFile{ 0x14017D7C0, 0x14026EC10 };
|
||||
WEAK symbol<int(XAssetType type)> DB_GetXAssetTypeSize{ 0x140151C20, 0x140240DF0 };
|
||||
WEAK symbol<void(const char** zoneNames, unsigned int zoneCount, DBSyncMode syncMode)> DB_LoadXAssets{ 0x1402F8B50, 0x140270F30 };
|
||||
WEAK symbol<void(XZoneInfo* zoneInfo, unsigned int zoneCount, DBSyncMode syncMode)> DB_LoadXAssets{ 0x1402F8B50, 0x140270F30 };
|
||||
|
||||
WEAK symbol<dvar_t* (const char* name)> Dvar_FindVar{ 0x140370860, 0x1404BF8B0 };
|
||||
WEAK symbol<void(const dvar_t* dvar)> Dvar_ClearModified{ 0x140370700, 0x1404BF690 };
|
||||
@ -113,6 +113,8 @@ namespace game
|
||||
WEAK symbol<int()> Scr_GetNumParam{ 0x14031C2A0, 0x1403F8980 };
|
||||
WEAK symbol<void()> Scr_ClearOutParams{ 0x14031B7C0, 0x1403F8040 };
|
||||
|
||||
WEAK symbol<scr_string_t(const char* str)> SL_FindString{ 0x140314AF0, 0x1403F11C0 };
|
||||
|
||||
WEAK symbol<void(const char* text_in)> SV_Cmd_TokenizeString{ 0, 0x1403B0640 };
|
||||
WEAK symbol<void()> SV_Cmd_EndTokenizedString{ 0, 0x1403B0600 };
|
||||
|
||||
@ -185,6 +187,8 @@ namespace game
|
||||
WEAK symbol<int> svs_numclients{ 0, 0x1496C4B0C };
|
||||
|
||||
WEAK symbol<int> sv_serverId_value{ 0, 0x1488A9A60 };
|
||||
|
||||
WEAK symbol<char> virtualLobby_loaded{ 0, 0x1417E161D };
|
||||
}
|
||||
|
||||
namespace sp
|
||||
|
Loading…
Reference in New Issue
Block a user