From 64b58e7ead844506187e2b533a51f6a06192d736 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Tue, 11 Apr 2023 20:51:46 +0200 Subject: [PATCH 01/13] feat(patches): fix unknown password command --- src/client/component/patches.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/client/component/patches.cpp b/src/client/component/patches.cpp index bfec3e5c..0900b5a8 100644 --- a/src/client/component/patches.cpp +++ b/src/client/component/patches.cpp @@ -2,6 +2,10 @@ #include "loader/component_loader.hpp" #include +#include + +#include "scheduler.hpp" + #include namespace patches @@ -34,6 +38,11 @@ namespace patches utils::hook::set(game::select(0x14224DA53, 0x140531143), 3); utils::hook::set(game::select(0x14224DBB4, 0x1405312A8), 3); utils::hook::set(game::select(0x14224DF8C, 0x1405316DC), 3); + + scheduler::once([] + { + game::register_dvar_string("password", "", game::DVAR_USERINFO, "password"); + }, scheduler::pipeline::main); } }; } From ee85545e5a4dca75ddb2bb59974ac4862c0de91c Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Wed, 12 Apr 2023 15:47:38 +0200 Subject: [PATCH 02/13] Mods support for dedicated servers --- src/client/component/getinfo.cpp | 3 + src/client/component/party.cpp | 21 ++- src/client/component/workshop.cpp | 162 ++++++++++++++---- src/client/component/workshop.hpp | 6 +- src/client/game/symbols.hpp | 2 +- .../steam/interfaces/matchmaking_servers.cpp | 6 +- 6 files changed, 151 insertions(+), 49 deletions(-) diff --git a/src/client/component/getinfo.cpp b/src/client/component/getinfo.cpp index 83d8209b..505c0dd6 100644 --- a/src/client/component/getinfo.cpp +++ b/src/client/component/getinfo.cpp @@ -5,6 +5,7 @@ #include "steam/steam.hpp" #include "network.hpp" +#include "workshop.hpp" #include #include @@ -114,6 +115,8 @@ namespace getinfo info.set("sv_running", std::to_string(game::is_server_running())); info.set("dedicated", game::is_server() ? "1" : "0"); info.set("hc", std::to_string(game::Com_GametypeSettings_GetUInt("hardcoremode", false))); + info.set("modname", workshop::get_mod_name(game::get_dvar_string("fs_game"))); + info.set("fs_game", game::get_dvar_string("fs_game")); info.set("shortversion", SHORTVERSION); network::send(target, "infoResponse", info.build(), '\n'); diff --git a/src/client/component/party.cpp b/src/client/component/party.cpp index 7a80a301..837a97f9 100644 --- a/src/client/component/party.cpp +++ b/src/client/component/party.cpp @@ -37,12 +37,12 @@ namespace party } void connect_to_lobby(const game::netadr_t& addr, const std::string& mapname, const std::string& gamemode, - const std::string& pub_id) + const std::string& usermap_id, const std::string& mod_id) { - workshop::load_usermap_mod_if_needed(pub_id); + workshop::load_mod_if_needed(usermap_id, mod_id); game::XSESSION_INFO info{}; - game::CL_ConnectFromLobby(0, &info, &addr, 1, 0, mapname.data(), gamemode.data(), pub_id.data()); + game::CL_ConnectFromLobby(0, &info, &addr, 1, 0, mapname.data(), gamemode.data(), usermap_id.data()); } void launch_mode(const game::eModes mode) @@ -56,12 +56,12 @@ namespace party } void connect_to_lobby_with_mode(const game::netadr_t& addr, const game::eModes mode, const std::string& mapname, - const std::string& gametype, const std::string& pub_id, + const std::string& gametype, const std::string& usermap_id, const std::string& mod_id, const bool was_retried = false) { if (game::Com_SessionMode_IsMode(mode)) { - connect_to_lobby(addr, mapname, gametype, pub_id); + connect_to_lobby(addr, mapname, gametype, usermap_id, mod_id); return; } @@ -69,7 +69,7 @@ namespace party { scheduler::once([=] { - connect_to_lobby_with_mode(addr, mode, mapname, gametype, pub_id, true); + connect_to_lobby_with_mode(addr, mode, mapname, gametype, usermap_id, mod_id, true); }, scheduler::main, 5s); launch_mode(mode); @@ -177,6 +177,8 @@ namespace party return; } + const auto mod_id = info.get("fs_game"); + //const auto hostname = info.get("sv_hostname"); const auto playmode = info.get("playmode"); const auto mode = static_cast(std::atoi(playmode.data())); @@ -184,9 +186,10 @@ namespace party scheduler::once([=] { - const auto publisher_id = workshop::get_usermap_publisher_id(mapname); + const auto usermap_id = workshop::get_usermap_publisher_id(mapname); - if (workshop::check_valid_publisher_id(mapname, publisher_id)) + if (workshop::check_valid_usermap_id(mapname, usermap_id) && + workshop::check_valid_mod_id(mod_id)) { if (is_connecting_to_dedi) { @@ -194,7 +197,7 @@ namespace party } //connect_to_session(target, hostname, xuid, mode); - connect_to_lobby_with_mode(target, mode, mapname, gametype, publisher_id); + connect_to_lobby_with_mode(target, mode, mapname, gametype, usermap_id, mod_id); } }, scheduler::main); } diff --git a/src/client/component/workshop.cpp b/src/client/component/workshop.cpp index cb732447..824c74a5 100644 --- a/src/client/component/workshop.cpp +++ b/src/client/component/workshop.cpp @@ -5,48 +5,39 @@ #include "game/game.hpp" #include +#include +#include namespace workshop { - const std::string get_usermap_publisher_id(const std::string& mapname) - { - const auto total_usermaps = *reinterpret_cast(0x1567B3580_g); - - for (unsigned int i = 0; i < total_usermaps; ++i) - { - const auto usermap_data = reinterpret_cast(0x1567B3588_g + (sizeof(game::workshop_data) * i)); - if (usermap_data->folderName == mapname) - { - return usermap_data->publisherId; - } - } - - return ""; - } - - bool check_valid_publisher_id(const std::string& mapname, const std::string& pub_id) - { - if (!game::DB_FileExists(mapname.data(), 0) && pub_id.empty()) - { - game::Com_Error(0, "Can't find usermap: %s!\nMake sure you're subscribed to the workshop item.", mapname.data()); - return false; - } - - return true; - } - - void load_usermap_mod_if_needed(const std::string& pub_id) - { - if (!game::isModLoaded() && !pub_id.empty()) - { - game::loadMod(0, "usermaps", 0); - } - } - namespace { utils::hook::detour setup_server_map_hook; + bool has_mod(const std::string& pub_id) + { + const auto total_mods = *reinterpret_cast(0x15678D170_g); + + for (unsigned int i = 0; i < total_mods; ++i) + { + const auto mod_data = reinterpret_cast(0x15678D178_g + (sizeof(game::workshop_data) * i)); + if (mod_data->publisherId == pub_id) + { + return true; + } + } + + return false; + } + + void load_usermap_mod_if_needed(const std::string& publisher_id) + { + if (!game::isModLoaded() && !publisher_id.empty()) + { + game::loadMod(0, "usermaps", true); + } + } + void setup_server_map_stub(int localClientNum, const char* mapname, const char* gametype) { const auto publisher_id = get_usermap_publisher_id(mapname); @@ -72,6 +63,107 @@ namespace workshop } } + const std::string get_mod_name(const std::string& mod_id) + { + if (mod_id == "usermaps") + { + return mod_id; + } + + const utils::nt::library host{}; + std::string path; + + if (game::is_server()) + { + const auto base_path = host.get_folder().generic_string(); + path = utils::string::va("%s/mods/%s/zone/workshop.json", base_path.data(), mod_id.data()); + } + else + { + return mod_id; + } + + std::string json_str; + utils::io::read_file(path, &json_str); + + if (json_str.empty()) + { + printf("[ Workshop ] Workshop.json has not been found in mod folder: %s", mod_id.data()); + return mod_id; + } + + rapidjson::Document doc; + doc.Parse(json_str); + + if (doc.HasMember("Title")) + { + std::string title = doc["Title"].GetString(); + + if (title.size() > 31) + { + title.resize(31); + } + + return title; + } + else + { + printf("[ Workshop ] Workshop.json has no \"Title\" member."); + return mod_id; + } + } + + const std::string get_usermap_publisher_id(const std::string& mapname) + { + const auto total_usermaps = *reinterpret_cast(0x1567B3580_g); + + for (unsigned int i = 0; i < total_usermaps; ++i) + { + const auto usermap_data = reinterpret_cast(0x1567B3588_g + (sizeof(game::workshop_data) * i)); + if (usermap_data->folderName == mapname) + { + return usermap_data->publisherId; + } + } + + return {}; + } + + bool check_valid_usermap_id(const std::string& mapname, const std::string& pub_id) + { + if (!game::DB_FileExists(mapname.data(), 0) && pub_id.empty()) + { + game::Com_Error(0, "Can't find usermap: %s!\nMake sure you're subscribed to the workshop item.", mapname.data()); + return false; + } + + return true; + } + + bool check_valid_mod_id(const std::string& mod) + { + if (mod.empty() || mod == "usermaps") + { + return true; + } + + if (!has_mod(mod)) + { + game::Com_Error(0, "Can't find mod with publisher id: %s!\nMake sure you're subscribed to the workshop item.", mod.data()); + return false; + } + + return true; + } + + void load_mod_if_needed(const std::string& usermap, const std::string& mod) + { + if (!usermap.empty() || mod != "usermaps") + { + game::loadMod(0, mod.data(), true); + } + } + class component final : public client_component { public: diff --git a/src/client/component/workshop.hpp b/src/client/component/workshop.hpp index 1e6776c2..71e5098b 100644 --- a/src/client/component/workshop.hpp +++ b/src/client/component/workshop.hpp @@ -3,6 +3,8 @@ namespace workshop { const std::string get_usermap_publisher_id(const std::string& mapname); - bool check_valid_publisher_id(const std::string& mapname, const std::string& pub_id); - void load_usermap_mod_if_needed(const std::string& pub_id); + const std::string get_mod_name(const std::string& mod_id); + bool check_valid_usermap_id(const std::string& mapname, const std::string& pub_id); + bool check_valid_mod_id(const std::string& pub_id); + void load_mod_if_needed(const std::string& usermap, const std::string& mod); } diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 38090235..3ede8880 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -98,7 +98,7 @@ namespace game WEAK symbol CopyString{0x1422AC220, 0x14056BD70}; WEAK symbol isModLoaded{0x1420D5020}; - WEAK symbol loadMod{0x1420D6930}; + WEAK symbol loadMod{0x1420D6930}; // Dvar WEAK symbol Dvar_IsSessionModeBaseDvar{0x1422C23A0, 0x140576890}; diff --git a/src/client/steam/interfaces/matchmaking_servers.cpp b/src/client/steam/interfaces/matchmaking_servers.cpp index 79f0f784..b2996171 100644 --- a/src/client/steam/interfaces/matchmaking_servers.cpp +++ b/src/client/steam/interfaces/matchmaking_servers.cpp @@ -55,12 +55,14 @@ namespace steam const auto mode = game::eModes(std::atoi(playmode.data())); const auto* tags = ::utils::string::va( - R"(\gametype\%s\dedicated\%s\ranked\false\hardcore\%s\zombies\%s\modName\\playerCount\%d\bots\%d\)", + R"(\gametype\%s\dedicated\%s\ranked\false\hardcore\%s\zombies\%s\playerCount\%d\bots\%d\modName\%s\)", info.get("gametype").data(), info.get("dedicated") == "1" ? "true" : "false", info.get("hc") == "1" ? "true" : "false", mode == game::MODE_ZOMBIES ? "true" : "false", - server.m_nPlayers, atoi(info.get("bots").data())); + server.m_nPlayers, + atoi(info.get("bots").data()), + info.get("modname").data()); ::utils::string::copy(server.m_szGameTags, tags); server.m_steamID.bits = strtoull(info.get("xuid").data(), nullptr, 16); From 4dc7fcd95e1691945934249281ddf18244261dde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 18:00:38 +0000 Subject: [PATCH 03/13] Bump deps/curl from `dc18b40` to `ca05e1a` Bumps [deps/curl](https://github.com/curl/curl) from `dc18b40` to `ca05e1a`. - [Release notes](https://github.com/curl/curl/releases) - [Commits](https://github.com/curl/curl/compare/dc18b40b406e9946a2198d66b6edb62575660faf...ca05e1afba7088c2f7e96ce47d2d3a249ce7a903) --- updated-dependencies: - dependency-name: deps/curl dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/curl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/curl b/deps/curl index dc18b40b..ca05e1af 160000 --- a/deps/curl +++ b/deps/curl @@ -1 +1 @@ -Subproject commit dc18b40b406e9946a2198d66b6edb62575660faf +Subproject commit ca05e1afba7088c2f7e96ce47d2d3a249ce7a903 From f3ffd7659eb6ecd62bd8d1957d2f390c558d7b0e Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Thu, 13 Apr 2023 11:35:06 +0200 Subject: [PATCH 04/13] Remove const return type --- src/client/component/workshop.cpp | 4 ++-- src/client/component/workshop.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/component/workshop.cpp b/src/client/component/workshop.cpp index 824c74a5..214ef824 100644 --- a/src/client/component/workshop.cpp +++ b/src/client/component/workshop.cpp @@ -63,7 +63,7 @@ namespace workshop } } - const std::string get_mod_name(const std::string& mod_id) + std::string get_mod_name(const std::string& mod_id) { if (mod_id == "usermaps") { @@ -113,7 +113,7 @@ namespace workshop } } - const std::string get_usermap_publisher_id(const std::string& mapname) + std::string get_usermap_publisher_id(const std::string& mapname) { const auto total_usermaps = *reinterpret_cast(0x1567B3580_g); diff --git a/src/client/component/workshop.hpp b/src/client/component/workshop.hpp index 71e5098b..5ef97818 100644 --- a/src/client/component/workshop.hpp +++ b/src/client/component/workshop.hpp @@ -2,8 +2,8 @@ namespace workshop { - const std::string get_usermap_publisher_id(const std::string& mapname); - const std::string get_mod_name(const std::string& mod_id); + std::string get_usermap_publisher_id(const std::string& mapname); + std::string get_mod_name(const std::string& mod_id); bool check_valid_usermap_id(const std::string& mapname, const std::string& pub_id); bool check_valid_mod_id(const std::string& pub_id); void load_mod_if_needed(const std::string& usermap, const std::string& mod); From 2fb7b42be8aa8e4c5d54797c7f9565d2145402f2 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Thu, 13 Apr 2023 13:40:19 +0200 Subject: [PATCH 05/13] Catch parse errors --- src/client/component/workshop.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/client/component/workshop.cpp b/src/client/component/workshop.cpp index 214ef824..f633c691 100644 --- a/src/client/component/workshop.cpp +++ b/src/client/component/workshop.cpp @@ -88,12 +88,18 @@ namespace workshop if (json_str.empty()) { - printf("[ Workshop ] Workshop.json has not been found in mod folder: %s", mod_id.data()); + printf("[ Workshop ] workshop.json has not been found in mod folder: %s\n", mod_id.data()); return mod_id; } rapidjson::Document doc; - doc.Parse(json_str); + const rapidjson::ParseResult parse_result = doc.Parse(json_str); + + if (parse_result.IsError() || !doc.IsObject()) + { + printf("[ Workshop ] Unable to parse workshop.json\n"); + return mod_id; + } if (doc.HasMember("Title")) { @@ -108,7 +114,7 @@ namespace workshop } else { - printf("[ Workshop ] Workshop.json has no \"Title\" member."); + printf("[ Workshop ] workshop.json has no \"Title\" member.\n"); return mod_id; } } From 8372d34c3dbd3b1e005472d2d7cc4337be36b497 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 13 Apr 2023 17:18:07 +0200 Subject: [PATCH 06/13] Don't throw exceptions in list files util --- src/common/utils/io.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/utils/io.cpp b/src/common/utils/io.cpp index e981315d..6efce973 100644 --- a/src/common/utils/io.cpp +++ b/src/common/utils/io.cpp @@ -194,18 +194,19 @@ namespace utils::io std::vector list_files(const std::filesystem::path& directory, const bool recursive) { + std::error_code code{}; std::vector files; if (recursive) { - for (auto& file : std::filesystem::recursive_directory_iterator(directory)) + for (auto& file : std::filesystem::recursive_directory_iterator(directory, code)) { files.push_back(file.path()); } } else { - for (auto& file : std::filesystem::directory_iterator(directory)) + for (auto& file : std::filesystem::directory_iterator(directory, code)) { files.push_back(file.path()); } From 62b14eb542dc9ac3d8f814dce9b7c38d1c724782 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 13 Apr 2023 17:36:59 +0200 Subject: [PATCH 07/13] Prevent the game from modifying the process priority --- src/client/component/client_patches.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/component/client_patches.cpp b/src/client/component/client_patches.cpp index 9d824961..f8a9a9b5 100644 --- a/src/client/component/client_patches.cpp +++ b/src/client/component/client_patches.cpp @@ -116,6 +116,9 @@ namespace client_patches { fix_amd_cpu_stuttering(); + // Don't modify process priority + utils::hook::nop(0x142334C98_g, 6); + // Kill microphones for now utils::hook::set(0x15AAE9254_g, mixer_open_stub); From accf537f50d6cda28c3cdbbef9ff114121f353f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 18:01:06 +0000 Subject: [PATCH 08/13] Bump deps/curl from `ca05e1a` to `7e68133` Bumps [deps/curl](https://github.com/curl/curl) from `ca05e1a` to `7e68133`. - [Release notes](https://github.com/curl/curl/releases) - [Commits](https://github.com/curl/curl/compare/ca05e1afba7088c2f7e96ce47d2d3a249ce7a903...7e68133d041376c1012571e5a2386bb03a620a8e) --- updated-dependencies: - dependency-name: deps/curl dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/curl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/curl b/deps/curl index ca05e1af..7e68133d 160000 --- a/deps/curl +++ b/deps/curl @@ -1 +1 @@ -Subproject commit ca05e1afba7088c2f7e96ce47d2d3a249ce7a903 +Subproject commit 7e68133d041376c1012571e5a2386bb03a620a8e From 81fe6bc7e170f9bef91a89a67eeddb0a1ed982e7 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Thu, 13 Apr 2023 20:17:56 +0200 Subject: [PATCH 09/13] Clean up + remove Com_Errors --- src/client/component/workshop.cpp | 33 +++++++++++-------------------- src/client/game/symbols.hpp | 1 + 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/src/client/component/workshop.cpp b/src/client/component/workshop.cpp index f633c691..f683d4b4 100644 --- a/src/client/component/workshop.cpp +++ b/src/client/component/workshop.cpp @@ -65,26 +65,15 @@ namespace workshop std::string get_mod_name(const std::string& mod_id) { - if (mod_id == "usermaps") + if (mod_id == "usermaps" || !game::is_server()) { return mod_id; } const utils::nt::library host{}; - std::string path; - - if (game::is_server()) - { - const auto base_path = host.get_folder().generic_string(); - path = utils::string::va("%s/mods/%s/zone/workshop.json", base_path.data(), mod_id.data()); - } - else - { - return mod_id; - } - - std::string json_str; - utils::io::read_file(path, &json_str); + const auto base_path = host.get_folder().generic_string(); + const auto path = utils::string::va("%s/mods/%s/zone/workshop.json", base_path.data(), mod_id.data()); + const auto json_str = utils::io::read_file(path); if (json_str.empty()) { @@ -112,11 +101,9 @@ namespace workshop return title; } - else - { - printf("[ Workshop ] workshop.json has no \"Title\" member.\n"); - return mod_id; - } + + printf("[ Workshop ] workshop.json has no \"Title\" member.\n"); + return mod_id; } std::string get_usermap_publisher_id(const std::string& mapname) @@ -139,7 +126,8 @@ namespace workshop { if (!game::DB_FileExists(mapname.data(), 0) && pub_id.empty()) { - game::Com_Error(0, "Can't find usermap: %s!\nMake sure you're subscribed to the workshop item.", mapname.data()); + game::UI_OpenErrorPopupWithMessage(0, 0x100, + utils::string::va("Can't find usermap: %s!\nMake sure you're subscribed to the workshop item.", mapname.data())); return false; } @@ -155,7 +143,8 @@ namespace workshop if (!has_mod(mod)) { - game::Com_Error(0, "Can't find mod with publisher id: %s!\nMake sure you're subscribed to the workshop item.", mod.data()); + game::UI_OpenErrorPopupWithMessage(0, 0x100, + utils::string::va("Can't find mod with publisher id: %s!\nMake sure you're subscribed to the workshop item.", mod.data())); return false; } diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 626d6df1..e011ceef 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -142,6 +142,7 @@ namespace game }; // UI + WEAK symbol UI_OpenErrorPopupWithMessage{0x14228DEE0}; WEAK symbol UI_CoD_Init{0x141F29010, 0x1404A0A50}; WEAK symbol UI_CoD_LobbyUI_Init{0x141F2BD80, 0x1404A1F50}; WEAK symbol UI_CoD_Shutdown{0x141F32E10, 0x0}; From 788d7e72e27d902771105b13c5127588d5be3321 Mon Sep 17 00:00:00 2001 From: efinst0rm Date: Thu, 13 Apr 2023 18:18:07 -0500 Subject: [PATCH 10/13] Update serversettings. Set level.gameForfeited to false. --- data/scripts/mp/gametypes/_serversettings.gsc | Bin 4446 -> 4518 bytes .../mp/gametypes/_serversettings.gsc_raw | 28 ++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/data/scripts/mp/gametypes/_serversettings.gsc b/data/scripts/mp/gametypes/_serversettings.gsc index cd63bd0b2ebb53e9107b14ed65d7fff569375288..0105b093db16db0bee7ce860fc6f1d226bf54fea 100644 GIT binary patch literal 4518 zcmZ8k33yc16+Uk!P>6AiOLaa)eY0ldxY~fwk=EJmGe!ceM5CibxbpTr~J)gWDU{(RZUK~W{Mm|6@>TiX~V1u!r6eN&| zv^S-*8Ed318WZVEw!I^gy{yV48`@)0YosBSYHWx!XF_9wiTX@;CL3$Htc_O;?2IJJiyajgm0;OoY&1+w#t~Yz*uqy~5fq zv!QIPp(T=RXidZ*-rf{zji$QeP3^I4cREH!<7E_YsHGvDY3hlAn+K-@>~1K6L@0q# z2OVDJl^ote3E-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wFQ=yE0J<#}VNS9-q zk39atX{4!=Ct8KJRIw9Xjx<%?L_dx+RZK*mMgLUg5beP^Qe{H)R-~z#Ao?QGQ~?lO Nf^(-=o9OLG{~zTmftmmS diff --git a/data/scripts/mp/gametypes/_serversettings.gsc_raw b/data/scripts/mp/gametypes/_serversettings.gsc_raw index 02669e86..580e2966 100644 --- a/data/scripts/mp/gametypes/_serversettings.gsc_raw +++ b/data/scripts/mp/gametypes/_serversettings.gsc_raw @@ -17,27 +17,33 @@ function __init__() function init() { level.hostname = GetDvarString( "sv_hostname"); - if(level.hostname == "") + if (level.hostname == "") + { level.hostname = "CoDHost"; + } + SetDvar("sv_hostname", level.hostname); SetDvar("ui_hostname", level.hostname); level.motd = GetDvarString( "scr_motd" ); if(level.motd == "") + { level.motd = ""; + } SetDvar("scr_motd", level.motd); SetDvar("ui_motd", level.motd); - level.allowvote = GetDvarString( "g_allowvote"); + level.allowvote = GetDvarString( "g_allowvote" ); if(level.allowvote == "") + { level.allowvote = "1"; + } SetDvar("g_allowvote", level.allowvote); SetDvar("ui_allowvote", level.allowvote); - + level.allow_teamchange = "1"; SetDvar("ui_allow_teamchange", level.allow_teamchange); - level.friendlyfire = GetGametypeSetting( "friendlyfiretype" ); SetDvar("ui_friendlyfire", level.friendlyfire); @@ -57,6 +63,8 @@ function init() constrain_gametype(GetDvarString( "g_gametype")); constrain_map_size(level.mapsize); + thread setup_callbacks(); + for(;;) { update(); @@ -193,4 +201,14 @@ function constrain_map_size(mapsize) } } } -} \ No newline at end of file +} + +function setup_callbacks() +{ + level.onForfeit = &default_onForfeit; +} + +function default_onForfeit() +{ + level.gameForfeited = false; +} From cfed6a5c83361195b89026fb779563497bbccf0d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Apr 2023 18:01:31 +0000 Subject: [PATCH 11/13] Bump deps/curl from `7e68133` to `7ed010c` Bumps [deps/curl](https://github.com/curl/curl) from `7e68133` to `7ed010c`. - [Release notes](https://github.com/curl/curl/releases) - [Commits](https://github.com/curl/curl/compare/7e68133d041376c1012571e5a2386bb03a620a8e...7ed010ce2192ae3e4d9663eaaa3a460f316b708b) --- updated-dependencies: - dependency-name: deps/curl dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/curl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/curl b/deps/curl index 7e68133d..7ed010ce 160000 --- a/deps/curl +++ b/deps/curl @@ -1 +1 @@ -Subproject commit 7e68133d041376c1012571e5a2386bb03a620a8e +Subproject commit 7ed010ce2192ae3e4d9663eaaa3a460f316b708b From b0a6523b6c1f9cc9c1329e0f1fbe419394bd403d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Apr 2023 18:01:34 +0000 Subject: [PATCH 12/13] Bump deps/zlib from `eb0e038` to `5799c14` Bumps [deps/zlib](https://github.com/madler/zlib) from `eb0e038` to `5799c14`. - [Release notes](https://github.com/madler/zlib/releases) - [Commits](https://github.com/madler/zlib/compare/eb0e038b297f2c9877ed8b3515c6718a4b65d485...5799c14c8526bf1aaa130c021982f831d155b46d) --- updated-dependencies: - dependency-name: deps/zlib dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/zlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zlib b/deps/zlib index eb0e038b..5799c14c 160000 --- a/deps/zlib +++ b/deps/zlib @@ -1 +1 @@ -Subproject commit eb0e038b297f2c9877ed8b3515c6718a4b65d485 +Subproject commit 5799c14c8526bf1aaa130c021982f831d155b46d From 230bd784f288850e2564f7455674797829a8616b Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sat, 15 Apr 2023 15:01:12 +0200 Subject: [PATCH 13/13] Remove unnecessary print --- src/client/component/auth.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/client/component/auth.cpp b/src/client/component/auth.cpp index 67a625d5..78a6b460 100644 --- a/src/client/component/auth.cpp +++ b/src/client/component/auth.cpp @@ -107,8 +107,6 @@ namespace auth buffer.write_string(data, static_cast(length)); - printf("Serialized with size: %llX\n", buffer.get_buffer().size()); - return buffer.move_buffer(); }