Skip to content

Commit

Permalink
Merge pull request #13 from shavitush/dev
Browse files Browse the repository at this point in the history
v1.3
  • Loading branch information
shavitush authored Oct 13, 2018
2 parents 5934727 + d831715 commit c32bb7c
Show file tree
Hide file tree
Showing 11 changed files with 570 additions and 169 deletions.
32 changes: 32 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "SourcePawn Compile",
"type": "shell",
"command": "E:\\scripting\\spcomp.exe",
"args": [
"'${file}'",
"-i=E:\\scripting\\include",
"-D=E:\\css-ds\\cstrike\\addons\\sourcemod\\plugins",
],
"problemMatcher": {
"owner": "sp",
"fileLocation": "absolute",
"pattern": {
"regexp": "^(.*)\\((.+)\\)\\s:\\s(((warning|error|fatal error)\\s\\d+):\\s.*)$",
"file": 1,
"line": 2,
"severity": 5,
"message": 3
}
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This is a fork of Oryx, the bunnyhop anticheat written by Rusty/Nolan-O. The REA
The main differences from the original version are:

* I have supported CS:GO and TF2.
* I edited the plugin to work with [bhoptimer](https://github.com/shavitush/bhoptimer). [bTimes](https://github.com/Nolan-O/bTimes) support has been dropped.
* I edited the plugin to work with [bhoptimer](https://github.com/shavitush/bhoptimer). [bTimes](https://github.com/Nolan-O/bTimes) support is kept, and bTimes2 support has been added too. Note that bTimes is not free software, so I cannot actively maintain the support for it.
* [smlib](https://github.com/splewis/smlib) is not a dependency anymore.
* Optimizations have been applied.
* Cleaned the code where I could. Most plugins will look as if they were rewritten, as I don't like the way Rusty wrote them in first place.
Expand All @@ -26,8 +26,6 @@ Rusty's notes:
You need DHooks to build. You also need DHooks on your server for `oryx-sanity` and `oryx-strafe` to work.
It depends on gamedata from SDKTools therefore shouldn't break unless your server is out of date.

All you need to do is make sure you've specified your timer in oryx.inc by defining either `notimer` or `bhoptimer`. Build each file manually with the SourceMod compiler, like usual.
If `bhoptimer` is defined, you will need [bhoptimer](https://github.com/shavitush/bhoptimer)'s include file.
Send a pull request if you want to support other timers.

# Documentation
Expand Down Expand Up @@ -65,14 +63,15 @@ Unsynchronised movement | Wish velocity does not align with with the player's bu
Invalid wish velocity | Wish velocity can only be specific values ([link 1](https://mxr.alliedmods.net/hl2sdk-css/source/game/client/in_main.cpp#557), [link 2](https://mxr.alliedmods.net/hl2sdk-css/source/game/client/in_main.cpp#842)) | oryx-sanity
Wish velocity is too high | Wish velocity exceeds the default `cl_forwardspeed` or `cl_sidespeed` settings | oryx-sanity
Wrong mouse inputs | Raw input has discrepancies with the view angles' yaw delta | oryx-sanity
Invalid buttons/wishspeeds | Buttons and wishspeeds do not match | oryx-sanity
Scripted jumps (havg) | Too many perfect jumps indicates a potential jump script usage | oryx-scroll
Scripted jumps (havgp, patt1, patt2, wpatt, wpatt2) | Too many perfect jumps while maintaining obviously weird scroll stats | oryx-scroll
Scripted jumps (nobf, bf-af, noaf) | Inhuman stats for scrolls before touching the ground and after jumping | oryx-scroll
Scroll macro (highn) | Way too many scroll inputs per jump, giving away the player using some kind of jump macro | oryx-scroll
Scroll cheat (interval, ticks) | Analysis on interval between scrolls ~~and ticks on ground~~ (WIP). These methods are at low detection level due to the nature of UDP causing packets to not be in the correct order all the time | oryx-scroll

**Note**: `oryx-sanity` **will** cause false positives with gamepads and controllers.
**Note 2**: If using [bhoptimer](https://github.com/shavitush/bhoptimer), add `oryx_bypass` to the special string. This setting will disable the sanity, strafe, and movement config anticheats from triggering on the style. For example:
**Note 2**: If using [bhoptimer](https://github.com/shavitush/bhoptimer), add `oryx_bypass` to the special string. This setting will disable the anticheats from triggering on the style. For example:

```
"7"
Expand Down Expand Up @@ -100,6 +99,9 @@ Scroll cheat (interval, ticks) | Analysis on interval between scrolls ~~and tick
}
```

**Note 3**: For [bTimes v1.8.3](https://github.com/Nolan-O/bTimes), change the `special` flag to `oryx_bypass` to disable the anticheats from triggering.
**Note 4**: For bTimes2, TAS (while editing) will be automatically excluded from the anticheat.

Docs on natives are found in `oryx.inc`, using the SourceMod self-documenting style.

The plugins have only been tested with bhoptimer v1.5b (as found [here](https://github.com/shavitush/bhoptimer)).
Expand Down
38 changes: 38 additions & 0 deletions addons/sourcemod/scripting/include/bTimes-tas.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#if defined _tas_included
#endinput
#endif
#define _tas_included

native bool TAS_InEditMode(int client);

native bool TAS_IsPaused(int client);

native ArrayList TAS_GetRunHandle(int client);

native int TAS_GetCurrentFrame(int client);

forward void OnTASPauseChanged(int client, bool paused);

forward void OnTASFrameRecorded(int client, int frame);

public SharedPlugin __pl_tas =
{
name = "tas",
file = "bTimes-tas.smx",
#if defined REQUIRE_PLUGIN
required = 1,
#else
required = 0,
#endif
};


#if !defined REQUIRE_PLUGIN
public void __pl_tas_SetNTVOptional()
{
MarkNativeAsOptional("TAS_InEditMode");
MarkNativeAsOptional("TAS_IsPaused");
MarkNativeAsOptional("TAS_GetRunHandle");
MarkNativeAsOptional("TAS_GetCurrentFrame");
}
#endif
89 changes: 89 additions & 0 deletions addons/sourcemod/scripting/include/bTimes-timer_hack.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#if defined _btimes_timer_included
#endinput
#endif
#define _btimes_timer_included

enum styleConfig
{
String:Name[32],
String:Name_Short[32],
bool:Enabled,
bool:TempEnabled,
bool:AllowType[2],
bool:Freestyle,
bool:Freestyle_Unrestrict,
bool:Freestyle_EzHop,
bool:Freestyle_Auto,
bool:Auto,
bool:EzHop,
Float:Gravity,
Float:RunSpeed,
Float:MaxVel,
Float:MinFps,
bool:CalcSync,
bool:Prevent_Left,
bool:Prevent_Right,
bool:Prevent_Back,
bool:Prevent_Forward,
bool:Require_Left,
bool:Require_Right,
bool:Require_Back,
bool:Require_Forward,
bool:Hud_Style,
bool:Hud_Strafes,
bool:Hud_Jumps,
bool:Count_Left_Strafe,
bool:Count_Right_Strafe,
bool:Count_Back_Strafe,
bool:Count_Forward_Strafe,
bool:Ghost_Use[2],
bool:Ghost_Save[2],
Float:PreSpeed,
Float:SlowedSpeed,
bool:Special,
String:Special_Key[32],
bool:GunJump,
String:GunJump_Weapon[64],
bool:UnrealPhys,
AirAcceleration,
bool:EnableBunnyhopping,
StyleConfig
};

/*
* Gets a client's style (Normal, Sideways, etc..).
*
* @param client Client index
*
* @return The client's style.
*/
native int GetClientStyle(int client);

/*
* Gets the complete configuration for a specified style.
*
* @param Style The style to get a configuration for.
* @param Properties The buffer to store all the style properties, (properties are listed in the StyleConfig enum)
*
* @return True if the style exists, false otherwise.
*/
native bool Style_GetConfig(int Style, any Properties[StyleConfig]);

public SharedPlugin __pl_btimes_timer =
{
name = "timer",
file = "bTimes-timer.smx",
#if defined REQUIRE_PLUGIN
required = 1
#else
required = 0
#endif
};

#if !defined REQUIRE_PLUGIN
public void __pl_btimes_timer_SetNTVOptional()
{
MarkNativeAsOptional("GetClientStyle");
MarkNativeAsOptional("Style_GetConfig");
}
#endif
60 changes: 50 additions & 10 deletions addons/sourcemod/scripting/include/oryx.inc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#endif
#define _oryx_included

#define ORYX_VERSION "1.2"
#define ORYX_VERSION "1.3"

/**
* List of current detection descriptions:
Expand All @@ -48,11 +48,6 @@ enum
TRIGGER_TEST // Allows you to develop new detections on live servers with minimal side effects.
};

/**
* Acceptable timers: "bhoptimer" & "notimer"
*/
#define bhoptimer

/**
* Called when Oryx gets triggered on a client.
*
Expand All @@ -76,18 +71,29 @@ native Action Oryx_Trigger(int client, int level, const char[] cheat);
/**
* Prints a message to admins' chat.
*
* @param msg Pre-formatted message to print to admins.
* @param format Formatting rules.
* @param any Variable number of format parameters.
* @noreturn
*/
native void Oryx_PrintToAdmins(char[] msg);
native void Oryx_PrintToAdmins(const char[] format, any ...);

/**
* Prints a message to admins' console.
*
* @param msg Pre-formatted message to print to admins.
* @param format Formatting rules.
* @param any Variable number of format parameters.
* @noreturn
*/
native void Oryx_PrintToAdminsConsole(const char[] format, any ...);

/**
* Logs an entry to Oryx's log file.
*
* @param format Formatting rules.
* @param any Variable number of format parameters.
* @noreturn
*/
native void Oryx_PrintToAdminsConsole(char[] msg);
native void Oryx_LogMessage(const char[] format, any ...);

/**
* Checks if f1 is inbetween a specified threshold of f12.
Expand All @@ -99,6 +105,17 @@ native void Oryx_PrintToAdminsConsole(char[] msg);
*/
native bool Oryx_WithinThreshold(float f1, float f2, float threshold);

/**
* Checks if the player has permissions to bypass Oryx.
* Will return false if `oryx_allow_bypass` is set to 0.
* With bhoptimer or bTimes v1.8.3, will return true for styles with the `oryx_bypass` special flag.
* For bTimes2, will return true if the player is in edit mode (rewind/fastforward etc).
*
* @param client Client index.
* @return True if the player can bypass the anticheat.
*/
native bool Oryx_CanBypass(int client);

/**
* A tiny function to veify if the player fits gameplay.
*
Expand All @@ -114,3 +131,26 @@ stock bool IsLegalMoveType(int client, bool water = true)
(GetEntityFlags(client) & FL_ATCONTROLS) == 0 &&
(iMoveType == MOVETYPE_WALK || iMoveType == MOVETYPE_ISOMETRIC || iMoveType == MOVETYPE_LADDER);
}

public SharedPlugin __pl_oryx =
{
name = "oryx",
file = "oryx.smx",
#if defined REQUIRE_PLUGIN
required = 1
#else
required = 0
#endif
};

#if !defined REQUIRE_PLUGIN
public void __pl_oryx_SetNTVOptional()
{
MarkNativeAsOptional("Oryx_CanBypass");
MarkNativeAsOptional("Oryx_LogMessage");
MarkNativeAsOptional("Oryx_PrintToAdmins");
MarkNativeAsOptional("Oryx_PrintToAdminsConsole");
MarkNativeAsOptional("Oryx_Trigger");
MarkNativeAsOptional("Oryx_WithinThreshold");
}
#endif
14 changes: 12 additions & 2 deletions addons/sourcemod/scripting/include/shavit.inc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#endif
#define _shavit_included

#define SHAVIT_VERSION "1.5b"
#define SHAVIT_VERSION "2.0.2"
#define STYLE_LIMIT 256
#define MAX_ZONES 64

Expand Down Expand Up @@ -1102,12 +1102,22 @@ native StringMap Shavit_GetMapTiers();
* This native will auto-assign colors and a chat prefix.
*
* @param client Client index.
* @param format Formattiing rules.
* @param format Formatting rules.
* @param any Variable number of format parameters.
* @return PrintToChat()
*/
native int Shavit_PrintToChat(int client, const char[] format, any ...);

/**
* Logs an entry to bhoptimer's log file.
* (addons/sourcemod/logs/shavit.log)
*
* @param format Formatting rules.
* @param any Variable number of format parameters.
* @noreturn
*/
native void Shavit_LogMessage(const char[] format, any ...);

// same as Shavit_PrintToChat() but loops through the whole server
// code stolen from the base halflife.inc file
stock void Shavit_PrintToChatAll(const char[] format, any ...)
Expand Down
Loading

0 comments on commit c32bb7c

Please sign in to comment.