diff --git a/src/client/component/command.cpp b/src/client/component/command.cpp index e9dcd629..0ac70162 100644 --- a/src/client/component/command.cpp +++ b/src/client/component/command.cpp @@ -110,6 +110,21 @@ namespace command assert(this->nesting_ < game::CMD_MAX_NESTING); } + params_sv::params_sv(const std::string& text) + : needs_end_(true) + { + game::SV_Cmd_TokenizeString(text.data()); + this->nesting_ = game::sv_cmd_args->nesting; + } + + params_sv::~params_sv() + { + if (this->needs_end_) + { + game::SV_Cmd_EndTokenizedString(); + } + } + int params_sv::size() const { return game::sv_cmd_args->argc[this->nesting_]; diff --git a/src/client/component/command.hpp b/src/client/component/command.hpp index 1a2de42a..563c89b8 100644 --- a/src/client/component/command.hpp +++ b/src/client/component/command.hpp @@ -33,6 +33,14 @@ namespace command { public: params_sv(); + params_sv(const std::string& text); + ~params_sv(); + + params_sv(params_sv&&) = delete; + params_sv(const params_sv&) = delete; + + params_sv& operator=(params_sv&&) = delete; + params_sv& operator=(const params_sv&) = delete; [[nodiscard]] int size() const; [[nodiscard]] const char* get(int index) const; @@ -44,6 +52,7 @@ namespace command } private: + bool needs_end_{false}; int nesting_; }; diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index f17858c6..4e325035 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -159,12 +159,17 @@ namespace game // SV WEAK symbol SV_Loaded{0x142252250, 0x140535460}; WEAK symbol SV_AddTestClient{0x142248F40, 0x14052E3E0}; - WEAK symbol SV_GameSendServerCommand{0x14224F580, 0x140532CA0}; + WEAK symbol SV_DirectConnect{0x142249880, 0x14052EC60}; + WEAK symbol SV_GameSendServerCommand{ + 0x14224F580, 0x140532CA0 + }; WEAK symbol SV_SendServerCommand{0x0, 0x140537F10}; WEAK symbol SV_IsTestClient{0x14224AB60, 0x14052FF40}; WEAK symbol SV_SpawnServer{ 0x1422528C0, 0x140535B20 }; + WEAK symbol SV_Cmd_TokenizeString{0x1420EF130, 0x1404FA6C0}; + WEAK symbol SV_Cmd_EndTokenizedString{0x1420EF0E0, 0x1404FA670}; // Utils WEAK symbol I_CleanStr{0x1422E9050, 0x140580E80};