commit
aae3008576
101
CHANGELOG.md
101
CHANGELOG.md
@ -4,8 +4,29 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.3.0/).
|
||||
|
||||
## r4246 - 2023-05-03
|
||||
|
||||
### Added
|
||||
|
||||
- Add to the iw4x-rawfiles common_scripts\utility GSC script `setPing` & `getPing` for backward compatibility.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix bug with Steam Proxy (#991)
|
||||
- Fix bug with the `say` GSC notify in regards to hidden commands (#989)
|
||||
|
||||
### Removed
|
||||
|
||||
- SetPing GSC method (#998)
|
||||
|
||||
### Known issues
|
||||
|
||||
- Sound issue fix is experimental as the bug is not fully understood.
|
||||
|
||||
## r4226 - 2023-04-26
|
||||
|
||||
### Changed
|
||||
|
||||
- Chat system will go back to using `SV_CMD_CAN_IGNORE` commands (#972)
|
||||
|
||||
### Fixed
|
||||
@ -44,13 +65,22 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
### Changed
|
||||
|
||||
- `sv_mapRotationCurrent` supports `exec` directive for executing cfg scripts from the `game_settings` folder (#916)
|
||||
- `SetPing` GSC method is now deprecated.
|
||||
- `SetPing` GSC method is now deprecated (#903)
|
||||
|
||||
### Security
|
||||
|
||||
- Fix DOS exploit in the network protocol of the game (#942)
|
||||
|
||||
### Fixed
|
||||
|
||||
- `sv_privatePassword` will work as intended (#908)
|
||||
- Fix crash when loading bots.txt file (#927)
|
||||
|
||||
### Removed
|
||||
|
||||
- Remove `GetIp` GSC method (#903)
|
||||
- Remove `GetPing` GSC method (#903)
|
||||
|
||||
### Known issues
|
||||
|
||||
- Sound issue fix is experimental as the bug is not fully understood.
|
||||
@ -112,7 +142,6 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
|
||||
- Servers can no longer modify client Dvars that are saved in the client's config (#694)
|
||||
- `banClient` and `muteClient` server commands do not apply to bots anymore (#730)
|
||||
- Remove `zb_prefer_disk_assets` Dvar (#772)
|
||||
- The max value of `perk_extendedMeleeRange` Dvar was increased (#782)
|
||||
- Test Clients will receive names from the Xlabs Patreon website in addition to the names from the bots.txt file (#771)
|
||||
|
||||
@ -126,6 +155,10 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
- Fix bug where `FileRead` GSC function could return buffers that are too big (#767)
|
||||
- Fix bug where the `OnPlayerSay` GSC function would cause issues (#776)
|
||||
|
||||
### Removed
|
||||
|
||||
- Remove `zb_prefer_disk_assets` Dvar (#772)
|
||||
|
||||
### Known issues
|
||||
|
||||
- Sound issue fix is experimental as the bug is not fully understood.
|
||||
@ -169,6 +202,10 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
- Static models are now lit correctly depending on their position and ground lighting.
|
||||
- New map porting utility ports sounds and effects properly.
|
||||
|
||||
### Removed
|
||||
|
||||
- Remove `HttpGet`& `HttpCancel` (#603)
|
||||
|
||||
### Known issues
|
||||
|
||||
- HTTPS is not supported for fast downloads at the moment.
|
||||
@ -190,7 +227,6 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
|
||||
### Changed
|
||||
|
||||
- Remove non-existent menus from code (#483)
|
||||
- Change font and colour of the external console (#477)
|
||||
|
||||
### Fixed
|
||||
@ -200,6 +236,7 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
- Fix party server not receiving packets (#500)
|
||||
- Fix crash caused by server thread issues (#561)
|
||||
- Fix hours spent playing IW4x not counting towards the hours spent playing MW2 on Steam (#573)
|
||||
- Remove non-existent menus from code (#483)
|
||||
|
||||
### Known issues
|
||||
|
||||
@ -224,9 +261,12 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
### Changed
|
||||
|
||||
- Steam status is no longer set to busy (#417)
|
||||
- `HttpGet`& `HttpCancel` are disabled for security reasons (#449)
|
||||
- `g_allowVote` is a replicated Dvar (#457)
|
||||
|
||||
### Security
|
||||
|
||||
- Disable `HttpGet`& `HttpCancel` (#449)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed `startSingleplayer` command (#404)
|
||||
@ -246,19 +286,14 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
- Add `EnableWeaponPickup` GSC method (#329)
|
||||
- Add `protect-saved-dvars` command line argument (#335)
|
||||
- Add `clanName` dvar. Can be edited in the `barracks` menu (#361)
|
||||
- Add DLC9 containing classic maps from CoD4: Backlot, Chinatown, Winter Crash, Pipeline and Downpour
|
||||
- Add DLC9 containing classic maps from CoD4: Backlot, Chinatown, Winter Crash, Pipeline and Downpour.
|
||||
- Add to the iw4x-rawfiles `common_scripts\iw4x_utility` GSC script, it contains the scripts-based solution for the removed GSC built-in methods.
|
||||
|
||||
### Changed
|
||||
|
||||
- `sv_mapRotationCurrent` functionality has been restored for backwards compatibility (#328)
|
||||
- `sv_mapRotationCurrent` functionality has been restored for backward compatibility (#328)
|
||||
- GSC IO Functions are restricted to the `scriptdata` folder (#322)
|
||||
- `scriptablehttp` command line argument is no longer needed (#322)
|
||||
- Removed `noclip` built-in GSC method. Replaced with script-based solution (#387)
|
||||
- Removed `ufo` built-in GSC method. Replaced with script-based solution (#387)
|
||||
- Removed `god` built-in GSC method. Replaced with script-based solution (#388)
|
||||
- Removed `demiGod` built-in GSC method. Replaced with script-based solution (#388)
|
||||
- Removed `noTarget` built-in GSC method. Replaced with script-based solution (#388)
|
||||
- Added to the iw4x-rawfiles `common_scripts\iw4x_utility` GSC script, it contains the scripts-based solution for the removed GSC built-in methods
|
||||
|
||||
### Fixed
|
||||
|
||||
@ -272,6 +307,14 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
- Fixed issue where grenades and projectiles had no bounce sounds (#368)
|
||||
- Fixed issue that could cause the game to crash when loading CoD4 maps (#372)
|
||||
|
||||
### Removed
|
||||
|
||||
- Remove `noclip` built-in GSC method. Replaced with script-based solution (#387)
|
||||
- Remove `ufo` built-in GSC method. Replaced with script-based solution (#387)
|
||||
- Remove `god` built-in GSC method. Replaced with script-based solution (#388)
|
||||
- Remove `demiGod` built-in GSC method. Replaced with script-based solution (#388)
|
||||
- Remove `noTarget` built-in GSC method. Replaced with script-based solution (#388)
|
||||
|
||||
### Known issues
|
||||
|
||||
- HTTPS is not supported for fast downloads at the moment.
|
||||
@ -292,9 +335,12 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
|
||||
### Changed
|
||||
|
||||
- `openLink` command was removed for security reasons (#286)
|
||||
- `sv_mapRotationCurrent` is not being used anymore (#302)
|
||||
|
||||
### Security
|
||||
|
||||
- Remove `openLink` command (#286)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix font generation (#277)
|
||||
@ -369,12 +415,12 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
|
||||
### Added
|
||||
|
||||
- Added controller support (#75)
|
||||
- Added aim assist for controllers (#75)
|
||||
- Add controller support (#75)
|
||||
- Add aim assist for controllers (#75)
|
||||
- Unlock camera_thirdPersonCrosshairOffset Dvar (#68)
|
||||
- Added support for building custom Fonts with Zonebuilder (#88)
|
||||
- Added colorblind friendly team colors (#101)
|
||||
- Added emojis based on titlecards and emblems to use in the chat and server names Example: `:nuke:` (#130)
|
||||
- Add support for building custom Fonts with Zonebuilder (#88)
|
||||
- Add colorblind friendly team colors (#101)
|
||||
- Add emojis based on titlecards and emblems to use in the chat and server names Example: `:nuke:` (#130)
|
||||
- Upon leaving a server 'archive' dvars (saved in the config file) will be reset to the value they had prior to joining the server (#134)
|
||||
- Implement muteClient command for the game chat (#159)
|
||||
- Implement unmute command for the game chat (#159)
|
||||
@ -455,13 +501,12 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
- Add r_specularCustomMaps Dvar (#36)
|
||||
- Unlock safeArea_horizontal and safeArea_vertical Dvars (#42)
|
||||
- Unlock cg_fovscale Dvar (#47)
|
||||
- Added g_antilag Dvar (#61)
|
||||
- Add g_antilag Dvar (#61)
|
||||
|
||||
### Changed
|
||||
|
||||
- Stats are now separate for each mod (#6). Player stats are copied to `fs_game` folder if no stats exist for this mod yet. Keep in mind this also means that level, XP and classes will not be synchronized with the main stats file after this point.
|
||||
- Reduced duration of toasts (#48)
|
||||
- Removed old updater functionality (#54)
|
||||
- Use old bot names if bots.txt is not found (#46)
|
||||
|
||||
### Fixed
|
||||
@ -472,6 +517,10 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
- Fixed an issue causing the game to crash when Steam was running in the background (#56)
|
||||
- Fixed slow download speed when using fast download
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed old updater functionality (#54)
|
||||
|
||||
### Known issues
|
||||
|
||||
- HTTPS is not supported for fast downloads at the moment.
|
||||
@ -556,8 +605,6 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
|
||||
- Show friend avatars when they play IW4x (request).
|
||||
- Rewrite and optimize the entire node system.
|
||||
- Remove syncnode command for node system.
|
||||
- Remove steam start.
|
||||
|
||||
### Fixed
|
||||
|
||||
@ -567,6 +614,11 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
- Fix crashes caused by a bug in file/data compression.
|
||||
- Improve overall stability.
|
||||
|
||||
### Removed
|
||||
|
||||
- Remove syncnode command for node system.
|
||||
- Remove steam start.
|
||||
|
||||
## [0.5.0] - 2017-06-04
|
||||
|
||||
### Added
|
||||
@ -646,7 +698,6 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
- Disabled big minidump message box.
|
||||
- Limit dedicated servers to 15 instances per IP.
|
||||
- Move build number location.
|
||||
- Remove news ticker and friends button from theater.
|
||||
|
||||
### Fixed
|
||||
|
||||
@ -660,6 +711,10 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
|
||||
- Fix weapon crash issue.
|
||||
- Potentially fix no-ammo bug.
|
||||
|
||||
### Removed
|
||||
|
||||
- Remove news ticker and friends button from theater.
|
||||
|
||||
## [0.3.2] - 2017-02-12
|
||||
|
||||
This is the third public Beta version.
|
||||
|
2
deps/iw4-open-formats
vendored
2
deps/iw4-open-formats
vendored
@ -1 +1 @@
|
||||
Subproject commit 1bc514d4c981532d1195b420a8fc0ce809c65944
|
||||
Subproject commit 266165d21d77dadfe2adb01b7f1bf0fe64832479
|
3
deps/premake/mongoose.lua
vendored
3
deps/premake/mongoose.lua
vendored
@ -20,8 +20,7 @@ function mongoose.project()
|
||||
|
||||
mongoose.includes()
|
||||
|
||||
files
|
||||
{
|
||||
files {
|
||||
path.join(mongoose.source, "mongoose.c"),
|
||||
path.join(mongoose.source, "mongoose.h"),
|
||||
}
|
||||
|
2
deps/premake/udis86.lua
vendored
2
deps/premake/udis86.lua
vendored
@ -3,7 +3,7 @@ udis86 = {
|
||||
}
|
||||
|
||||
function udis86.import()
|
||||
links {"udis86"}
|
||||
links "udis86"
|
||||
|
||||
udis86.includes()
|
||||
end
|
||||
|
2
deps/protobuf
vendored
2
deps/protobuf
vendored
@ -1 +1 @@
|
||||
Subproject commit 53a1c5c1d8b61984899b6877e491e5117ad486ba
|
||||
Subproject commit 5a3dac894157bf3618b2c906a8b9073b4cad62b6
|
2
deps/zlib
vendored
2
deps/zlib
vendored
@ -1 +1 @@
|
||||
Subproject commit b8a8373ec195c8d286fe7e81e78b4a6d31bd859f
|
||||
Subproject commit 48c3741002aca9dae84e9f2288ca149af14c9128
|
@ -272,9 +272,6 @@ namespace Components
|
||||
g_botai[entref.entnum].right = static_cast<int8_t>(rightInt);
|
||||
g_botai[entref.entnum].active = true;
|
||||
});
|
||||
|
||||
GSC::Script::AddMethod("SetPing", []([[maybe_unused]] const Game::scr_entref_t entref)
|
||||
{});
|
||||
}
|
||||
|
||||
void Bots::BotAiAction(Game::client_t* cl)
|
||||
|
@ -137,14 +137,13 @@ namespace Components
|
||||
pop eax
|
||||
|
||||
cmp eax, 0
|
||||
jz OriginalTitle
|
||||
jz originalTitle
|
||||
|
||||
pop ecx
|
||||
mov ecx, DWORD ptr[esi + 4]
|
||||
mov ecx, dword ptr[esi + 4]
|
||||
retn
|
||||
|
||||
OriginalTitle:
|
||||
|
||||
originalTitle:
|
||||
mov eax, [esi + 50h]
|
||||
cmp eax, 3
|
||||
|
||||
@ -173,8 +172,7 @@ namespace Components
|
||||
list.append(std::format("\\{}\\{}", i, playerTitle));
|
||||
}
|
||||
|
||||
const auto* command = Utils::String::Format("{:c} customTitles \"{}\"", 21, list);
|
||||
Game::SV_GameSendServerCommand(-1, Game::SV_CMD_CAN_IGNORE, command);
|
||||
Game::SV_GameSendServerCommand(-1, Game::SV_CMD_CAN_IGNORE, Utils::String::Format("{:c} customTitles \"{}\"", 21, list));
|
||||
}
|
||||
|
||||
void CardTitles::ParseCustomTitles(const char* msg)
|
||||
|
@ -51,6 +51,7 @@ namespace Components
|
||||
if (text[msgIndex] == '/')
|
||||
{
|
||||
SendChat = false;
|
||||
++msgIndex;
|
||||
}
|
||||
|
||||
if (IsMuted(player))
|
||||
@ -65,13 +66,14 @@ namespace Components
|
||||
Game::SV_GameSendServerCommand(player - Game::g_entities, Game::SV_CMD_CAN_IGNORE, Utils::String::VA("%c \"Chat is disabled\"", 0x65));
|
||||
}
|
||||
|
||||
// Message might be empty after the special characters
|
||||
// Message might be empty after the special characters or '/'
|
||||
if (text[msgIndex] == '\0')
|
||||
{
|
||||
SendChat = false;
|
||||
return text;
|
||||
}
|
||||
|
||||
TextRenderer::StripMaterialTextIcons(text, text, std::strlen(text) + 1);
|
||||
Logger::Print("{}: {}\n", Game::svs_clients[player - Game::g_entities].name, (text + msgIndex));
|
||||
|
||||
for (const auto& callback : SayCallbacks)
|
||||
@ -82,8 +84,6 @@ namespace Components
|
||||
}
|
||||
}
|
||||
|
||||
TextRenderer::StripMaterialTextIcons(text, text, std::strlen(text) + 1);
|
||||
|
||||
Game::Scr_AddEntity(player);
|
||||
Game::Scr_AddString(text + msgIndex);
|
||||
Game::Scr_NotifyLevel(static_cast<std::uint16_t>(Game::SL_GetString("say", 0)), 2);
|
||||
@ -351,7 +351,7 @@ namespace Components
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
Logger::PrintError(Game::CON_CHANNEL_ERROR, "Json Parse Error: {}\n", ex.what());
|
||||
Logger::PrintError(Game::CON_CHANNEL_ERROR, "JSON Parse Error: {}\n", ex.what());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -386,7 +386,7 @@ namespace Components
|
||||
{
|
||||
if (!Dedicated::IsRunning())
|
||||
{
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "Server is not running.\n");
|
||||
Logger::Print("Server is not running.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -409,7 +409,7 @@ namespace Components
|
||||
{
|
||||
if (!Dedicated::IsRunning())
|
||||
{
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "Server is not running.\n");
|
||||
Logger::Print("Server is not running.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -450,7 +450,7 @@ namespace Components
|
||||
{
|
||||
if (!Dedicated::IsRunning())
|
||||
{
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "Server is not running.\n");
|
||||
Logger::Print("Server is not running.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -462,12 +462,12 @@ namespace Components
|
||||
if (!name.empty())
|
||||
{
|
||||
Game::SV_GameSendServerCommand(-1, Game::SV_CMD_CAN_IGNORE, Utils::String::Format("{:c} \"{}: {}\"", 0x68, name, message));
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "{}: {}\n", name, message);
|
||||
Logger::Print("{}: {}\n", name, message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Game::SV_GameSendServerCommand(-1, Game::SV_CMD_CAN_IGNORE, Utils::String::Format("{:c} \"Console: {}\"", 0x68, message));
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "Console: {}\n", message);
|
||||
Logger::Print("Console: {}\n", message);
|
||||
}
|
||||
});
|
||||
|
||||
@ -475,7 +475,7 @@ namespace Components
|
||||
{
|
||||
if (!Dedicated::IsRunning())
|
||||
{
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "Server is not running.\n");
|
||||
Logger::Print("Server is not running.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -490,12 +490,12 @@ namespace Components
|
||||
if (!name.empty())
|
||||
{
|
||||
Game::SV_GameSendServerCommand(clientNum, Game::SV_CMD_CAN_IGNORE, Utils::String::Format("{:c} \"{}: {}\"", 0x68, name.data(), message));
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "{} -> {}: {}\n", name, clientNum, message);
|
||||
Logger::Print("{} -> {}: {}\n", name, clientNum, message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Game::SV_GameSendServerCommand(clientNum, Game::SV_CMD_CAN_IGNORE, Utils::String::Format("{:c} \"Console: {}\"", 0x68, message));
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "Console -> {}: {}\n", clientNum, message);
|
||||
Logger::Print("Console -> {}: {}\n", clientNum, message);
|
||||
}
|
||||
});
|
||||
|
||||
@ -503,7 +503,7 @@ namespace Components
|
||||
{
|
||||
if (!Dedicated::IsRunning())
|
||||
{
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "Server is not running.\n");
|
||||
Logger::Print("Server is not running.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -511,14 +511,14 @@ namespace Components
|
||||
|
||||
const auto message = params->join(1);
|
||||
Game::SV_GameSendServerCommand(-1, Game::SV_CMD_CAN_IGNORE, Utils::String::Format("{:c} \"{}\"", 0x68, message));
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "Raw: {}\n", message);
|
||||
Logger::Print("Raw: {}\n", message);
|
||||
});
|
||||
|
||||
Command::AddSV("tellraw", [](Command::Params* params)
|
||||
{
|
||||
if (!Dedicated::IsRunning())
|
||||
{
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "Server is not running.\n");
|
||||
Logger::Print("Server is not running.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -529,7 +529,7 @@ namespace Components
|
||||
|
||||
const auto message = params->join(2);
|
||||
Game::SV_GameSendServerCommand(clientNum, Game::SV_CMD_CAN_IGNORE, Utils::String::Format("{:c} \"{}\"", 0x68, message));
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "Raw -> {}: {}\n", clientNum, message);
|
||||
Logger::Print("Raw -> {}: {}\n", clientNum, message);
|
||||
});
|
||||
|
||||
sv_sayName = Dvar::Register<const char*>("sv_sayName", "^7Console", Game::DVAR_NONE, "The alias of the server when broadcasting a chat message");
|
||||
|
@ -86,7 +86,7 @@ namespace Components
|
||||
auto curChar = CL_FilterChar(static_cast<unsigned char>(currentName[i]));
|
||||
if (curChar > 0)
|
||||
{
|
||||
*saneName++ = (curChar & 0xFF);
|
||||
*saneName++ = curChar & 0xFF;
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ namespace Components
|
||||
|
||||
ClanTags::ClanTags()
|
||||
{
|
||||
Events::OnClientInit([]
|
||||
Events::OnDvarInit([]
|
||||
{
|
||||
ClanName = Game::Dvar_RegisterString("clanName", "", Game::DVAR_ARCHIVE, "Your clan abbreviation");
|
||||
});
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include <STDInclude.hpp>
|
||||
#include <STDInclude.hpp>
|
||||
#include "Console.hpp"
|
||||
#include "TextRenderer.hpp"
|
||||
|
||||
@ -56,6 +56,8 @@ namespace Components
|
||||
|
||||
Game::SafeArea Console::OriginalSafeArea;
|
||||
|
||||
bool Console::isCommand;
|
||||
|
||||
const char** Console::GetAutoCompleteFileList(const char* path, const char* extension, Game::FsListBehavior_e behavior, int* numfiles, int allocTrackType)
|
||||
{
|
||||
if (path == reinterpret_cast<char*>(0xBAADF00D) || path == reinterpret_cast<char*>(0xCDCDCDCD) || ::Utils::Memory::IsBadReadPtr(path)) return nullptr;
|
||||
@ -807,6 +809,20 @@ namespace Components
|
||||
return reinterpret_cast<Game::Dvar_RegisterVec4_t>(0x471500)(dvarName, r, g, b, a, min, max, flags, description);
|
||||
}
|
||||
|
||||
bool Console::Con_IsDvarCommand_Stub(const char* cmd)
|
||||
{
|
||||
isCommand = Game::Con_IsDvarCommand(cmd);
|
||||
return isCommand;
|
||||
}
|
||||
|
||||
void Console::Cmd_ForEach_Stub(void(*callback)(const char* str))
|
||||
{
|
||||
if (!isCommand)
|
||||
{
|
||||
Game::Cmd_ForEach(callback);
|
||||
}
|
||||
}
|
||||
|
||||
void Console::Con_ToggleConsole()
|
||||
{
|
||||
Game::Field_Clear(Game::g_consoleField);
|
||||
@ -885,6 +901,10 @@ namespace Components
|
||||
// Don't resize the console
|
||||
Utils::Hook(0x64DC6B, 0x64DCC2, HOOK_JUMP).install()->quick();
|
||||
|
||||
// Con_DrawInput
|
||||
Utils::Hook(0x5A45BD, Con_IsDvarCommand_Stub, HOOK_CALL).install()->quick();
|
||||
Utils::Hook(0x5A466C, Cmd_ForEach_Stub, HOOK_CALL).install()->quick();
|
||||
|
||||
#ifdef _DEBUG
|
||||
AddConsoleCommand();
|
||||
#endif
|
||||
|
@ -49,6 +49,8 @@ namespace Components
|
||||
|
||||
static Game::SafeArea OriginalSafeArea;
|
||||
|
||||
static bool isCommand;
|
||||
|
||||
static void ShowPrompt();
|
||||
static void RefreshStatus();
|
||||
static void RefreshOutput();
|
||||
@ -76,6 +78,9 @@ namespace Components
|
||||
|
||||
static Game::dvar_t* RegisterConColor(const char* dvarName, float r, float g, float b, float a, float min, float max, unsigned __int16 flags, const char* description);
|
||||
|
||||
static bool Con_IsDvarCommand_Stub(const char* cmd);
|
||||
static void Cmd_ForEach_Stub(void(*callback)(const char* str));
|
||||
|
||||
static LRESULT CALLBACK ConWndProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam);
|
||||
static ATOM CALLBACK RegisterClassHook(WNDCLASSA* lpWndClass);
|
||||
static BOOL CALLBACK ResizeChildWindow(HWND hwndChild, LPARAM lParam);
|
||||
|
@ -172,7 +172,7 @@ namespace Components
|
||||
|
||||
Network::Address master(Utils::String::VA("%s:%u", masterServerName, masterPort));
|
||||
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "Sending heartbeat to master: {}:{}\n", masterServerName, masterPort);
|
||||
Logger::Print("Sending heartbeat to master: {}:{}\n", masterServerName, masterPort);
|
||||
Network::SendCommand(master, "heartbeat", "IW4");
|
||||
}
|
||||
|
||||
|
@ -122,10 +122,12 @@ namespace Components
|
||||
{
|
||||
Game::Com_PrintMessage(Game::CON_CHANNEL_DONT_FILTER, i->data(), 0);
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (!IsConsoleReady())
|
||||
{
|
||||
OutputDebugStringA(i->data());
|
||||
}
|
||||
#endif
|
||||
|
||||
i = MessageQueue.erase(i);
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ namespace Components
|
||||
|
||||
if (svMapname.empty())
|
||||
{
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "mapname dvar is empty! Defaulting to mp_afghan\n");
|
||||
Logger::Print(Game::CON_CHANNEL_SERVER, "{} dvar is empty! Defaulting to mp_afghan\n", (*Game::sv_mapname)->name);
|
||||
svMapname = "mp_afghan"s;
|
||||
}
|
||||
|
||||
|
@ -813,18 +813,6 @@ namespace Components
|
||||
Utils::Hook::Set<DWORD>(0x64A029, 0x1C200000); // 450 MiB
|
||||
Utils::Hook::Set<DWORD>(0x64A057, 0x1C200000);
|
||||
|
||||
#if DEBUG
|
||||
// Hunk debugging
|
||||
Utils::Hook::Set<BYTE>(0x4FF57B, 0xCC);
|
||||
Utils::Hook::Nop(0x4FF57C, 4);
|
||||
#else
|
||||
// Temporarily disable distortion warnings
|
||||
Utils::Hook::Nop(0x50DBFF, 5);
|
||||
Utils::Hook::Nop(0x50DC4F, 5);
|
||||
Utils::Hook::Nop(0x50DCA3, 5);
|
||||
Utils::Hook::Nop(0x50DCFE, 5);
|
||||
#endif
|
||||
|
||||
// Intercept BSP name resolving
|
||||
Utils::Hook(0x4C5979, Maps::GetBSPName, HOOK_CALL).install()->quick();
|
||||
|
||||
|
@ -65,7 +65,7 @@ namespace Components
|
||||
SendStats();
|
||||
}
|
||||
|
||||
int Stats::SaveStats(char* dest, const char* folder, const char* buffer, size_t length)
|
||||
int Stats::SaveStats(char* dest, const char* folder, const char* buffer, int size)
|
||||
{
|
||||
assert(*Game::fs_gameDirVar);
|
||||
|
||||
@ -74,7 +74,7 @@ namespace Components
|
||||
folder = (*Game::fs_gameDirVar)->current.string;
|
||||
}
|
||||
|
||||
return Utils::Hook::Call<int(char*, const char*, const char*, size_t)>(0x426450)(dest, folder, buffer, length);
|
||||
return Utils::Hook::Call<int(char*, const char*, const char*, int)>(0x426450)(dest, folder, buffer, size);
|
||||
}
|
||||
|
||||
void Stats::AddScriptFunctions()
|
||||
@ -175,7 +175,7 @@ namespace Components
|
||||
{
|
||||
if (params->size() < 2)
|
||||
{
|
||||
Logger::PrintError(Game::CON_CHANNEL_SERVER, "statget usage: statget <index>\n");
|
||||
Logger::Print("statget usage: statget <index>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ namespace Components
|
||||
static void UpdateClasses([[maybe_unused]] const UIScript::Token& token, [[maybe_unused]] const Game::uiInfo_s* info);
|
||||
|
||||
static void SendStats();
|
||||
static int SaveStats(char* dest, const char* folder, const char* buffer, size_t length);
|
||||
static int SaveStats(char* dest, const char* folder, const char* buffer, int size);
|
||||
|
||||
static std::int64_t* GetStatsID();
|
||||
|
||||
|
@ -940,7 +940,7 @@ namespace Components
|
||||
}
|
||||
|
||||
const auto materialNameLen = static_cast<uint8_t>(*text);
|
||||
text++;
|
||||
++text;
|
||||
|
||||
for (auto i = 0u; i < materialNameLen; i++)
|
||||
{
|
||||
@ -954,8 +954,10 @@ namespace Components
|
||||
text += materialNameLen;
|
||||
|
||||
auto* material = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_MATERIAL, materialName.data()).material;
|
||||
if (material == nullptr || material->techniqueSet == nullptr || material->techniqueSet->name == nullptr || strcmp(material->techniqueSet->name, "2d") != 0)
|
||||
if (material == nullptr || material->techniqueSet == nullptr || material->techniqueSet->name == nullptr || std::strcmp(material->techniqueSet->name, "2d") != 0)
|
||||
{
|
||||
material = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_MATERIAL, "default").material;
|
||||
}
|
||||
|
||||
const auto yy = y - (h + yScale * static_cast<float>(font->pixelHeight)) * 0.5f;
|
||||
|
||||
@ -1091,7 +1093,7 @@ namespace Components
|
||||
if (renderFlags & Game::TEXT_RENDERFLAG_PADDING)
|
||||
xa += xScale * padding;
|
||||
++count;
|
||||
maxLengthRemaining--;
|
||||
--maxLengthRemaining;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1111,7 +1113,7 @@ namespace Components
|
||||
if (renderFlags & Game::TEXT_RENDERFLAG_PADDING)
|
||||
xa += xScale * padding;
|
||||
count += (fontIconEnd - curText) + 1;
|
||||
maxLengthRemaining--;
|
||||
--maxLengthRemaining;
|
||||
curText = fontIconEnd;
|
||||
continue;
|
||||
}
|
||||
@ -1222,8 +1224,8 @@ namespace Components
|
||||
if (renderFlags & Game::TEXT_RENDERFLAG_PADDING)
|
||||
xa += xScale * padding;
|
||||
|
||||
count++;
|
||||
maxLengthRemaining--;
|
||||
++count;
|
||||
--maxLengthRemaining;
|
||||
}
|
||||
|
||||
if (renderFlags & Game::TEXT_RENDERFLAG_CURSOR && count == cursorPos)
|
||||
@ -1240,10 +1242,14 @@ namespace Components
|
||||
auto maxWidth = 0;
|
||||
|
||||
if (maxChars <= 0)
|
||||
{
|
||||
maxChars = std::numeric_limits<int>::max();
|
||||
}
|
||||
|
||||
if (text == nullptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto count = 0;
|
||||
while (text && *text && count < maxChars)
|
||||
@ -1259,7 +1265,7 @@ namespace Components
|
||||
{
|
||||
if (*text >= COLOR_FIRST_CHAR && *text <= COLOR_LAST_CHAR)
|
||||
{
|
||||
text++;
|
||||
++text;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1309,7 +1315,8 @@ namespace Components
|
||||
{
|
||||
maxWidth = lineWidth;
|
||||
}
|
||||
count++;
|
||||
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1328,7 +1335,7 @@ namespace Components
|
||||
if (!in || !out) return;
|
||||
|
||||
max--;
|
||||
size_t current = 0;
|
||||
std::size_t current = 0;
|
||||
while (*in != 0 && current < max)
|
||||
{
|
||||
const char index = *(in + 1);
|
||||
@ -1345,6 +1352,7 @@ namespace Components
|
||||
|
||||
++in;
|
||||
}
|
||||
|
||||
*out = '\0';
|
||||
}
|
||||
|
||||
@ -1352,7 +1360,7 @@ namespace Components
|
||||
{
|
||||
char buffer[1024]{}; // 1024 is a lucky number in the engine
|
||||
StripColors(in.data(), buffer, sizeof(buffer));
|
||||
return {buffer};
|
||||
return std::string{ buffer };
|
||||
}
|
||||
|
||||
void TextRenderer::StripMaterialTextIcons(const char* in, char* out, std::size_t max)
|
||||
@ -1399,6 +1407,7 @@ namespace Components
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
*out = '\0';
|
||||
}
|
||||
|
||||
@ -1406,7 +1415,7 @@ namespace Components
|
||||
{
|
||||
char buffer[1000]{}; // Should be more than enough
|
||||
StripAllTextIcons(in.data(), buffer, sizeof(buffer));
|
||||
return {buffer};
|
||||
return std::string{ buffer };
|
||||
}
|
||||
|
||||
void TextRenderer::StripAllTextIcons(const char* in, char* out, std::size_t max)
|
||||
@ -1414,7 +1423,7 @@ namespace Components
|
||||
if (!in || !out) return;
|
||||
|
||||
--max;
|
||||
size_t current = 0;
|
||||
std::size_t current = 0;
|
||||
while (*in != 0 && current < max)
|
||||
{
|
||||
if (*in == '^' && (in[1] == '\x01' || in[1] == '\x02'))
|
||||
@ -1422,18 +1431,25 @@ namespace Components
|
||||
in += 2;
|
||||
|
||||
if (*in) // width
|
||||
in++;
|
||||
{
|
||||
++in;
|
||||
}
|
||||
|
||||
if (*in) // height
|
||||
in++;
|
||||
{
|
||||
++in;
|
||||
}
|
||||
|
||||
if (*in) // material name length + material name characters
|
||||
{
|
||||
const auto materialNameLength = *in;
|
||||
in++;
|
||||
++in;
|
||||
for (auto i = 0; i < materialNameLength; i++)
|
||||
{
|
||||
if (*in)
|
||||
in++;
|
||||
{
|
||||
++in;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1486,16 +1502,16 @@ namespace Components
|
||||
|
||||
if (c == '^' && *curText >= COLOR_FIRST_CHAR && *curText <= COLOR_LAST_CHAR && !(cursorPos > count && cursorPos < count + 2))
|
||||
{
|
||||
curText++;
|
||||
count++;
|
||||
++curText;
|
||||
++count;
|
||||
}
|
||||
else if(c != '\r' && c != '\n')
|
||||
{
|
||||
len++;
|
||||
++len;
|
||||
}
|
||||
|
||||
count++;
|
||||
lenWithInvisibleTail++;
|
||||
++count;
|
||||
++lenWithInvisibleTail;
|
||||
}
|
||||
|
||||
return lenWithInvisibleTail;
|
||||
@ -1524,17 +1540,17 @@ namespace Components
|
||||
{
|
||||
Utils::Hook::Set<char>(0x535629, limit); // DrawText2d
|
||||
Utils::Hook::Set<char>(0x4C1BE4, limit); // SEH_PrintStrlen
|
||||
Utils::Hook::Set<char>(0x4863DD, limit); // No idea :P
|
||||
Utils::Hook::Set<char>(0x486429, limit); // No idea :P
|
||||
Utils::Hook::Set<char>(0x49A5A8, limit); // No idea :P
|
||||
Utils::Hook::Set<char>(0x4863DD, limit); // No idea
|
||||
Utils::Hook::Set<char>(0x486429, limit); // No idea
|
||||
Utils::Hook::Set<char>(0x49A5A8, limit); // No idea
|
||||
Utils::Hook::Set<char>(0x505721, limit); // R_TextWidth
|
||||
Utils::Hook::Set<char>(0x505801, limit); // No idea :P
|
||||
Utils::Hook::Set<char>(0x50597F, limit); // No idea :P
|
||||
Utils::Hook::Set<char>(0x5815DB, limit); // No idea :P
|
||||
Utils::Hook::Set<char>(0x592ED0, limit); // No idea :P
|
||||
Utils::Hook::Set<char>(0x5A2E2E, limit); // No idea :P
|
||||
Utils::Hook::Set<char>(0x505801, limit); // No idea
|
||||
Utils::Hook::Set<char>(0x50597F, limit); // No idea
|
||||
Utils::Hook::Set<char>(0x5815DB, limit); // No idea
|
||||
Utils::Hook::Set<char>(0x592ED0, limit); // No idea
|
||||
Utils::Hook::Set<char>(0x5A2E2E, limit); // No idea
|
||||
|
||||
Utils::Hook::Set<char>(0x5A2733, static_cast<char>(ColorIndexForChar(limit))); // No idea :P
|
||||
Utils::Hook::Set<char>(0x5A2733, static_cast<char>(ColorIndexForChar(limit))); // No idea
|
||||
}
|
||||
|
||||
// Patches team overhead normally
|
||||
@ -1654,7 +1670,7 @@ namespace Components
|
||||
fontIconLookup.emplace(std::make_pair(entry.iconName, entry));
|
||||
}
|
||||
|
||||
std::sort(fontIconList.begin(), fontIconList.end(), [](const FontIconTableEntry& a, const FontIconTableEntry& b)
|
||||
std::ranges::sort(fontIconList, [](const FontIconTableEntry& a, const FontIconTableEntry& b) -> bool
|
||||
{
|
||||
return a.iconName < b.iconName;
|
||||
});
|
||||
|
@ -3407,10 +3407,10 @@ namespace Components
|
||||
constexpr auto fileCountMultiplier = 8;
|
||||
constexpr auto maxFileCount = 8191 * fileCountMultiplier;
|
||||
|
||||
int RelocateFileCount(std::uint32_t dwSize, int unk1, int unk2, int unk3)
|
||||
Game::HunkUser* Hunk_UserCreate_Stub(int maxSize, const char* name, bool fixed, int type)
|
||||
{
|
||||
dwSize *= fileCountMultiplier;
|
||||
return Utils::Hook::Call<int(std::uint32_t, int, int, int)>(0x430E90)(dwSize, unk1, unk2, unk3);
|
||||
maxSize *= fileCountMultiplier;
|
||||
return Utils::Hook::Call<Game::HunkUser*(int, const char*, bool, int)>(0x430E90)(maxSize, name, fixed, type);
|
||||
}
|
||||
|
||||
void Zones::LoadMaterialAsset(Game::Material** asset)
|
||||
@ -3554,8 +3554,8 @@ namespace Components
|
||||
Utils::Hook::Set<std::uint32_t>(0x64AF78, maxFileCount);
|
||||
Utils::Hook::Set<std::uint32_t>(0x64B04F, maxFileCount);
|
||||
Utils::Hook::Set<std::uint32_t>(0x45A8CE, maxFileCount);
|
||||
Utils::Hook(0x45A806, RelocateFileCount, HOOK_CALL).install()->quick();
|
||||
Utils::Hook(0x45A6A0, RelocateFileCount, HOOK_CALL).install()->quick();
|
||||
Utils::Hook(0x45A806, Hunk_UserCreate_Stub, HOOK_CALL).install()->quick();
|
||||
Utils::Hook(0x45A6A0, Hunk_UserCreate_Stub, HOOK_CALL).install()->quick();
|
||||
|
||||
#ifndef DEBUG
|
||||
// Ignore missing soundaliases for now
|
||||
|
@ -4,7 +4,6 @@ namespace Main
|
||||
{
|
||||
void Initialize()
|
||||
{
|
||||
Utils::SetEnvironment();
|
||||
Utils::Cryptography::Initialize();
|
||||
Components::Loader::Initialize();
|
||||
|
||||
@ -70,6 +69,7 @@ BOOL APIENTRY DllMain(HINSTANCE /*hinstDLL*/, DWORD fdwReason, LPVOID /*lpvReser
|
||||
}
|
||||
#endif
|
||||
|
||||
Utils::SetEnvironment();
|
||||
Steam::Proxy::RunMod();
|
||||
// Install entry point hook
|
||||
Utils::Hook(0x6BAC0F, Main::EntryPoint, HOOK_JUMP).install()->quick();
|
||||
|
@ -25,10 +25,12 @@ namespace Game
|
||||
Cmd_AddCommand_t Cmd_AddCommand = Cmd_AddCommand_t(0x470090);
|
||||
Cmd_AddServerCommand_t Cmd_AddServerCommand = Cmd_AddServerCommand_t(0x4DCE00);
|
||||
Cmd_ExecuteSingleCommand_t Cmd_ExecuteSingleCommand = Cmd_ExecuteSingleCommand_t(0x609540);
|
||||
Cmd_ForEach_t Cmd_ForEach = Cmd_ForEach_t(0x45D680);
|
||||
|
||||
Con_DrawMiniConsole_t Con_DrawMiniConsole = Con_DrawMiniConsole_t(0x464F30);
|
||||
Con_DrawSolidConsole_t Con_DrawSolidConsole = Con_DrawSolidConsole_t(0x5A5040);
|
||||
Con_CancelAutoComplete_t Con_CancelAutoComplete = Con_CancelAutoComplete_t(0x435580);
|
||||
Con_IsDvarCommand_t Con_IsDvarCommand = Con_IsDvarCommand_t(0x5A3FF0);
|
||||
|
||||
DB_AllocStreamPos_t DB_AllocStreamPos = DB_AllocStreamPos_t(0x418380);
|
||||
DB_PushStreamPos_t DB_PushStreamPos = DB_PushStreamPos_t(0x458A20);
|
||||
|
@ -60,6 +60,9 @@ namespace Game
|
||||
typedef void(*Cmd_ExecuteSingleCommand_t)(int localClientNum, int controllerIndex, const char* cmd);
|
||||
extern Cmd_ExecuteSingleCommand_t Cmd_ExecuteSingleCommand;
|
||||
|
||||
typedef void(*Cmd_ForEach_t)(void(*callback)(const char* str));
|
||||
extern Cmd_ForEach_t Cmd_ForEach;
|
||||
|
||||
typedef char*(*Con_DrawMiniConsole_t)(int localClientNum, int xPos, int yPos, float alpha);
|
||||
extern Con_DrawMiniConsole_t Con_DrawMiniConsole;
|
||||
|
||||
@ -69,6 +72,9 @@ namespace Game
|
||||
typedef bool(*Con_CancelAutoComplete_t)();
|
||||
extern Con_CancelAutoComplete_t Con_CancelAutoComplete;
|
||||
|
||||
typedef bool(*Con_IsDvarCommand_t)(const char* cmd);
|
||||
extern Con_IsDvarCommand_t Con_IsDvarCommand;
|
||||
|
||||
typedef bool(*Encode_Init_t)(const char* );
|
||||
extern Encode_Init_t Encode_Init;
|
||||
|
||||
|
@ -164,7 +164,7 @@ namespace Steam
|
||||
clientUtils.invoke<void>("SetAppIDForCurrentPipe", Proxy::AppId, false);
|
||||
|
||||
char ourPath[MAX_PATH]{};
|
||||
GetModuleFileNameA(GetModuleHandle(nullptr), ourPath, sizeof(ourPath));
|
||||
GetModuleFileNameA(GetModuleHandleA(nullptr), ourPath, sizeof(ourPath));
|
||||
|
||||
char ourDirectory[MAX_PATH]{};
|
||||
GetCurrentDirectoryA(sizeof(ourDirectory), ourDirectory);
|
||||
|
@ -19,13 +19,13 @@ namespace Utils
|
||||
std::string Rand::GenerateChallenge()
|
||||
{
|
||||
char buffer[512]{};
|
||||
int buffer_pos = 0;
|
||||
int pos = 0;
|
||||
|
||||
buffer_pos += sprintf_s(&buffer[buffer_pos], sizeof(buffer) - buffer_pos, "%X", GenerateInt());
|
||||
buffer_pos += sprintf_s(&buffer[buffer_pos], sizeof(buffer) - buffer_pos, "%X", ~timeGetTime() ^ GenerateInt());
|
||||
buffer_pos += sprintf_s(&buffer[buffer_pos], sizeof(buffer) - buffer_pos, "%X", GenerateInt());
|
||||
pos += sprintf_s(&buffer[pos], sizeof(buffer) - pos, "%X", GenerateInt());
|
||||
pos += sprintf_s(&buffer[pos], sizeof(buffer) - pos, "%X", ~timeGetTime() ^ GenerateInt());
|
||||
pos += sprintf_s(&buffer[pos], sizeof(buffer) - pos, "%X", GenerateInt());
|
||||
|
||||
return std::string(buffer, static_cast<std::size_t>(buffer_pos));
|
||||
return std::string(buffer, static_cast<std::size_t>(pos));
|
||||
}
|
||||
|
||||
std::uint32_t Rand::GenerateInt()
|
||||
|
Loading…
Reference in New Issue
Block a user