Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge #1

Merged
merged 45 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
fe6150a
Implemented native REU_GetAuthKey
s1lentq Jan 30, 2022
2bda2c3
Update workflows/build.yml Set windows job container as windows-2019 …
s1lentq Feb 26, 2022
4e23c65
Implement `RH_*_Precache_*`, `RH_SV_AddResource`, `RH_SV_ClientPrintf…
ShadowsAdi Sep 19, 2022
7d9bd65
Fixed typo into hook CBasePlayer::SwitchTeam
s1lentq Nov 18, 2022
aeabd1f
Implement RH_SV_AllowPhysent hook (#265)
Feb 11, 2023
ab94d09
Add ITEM_FLAG_NOFIREUNDERWATER to cssdk_const.inc (#267)
fl0werD Mar 2, 2023
867368f
Improved description for `rg_get_weapon_info` (#269)
Nord1cWarr1or Mar 17, 2023
d2347e8
`API`: Implement `RH_ExecuteServerStringCmd` hook (#263)
ShadowsAdi Mar 31, 2023
b85d4ae
Improve include descriptions `rg_fire_bullets`, `rg_fire_buckshots` a…
RauliTop Mar 31, 2023
ac3d641
`rg_give_defusekit()`: Add player team check (#234)
Giferns Mar 31, 2023
7be36cc
Implement `rh_get_client_connect_time()` native (#259)
FEDERICOMB96 Mar 31, 2023
60f3230
Fix ``TimeBasedDamage enum`` typo at cssdk_const.inc (#256)
RauliTop Mar 31, 2023
5c5478c
SetHookChainArg: handle `default` case.
wopox1337 Jul 1, 2023
8c670fa
GetBonePosition/GetAttachment: Added index bounds check
s1lentq Jul 3, 2023
7c959fa
Implemented ATYPE_TRACE for SetHookChainArg native useful for replace…
s1lentq Jul 14, 2023
1b4ee4e
Add new trace flags to cssdk_const.inc (#278)
Jul 15, 2023
e478314
Add m_flEjectBrass description (#274)
RauliTop Jul 15, 2023
3cbdc16
Implement RG_CreateWeaponBox hook (#275)
dystopm Jul 15, 2023
d9b72bf
`API`: Implement `RG_PM_LadderMove` hook (#254)
ShadowsAdi Jul 15, 2023
87e4858
Update SDK
s1lentq Jul 15, 2023
4155dd4
`API`: CSPlayer and CKnife additions + headers refactory (#277)
dystopm Jul 15, 2023
28fe32e
Update CSSDK
s1lentq Aug 24, 2023
a60e2b5
Disable fixes angles for natives GetBonePosition/GetAttachment if ReG…
s1lentq Aug 26, 2023
2bceff9
Reworked entity callback dispatcher
s1lentq Sep 3, 2023
30c1964
Add an important clarification to the native rg_create_entity comment…
s1lentq Sep 3, 2023
20d8133
Update cmake/project files
s1lentq Sep 3, 2023
2b8ae61
Fix comment
s1lentq Sep 3, 2023
eab1658
Fix SetMoveDone callback dispatcher
s1lentq Sep 3, 2023
da81fe5
Update workflows/build.yml
s1lentq Sep 5, 2023
4637997
`API`: Added rg_set/get_global_iteminfo natives (#279)
dystopm Sep 5, 2023
4ef1955
Added a new argument removeAmmo to the rg_remove_items_by_slot native…
Javekson Sep 5, 2023
2142208
`API`: New gamedll hookchains (#280)
dystopm Sep 5, 2023
fcca39b
Fix error 029: invalid expression for IsRoundExpireEvent (#286)
Javekson Sep 25, 2023
2077022
Refactored rg_remove_items_by_slot and updated the return logic (#288)
Javekson Oct 7, 2023
e36a40c
Updated the return logic of rg_drop_item and rg_drop_items_by_slot (#…
Javekson Oct 7, 2023
08210be
Info_SetValueForStarKey allow a colon in playername
s1lentq Oct 7, 2023
ed57d7b
SV_CheckUserInfo: Refer to 'userinfo' argument as a pointer instead o…
s1lentq Oct 7, 2023
1a72c8a
Improved initialization of rehlds api
s1lentq Oct 9, 2023
11ead5d
Fixed startPercent argument type for native rg_send_bartime2
s1lentq Nov 22, 2023
cf757aa
Added GetBodygroup, SetBodygroup, GetSequenceInfo natives (#294)
dystopm Nov 26, 2023
b281588
fix(rg_transfer_c4): prevent C4 destruction on arg receiver = 0 (#291)
Javekson Nov 26, 2023
4c1932c
Headers update, rename m_bHasSecondaryAttack, CSPlayer member additio…
dystopm Nov 26, 2023
5c38e6f
Implemented CCSEntity members to export in AMXX headers (#296)
dystopm Nov 26, 2023
bf8b9bd
Fix GiveC4 hook callback return type (#295)
dystopm Nov 26, 2023
4430205
API upgrade: 15 new natives (#297)
dystopm Nov 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 28 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:
windows:
name: 'Windows'
runs-on: windows-latest
runs-on: windows-2019

env:
solution: 'msvc/reapi.sln'
Expand All @@ -23,12 +23,14 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup MSBuild
uses: microsoft/[email protected]
uses: microsoft/[email protected]
with:
vs-version: '16.8'

- name: Build
run: |
Expand All @@ -43,7 +45,7 @@ jobs:
move msvc\${{ env.buildRelease }}\reapi_amxx.pdb publish\debug\reapi_amxx.pdb

- name: Deploy artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3.1.1
with:
name: win32
path: publish/*
Expand All @@ -52,17 +54,34 @@ jobs:
name: 'Linux'
runs-on: ubuntu-latest
container: s1lentq/linux86buildtools:latest
outputs:
app-version: ${{ steps.app-version.outputs.version }}

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Build using Intel C++ Compiler 19.0
run: |
rm -rf build && CC=icc CXX=icpc cmake -B build && cmake --build build -j8

- name: Reading appversion.h
id: app-version
run: |
if [ -e "reapi/version/appversion.h" ]; then
APP_VERSION=$(cat "reapi/version/appversion.h" | grep -wi '#define APP_VERSION_STRD' | sed -e 's/#define APP_VERSION_STRD[ \t\r\n\v\f]\+\(.*\)/\1/i' -e 's/\r//g')
if [ $? -ne 0 ]; then
APP_VERSION=""
else
# Remove quotes
APP_VERSION=$(echo $APP_VERSION | xargs)
fi
fi
echo "version=${APP_VERSION}" >> "$GITHUB_OUTPUT"
shell: bash

- name: Prepare AMXX
run: |
mkdir -p publish/addons/amxmodx/modules
Expand All @@ -72,7 +91,6 @@ jobs:
- name: Move files
run: |
mv build/reapi/reapi_amxx_i386.so publish/addons/amxmodx/modules/reapi_amxx_i386.so
mv reapi/version/appversion.h publish/appversion.h

- name: Run GLIBC/ABI version compat test
run: |
Expand All @@ -86,55 +104,36 @@ jobs:
shell: bash

- name: Deploy artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3.1.1
id: upload-job
with:
name: linux32
path: publish/*

- name: Cleanup temporary artifacts
if: success() && steps.upload-job.outcome == 'success'
run: |
rm -f appversion.h

publish:
name: 'Publish'
runs-on: ubuntu-latest
needs: [windows, linux]

steps:
- name: Deploying linux artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: linux32

- name: Deploying windows artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: win32

- name: Reading appversion.h
run: |
if [ -e appversion.h ]; then
APP_VERSION=$(cat appversion.h | grep -wi '#define APP_VERSION_STRD' | sed -e 's/#define APP_VERSION_STRD[ \t\r\n\v\f]\+\(.*\)/\1/i' -e 's/\r//g')
if [ $? -ne 0 ]; then
APP_VERSION=""
else
# Remove quotes
APP_VERSION=$(echo $APP_VERSION | xargs)
echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_ENV
fi
fi
rm -f appversion.h

- name: Packaging binaries
id: packaging-job
if: |
github.event_name == 'release' &&
github.event.action == 'published' &&
startsWith(github.ref, 'refs/tags/')
run: |
7z a -tzip reapi-bin-${{ env.APP_VERSION }}.zip addons/
7z a -tzip reapi-bin-${{ needs.linux.outputs.app-version }}.zip addons/

- name: Publish artifacts
uses: softprops/action-gh-release@v1
Expand All @@ -147,9 +146,3 @@ jobs:
*.zip
env:
GITHUB_TOKEN: ${{ secrets.API_TOKEN }}

- name: Cleanup temporary artifacts
if: success() && steps.publish-job.outcome == 'success'
run: |
rm -rf addons debug
rm -f *.zip appversion.h
2 changes: 1 addition & 1 deletion reapi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ set(REAPI_SRCS
"src/amxxmodule.cpp"
"src/h_export.cpp"
"src/dllapi.cpp"
"src/entity_callback.cpp"
"src/entity_callback_dispatcher.cpp"
"src/hook_callback.cpp"
"src/hook_list.cpp"
"src/hook_manager.cpp"
Expand Down
2 changes: 1 addition & 1 deletion reapi/common/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ void Info_SetValueForStarKey(char *s, const char *key, const char *value, int ma
return;
}

if (Q_strstr(key, "..") || Q_strstr(value, ".."))
if (Q_strstr(key, "..") || (Q_strcmp(key, "name") != 0 && Q_strstr(value, "..")))
{
// TODO: Why silently return?
//UTIL_ServerPrint("Can't use keys or values with a ..\n");
Expand Down
183 changes: 182 additions & 1 deletion reapi/extra/amxmodx/scripting/include/cssdk_const.inc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@
#define FL_KILLME (1<<30) // This entity is marked for death -- This allows the engine to kill ents at the appropriate time
#define FL_DORMANT (1<<31) // Entity is dormant, no updates to client

/**
* global_get(glb_trace_flags) values
* @note Custom flags that we can retrieve in pfnShouldCollide/TraceLine/TraceHull
*/
#define FTRACE_BULLET (1<<16)
#define FTRACE_FLASH (1<<17)
#define FTRACE_KNIFE (1<<18)

/**
* get_entvar(entity, var_movetype) values
*/
Expand Down Expand Up @@ -272,6 +280,7 @@
#define ITEM_FLAG_NOAUTOSWITCHEMPTY (1<<2)
#define ITEM_FLAG_LIMITINWORLD (1<<3)
#define ITEM_FLAG_EXHAUSTIBLE (1<<4)
#define ITEM_FLAG_NOFIREUNDERWATER (1<<5)

/**
* @section get_entvar(entity, var_spawnflags) values
Expand Down Expand Up @@ -897,10 +906,11 @@ enum WeaponIdType

/**
* For CBaseMonster::m_rgbTimeBasedDamage
* prefix should be ITBD_
*/
enum TimeBasedDamage
{
ITDB_PRALYZE,
ITDB_PARALYZE,
ITDB_NERVEGAS,
ITDB_POISON,
ITDB_RADIATION,
Expand Down Expand Up @@ -1358,3 +1368,174 @@ enum InfoMapBuyParam
#define SCORE_STATUS_BOMB (1<<1)
#define SCORE_STATUS_VIP (1<<2)
#define SCORE_STATUS_DEFKIT (1<<3)

/**
* For RG_CBotManager_OnEvent
*/
enum GameEventType
{
EVENT_INVALID = 0,
EVENT_WEAPON_FIRED, // tell bots the player is attack (argumens: 1 = attacker, 2 = NULL)
EVENT_WEAPON_FIRED_ON_EMPTY, // tell bots the player is attack without clip ammo (argumens: 1 = attacker, 2 = NULL)
EVENT_WEAPON_RELOADED, // tell bots the player is reloading his weapon (argumens: 1 = reloader, 2 = NULL)

EVENT_HE_GRENADE_EXPLODED, // tell bots the HE grenade is exploded (argumens: 1 = grenade thrower, 2 = NULL)
EVENT_FLASHBANG_GRENADE_EXPLODED, // tell bots the flashbang grenade is exploded (argumens: 1 = grenade thrower, 2 = explosion origin)
EVENT_SMOKE_GRENADE_EXPLODED, // tell bots the smoke grenade is exploded (argumens: 1 = grenade thrower, 2 = NULL)
EVENT_GRENADE_BOUNCED,

EVENT_BEING_SHOT_AT,
EVENT_PLAYER_BLINDED_BY_FLASHBANG, // tell bots the player is flashed (argumens: 1 = flashed player, 2 = NULL)
EVENT_PLAYER_FOOTSTEP, // tell bots the player is running (argumens: 1 = runner, 2 = NULL)
EVENT_PLAYER_JUMPED, // tell bots the player is jumped (argumens: 1 = jumper, 2 = NULL)
EVENT_PLAYER_DIED, // tell bots the player is killed (argumens: 1 = victim, 2 = killer)
EVENT_PLAYER_LANDED_FROM_HEIGHT, // tell bots the player is fell with some damage (argumens: 1 = felled player, 2 = NULL)
EVENT_PLAYER_TOOK_DAMAGE, // tell bots the player is take damage (argumens: 1 = victim, 2 = attacker)
EVENT_HOSTAGE_DAMAGED, // tell bots the player has injured a hostage (argumens: 1 = hostage, 2 = injurer)
EVENT_HOSTAGE_KILLED, // tell bots the player has killed a hostage (argumens: 1 = hostage, 2 = killer)

EVENT_DOOR, // tell bots the door is moving (argumens: 1 = door, 2 = NULL)
EVENT_BREAK_GLASS, // tell bots the glass has break (argumens: 1 = glass, 2 = NULL)
EVENT_BREAK_WOOD, // tell bots the wood has break (argumens: 1 = wood, 2 = NULL)
EVENT_BREAK_METAL, // tell bots the metal/computer has break (argumens: 1 = metal/computer, 2 = NULL)
EVENT_BREAK_FLESH, // tell bots the flesh has break (argumens: 1 = flesh, 2 = NULL)
EVENT_BREAK_CONCRETE, // tell bots the concrete has break (argumens: 1 = concrete, 2 = NULL)

EVENT_BOMB_PLANTED, // tell bots the bomb has been planted (argumens: 1 = planter, 2 = NULL)
EVENT_BOMB_DROPPED, // tell bots the bomb has been dropped (argumens: 1 = NULL, 2 = NULL)
EVENT_BOMB_PICKED_UP, // let the bots hear the bomb pickup (argumens: 1 = player that pickup c4, 2 = NULL)
EVENT_BOMB_BEEP, // let the bots hear the bomb beeping (argumens: 1 = c4, 2 = NULL)
EVENT_BOMB_DEFUSING, // tell the bots someone has started defusing (argumens: 1 = defuser, 2 = NULL)
EVENT_BOMB_DEFUSE_ABORTED, // tell the bots someone has aborted defusing (argumens: 1 = NULL, 2 = NULL)
EVENT_BOMB_DEFUSED, // tell the bots the bomb is defused (argumens: 1 = defuser, 2 = NULL)
EVENT_BOMB_EXPLODED, // let the bots hear the bomb exploding (argumens: 1 = NULL, 2 = NULL)

EVENT_HOSTAGE_USED, // tell bots the hostage is used (argumens: 1 = user, 2 = NULL)
EVENT_HOSTAGE_RESCUED, // tell bots the hostage is rescued (argumens: 1 = rescuer (CBasePlayer *), 2 = hostage (CHostage *))
EVENT_ALL_HOSTAGES_RESCUED, // tell bots the all hostages are rescued (argumens: 1 = NULL, 2 = NULL)

EVENT_VIP_ESCAPED, // tell bots the VIP is escaped (argumens: 1 = NULL, 2 = NULL)
EVENT_VIP_ASSASSINATED, // tell bots the VIP is assassinated (argumens: 1 = NULL, 2 = NULL)
EVENT_TERRORISTS_WIN, // tell bots the terrorists won the round (argumens: 1 = NULL, 2 = NULL)
EVENT_CTS_WIN, // tell bots the CTs won the round (argumens: 1 = NULL, 2 = NULL)
EVENT_ROUND_DRAW, // tell bots the round was a draw (argumens: 1 = NULL, 2 = NULL)
EVENT_ROUND_WIN, // tell carreer the round was a win (argumens: 1 = NULL, 2 = NULL)
EVENT_ROUND_LOSS, // tell carreer the round was a loss (argumens: 1 = NULL, 2 = NULL)
EVENT_ROUND_START, // tell bots the round was started (when freeze period is expired) (argumens: 1 = NULL, 2 = NULL)
EVENT_PLAYER_SPAWNED, // tell bots the player is spawned (argumens: 1 = spawned player, 2 = NULL)
EVENT_CLIENT_CORPSE_SPAWNED,
EVENT_BUY_TIME_START,
EVENT_PLAYER_LEFT_BUY_ZONE,
EVENT_DEATH_CAMERA_START,
EVENT_KILL_ALL,
EVENT_ROUND_TIME,
EVENT_DIE,
EVENT_KILL,
EVENT_HEADSHOT,
EVENT_KILL_FLASHBANGED,
EVENT_TUTOR_BUY_MENU_OPENNED,
EVENT_TUTOR_AUTOBUY,
EVENT_PLAYER_BOUGHT_SOMETHING,
EVENT_TUTOR_NOT_BUYING_ANYTHING,
EVENT_TUTOR_NEED_TO_BUY_PRIMARY_WEAPON,
EVENT_TUTOR_NEED_TO_BUY_PRIMARY_AMMO,
EVENT_TUTOR_NEED_TO_BUY_SECONDARY_AMMO,
EVENT_TUTOR_NEED_TO_BUY_ARMOR,
EVENT_TUTOR_NEED_TO_BUY_DEFUSE_KIT,
EVENT_TUTOR_NEED_TO_BUY_GRENADE,
EVENT_CAREER_TASK_DONE,

EVENT_START_RADIO_1,
EVENT_RADIO_COVER_ME,
EVENT_RADIO_YOU_TAKE_THE_POINT,
EVENT_RADIO_HOLD_THIS_POSITION,
EVENT_RADIO_REGROUP_TEAM,
EVENT_RADIO_FOLLOW_ME,
EVENT_RADIO_TAKING_FIRE,
EVENT_START_RADIO_2,
EVENT_RADIO_GO_GO_GO,
EVENT_RADIO_TEAM_FALL_BACK,
EVENT_RADIO_STICK_TOGETHER_TEAM,
EVENT_RADIO_GET_IN_POSITION_AND_WAIT,
EVENT_RADIO_STORM_THE_FRONT,
EVENT_RADIO_REPORT_IN_TEAM,
EVENT_START_RADIO_3,
EVENT_RADIO_AFFIRMATIVE,
EVENT_RADIO_ENEMY_SPOTTED,
EVENT_RADIO_NEED_BACKUP,
EVENT_RADIO_SECTOR_CLEAR,
EVENT_RADIO_IN_POSITION,
EVENT_RADIO_REPORTING_IN,
EVENT_RADIO_GET_OUT_OF_THERE,
EVENT_RADIO_NEGATIVE,
EVENT_RADIO_ENEMY_DOWN,
EVENT_END_RADIO,

EVENT_NEW_MATCH, // tell bots the game is new (argumens: 1 = NULL, 2 = NULL)
EVENT_PLAYER_CHANGED_TEAM, // tell bots the player is switch his team (also called from ClientPutInServer()) (argumens: 1 = switcher, 2 = NULL)
EVENT_BULLET_IMPACT, // tell bots the player is shoot at wall (argumens: 1 = shooter, 2 = shoot trace end position)
EVENT_GAME_COMMENCE, // tell bots the game is commencing (argumens: 1 = NULL, 2 = NULL)
EVENT_WEAPON_ZOOMED, // tell bots the player is switch weapon zoom (argumens: 1 = zoom switcher, 2 = NULL)
EVENT_HOSTAGE_CALLED_FOR_HELP, // tell bots the hostage is talking (argumens: 1 = listener, 2 = NULL)
NUM_GAME_EVENTS,
};

/**
* Weapon secondary attack states
* For CCSPlayerWeapon::m_iStateSecondaryAttack
*/
enum SecondaryAtkState
{
WEAPON_SECONDARY_ATTACK_NONE = 0,
WEAPON_SECONDARY_ATTACK_SET,
WEAPON_SECONDARY_ATTACK_BLOCK
};

/**
* Decal list for rg_decal_trace
*/
enum Decal
{
DECAL_GUNSHOT1 = 0,
DECAL_GUNSHOT2,
DECAL_GUNSHOT3,
DECAL_GUNSHOT4,
DECAL_GUNSHOT5,
DECAL_LAMBDA1,
DECAL_LAMBDA2,
DECAL_LAMBDA3,
DECAL_LAMBDA4,
DECAL_LAMBDA5,
DECAL_LAMBDA6,
DECAL_SCORCH1,
DECAL_SCORCH2,
DECAL_BLOOD1,
DECAL_BLOOD2,
DECAL_BLOOD3,
DECAL_BLOOD4,
DECAL_BLOOD5,
DECAL_BLOOD6,
DECAL_YBLOOD1,
DECAL_YBLOOD2,
DECAL_YBLOOD3,
DECAL_YBLOOD4,
DECAL_YBLOOD5,
DECAL_YBLOOD6,
DECAL_GLASSBREAK1,
DECAL_GLASSBREAK2,
DECAL_GLASSBREAK3,
DECAL_BIGSHOT1,
DECAL_BIGSHOT2,
DECAL_BIGSHOT3,
DECAL_BIGSHOT4,
DECAL_BIGSHOT5,
DECAL_SPIT1,
DECAL_SPIT2,
DECAL_BPROOF1, // Bulletproof glass decal
DECAL_GARGSTOMP1, // Gargantua stomp crack
DECAL_SMALLSCORCH1, // Small scorch mark
DECAL_SMALLSCORCH2, // Small scorch mark
DECAL_SMALLSCORCH3, // Small scorch mark
DECAL_MOMMABIRTH, // Big momma birth splatter
DECAL_MOMMASPLAT,
};
Loading