chore: update

This commit is contained in:
2025-11-16 21:30:39 +01:00
parent f273adabf6
commit 3564f4d653
7 changed files with 19 additions and 19 deletions

2
deps/GSL vendored

Submodule deps/GSL updated: 7e0943d20d...543d0dd3fe

2
deps/gsc-tool vendored

2
deps/minhook vendored

View File

@@ -15,7 +15,7 @@ namespace demonware
{
std::string get_motd_text()
{
return "This is not a copy & pasted client";
return "Did you know aiming down sights increases accuracy? Online Interactions Not Rated by the ESRB.";
}
}

View File

@@ -1 +1 @@
Welcome to s1-mod. This is not a copy & pasted project.
Welcome to s1-mod. Did you know aiming down sights increases accuracy? Online Interactions Not Rated by the ESRB.

View File

@@ -22,54 +22,54 @@ namespace utils::string
++this->current_buffer_ %= ARRAY_COUNT(this->string_pool_);
auto entry = &this->string_pool_[this->current_buffer_];
if (!entry->size || !entry->buffer)
if (!entry->size_ || !entry->buffer_)
{
throw std::runtime_error("String pool not initialized");
}
while (true)
{
const int res = vsnprintf_s(entry->buffer, entry->size, _TRUNCATE, format, ap);
const auto res = vsnprintf_s(entry->buffer_, entry->size_, _TRUNCATE, format, ap);
if (res > 0) break; // Success
if (res == 0) return nullptr; // Error
entry->double_size();
}
return entry->buffer;
return entry->buffer_;
}
private:
class entry final
{
public:
explicit entry(const size_t _size = MinBufferSize) : size(_size), buffer(nullptr)
explicit entry(const size_t size = MinBufferSize) : size_(size), buffer_(nullptr)
{
if (this->size < MinBufferSize) this->size = MinBufferSize;
if (this->size_ < MinBufferSize) this->size_ = MinBufferSize;
this->allocate();
}
~entry()
{
if (this->buffer) memory::get_allocator()->free(this->buffer);
this->size = 0;
this->buffer = nullptr;
if (this->buffer_) memory::get_allocator()->free(this->buffer_);
this->size_ = 0;
this->buffer_ = nullptr;
}
void allocate()
{
if (this->buffer) memory::get_allocator()->free(this->buffer);
this->buffer = memory::get_allocator()->allocate_array<char>(this->size + 1);
if (this->buffer_) memory::get_allocator()->free(this->buffer_);
this->buffer_ = memory::get_allocator()->allocate_array<char>(this->size_ + 1);
}
void double_size()
{
this->size *= 2;
this->size_ *= 2;
this->allocate();
}
size_t size;
char* buffer;
size_t size_;
char* buffer_;
};
size_t current_buffer_;