-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
4,012 additions
and
510 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: jidicula/[email protected] | ||
with: | ||
clang-format-version: '16' | ||
clang-format-version: '18' | ||
check-path: ${{ matrix.path['check'] }} | ||
exclude-regex: ${{ matrix.path['exclude'] }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: jidicula/[email protected] | ||
with: | ||
clang-format-version: '16' | ||
clang-format-version: '18' | ||
check-path: ${{ matrix.path['check'] }} | ||
exclude-regex: ${{ matrix.path['exclude'] }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,4 +48,7 @@ | |
//"timeout" "60" | ||
//"port" "3306" | ||
} | ||
|
||
"apiUrl" "https://api.cs2kz.org" | ||
"apiKey" "" | ||
} |
Submodule metamod-source
updated
5 files
+1 −1 | core/gamedll_bridge.cpp | |
+2 −2 | core/provider/source2/provider_source2.cpp | |
+42 −40 | loader/gamedll.cpp | |
+1 −1 | pushbuild.txt | |
+1 −1 | samples/s2_sample_mm/sample_mm.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,75 @@ | ||
#include "../kz.h" | ||
#include "kz_anticheat.h" | ||
#include "kz/language/kz_language.h" | ||
#include "kz/timer/kz_timer.h" | ||
#include "utils/ctimer.h" | ||
|
||
#include <vendor/ClientCvarValue/public/iclientcvarvalue.h> | ||
|
||
extern IClientCvarValue *g_pClientCvarValue; | ||
|
||
#define INTEGRITY_CHECK_MIN_INTERVAL 1.0f | ||
#define INTEGRITY_CHECK_MAX_INTERVAL 5.0f | ||
#define KICK_DELAY 5.0f | ||
#define MINIMUM_FPS_MAX 64.0f | ||
#define MAXIMUM_M_YAW 0.3f | ||
|
||
static_function f64 KickPlayerInvalidSettings(CPlayerUserId userID) | ||
{ | ||
KZPlayer *player = g_pKZPlayerManager->ToPlayer(userID); | ||
if (player) | ||
{ | ||
player->Kick("Invalid player settings"); | ||
} | ||
return 0.0f; | ||
} | ||
|
||
static_function void ValidateCvar(CPlayerSlot nSlot, ECvarValueStatus eStatus, const char *pszCvarName, const char *pszCvarValue) | ||
{ | ||
if (eStatus != ECvarValueStatus::ValueIntact) | ||
{ | ||
return; | ||
} | ||
KZPlayer *player = g_pKZPlayerManager->ToPlayer(nSlot); | ||
if (KZ_STREQI(pszCvarName, "m_yaw")) | ||
{ | ||
if (atof(pszCvarValue) > MAXIMUM_M_YAW) | ||
{ | ||
player->languageService->PrintChat(true, false, "Kick Player m_yaw"); | ||
player->languageService->PrintConsole(false, false, "Kick Player m_yaw (Console)"); | ||
player->anticheatService->MarkHasInvalidCvars(); | ||
player->timerService->TimerStop(); | ||
StartTimer<CPlayerUserId>(KickPlayerInvalidSettings, player->GetClient()->GetUserID(), KICK_DELAY, true, true); | ||
} | ||
} | ||
else if (KZ_STREQI(pszCvarName, "fps_max")) | ||
{ | ||
if (atof(pszCvarValue) != 0.0f && atof(pszCvarValue) < MINIMUM_FPS_MAX) | ||
{ | ||
player->languageService->PrintChat(true, false, "Kick Player fps_max"); | ||
player->languageService->PrintConsole(false, false, "Kick Player fps_max (Console)"); | ||
player->anticheatService->MarkHasInvalidCvars(); | ||
player->timerService->TimerStop(); | ||
StartTimer<CPlayerUserId>(KickPlayerInvalidSettings, player->GetClient()->GetUserID(), KICK_DELAY, true, true); | ||
} | ||
} | ||
} | ||
|
||
static_function f64 CheckClientCvars(CPlayerUserId userID) | ||
{ | ||
KZPlayer *player = g_pKZPlayerManager->ToPlayer(userID); | ||
if (!player || !g_pClientCvarValue || !player->anticheatService->ShouldCheckClientCvars()) | ||
{ | ||
return 0.0f; | ||
} | ||
g_pClientCvarValue->QueryCvarValue(player->GetPlayerSlot(), "m_yaw", ValidateCvar); | ||
g_pClientCvarValue->QueryCvarValue(player->GetPlayerSlot(), "fps_max", ValidateCvar); | ||
return RandomFloat(INTEGRITY_CHECK_MIN_INTERVAL, INTEGRITY_CHECK_MAX_INTERVAL); | ||
} | ||
|
||
void KZAnticheatService::OnPlayerFullyConnect() | ||
{ | ||
this->hasValidCvars = true; | ||
StartTimer<CPlayerUserId>(CheckClientCvars, this->player->GetClient()->GetUserID(), | ||
RandomFloat(INTEGRITY_CHECK_MIN_INTERVAL, INTEGRITY_CHECK_MAX_INTERVAL), true, true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.