Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
ReAPIE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CK
game-dev
ReAPIE
Commits
d954d042
Commit
d954d042
authored
Nov 04, 2019
by
Dmitry
Committed by
Dmitry Novikov
Nov 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement RG_CBasePlayer_DropIdlePlayer hook (#148)
* Implement RG_CBasePlayer_DropIdlePlayer hook
parent
98748209
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
0 deletions
+25
-0
reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc
...i/extra/amxmodx/scripting/include/reapi_gamedll_const.inc
+7
-0
reapi/include/cssdk/dlls/regamedll_api.h
reapi/include/cssdk/dlls/regamedll_api.h
+5
-0
reapi/src/hook_callback.cpp
reapi/src/hook_callback.cpp
+10
-0
reapi/src/hook_callback.h
reapi/src/hook_callback.h
+1
-0
reapi/src/hook_list.cpp
reapi/src/hook_list.cpp
+1
-0
reapi/src/hook_list.h
reapi/src/hook_list.h
+1
-0
No files found.
reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc
View file @
d954d042
...
...
@@ -761,6 +761,13 @@ enum GamedllFunc_CBasePlayer
* Params: (const this)
*/
RG_CBasePlayer_UseEmpty
,
/*
* Description: Called when a idle player is removed from server.
* Return type: void
* Params: (const this, const reason[])
*/
RG_CBasePlayer_DropIdlePlayer
,
};
/**
...
...
reapi/include/cssdk/dlls/regamedll_api.h
View file @
d954d042
...
...
@@ -460,6 +460,10 @@ typedef IHookChainRegistryClass<int, class CBasePlayerWeapon, int, int, float> I
typedef
IHookChainClass
<
bool
,
class
CBasePlayerWeapon
,
int
,
int
,
float
,
float
,
const
char
*
,
const
char
*>
IReGameHook_CBasePlayerWeapon_DefaultShotgunReload
;
typedef
IHookChainRegistryClass
<
bool
,
class
CBasePlayerWeapon
,
int
,
int
,
float
,
float
,
const
char
*
,
const
char
*>
IReGameHookRegistry_CBasePlayerWeapon_DefaultShotgunReload
;
// CBasePlayer::DropIdlePlayer hook
typedef
IHookChainClass
<
void
,
class
CBasePlayer
,
const
char
*>
IReGameHook_CBasePlayer_DropIdlePlayer
;
typedef
IHookChainRegistryClass
<
void
,
class
CBasePlayer
,
const
char
*>
IReGameHookRegistry_CBasePlayer_DropIdlePlayer
;
class
IReGameHookchains
{
public:
virtual
~
IReGameHookchains
()
{}
...
...
@@ -574,6 +578,7 @@ public:
virtual
IReGameHookRegistry_CBasePlayerWeapon_DefaultDeploy
*
CBasePlayerWeapon_DefaultDeploy
()
=
0
;
virtual
IReGameHookRegistry_CBasePlayerWeapon_DefaultReload
*
CBasePlayerWeapon_DefaultReload
()
=
0
;
virtual
IReGameHookRegistry_CBasePlayerWeapon_DefaultShotgunReload
*
CBasePlayerWeapon_DefaultShotgunReload
()
=
0
;
virtual
IReGameHookRegistry_CBasePlayer_DropIdlePlayer
*
CBasePlayer_DropIdlePlayer
()
=
0
;
};
struct
ReGameFuncs_t
{
...
...
reapi/src/hook_callback.cpp
View file @
d954d042
...
...
@@ -552,6 +552,16 @@ void CBasePlayer_UseEmpty(IReGameHook_CBasePlayer_UseEmpty *chain, CBasePlayer *
callVoidForward
(
RG_CBasePlayer_UseEmpty
,
original
,
indexOfEdict
(
pthis
->
pev
));
}
void
CBasePlayer_DropIdlePlayer
(
IReGameHook_CBasePlayer_DropIdlePlayer
*
chain
,
CBasePlayer
*
pthis
,
const
char
*
reason
)
{
auto
original
=
[
chain
](
int
_pthis
,
const
char
*
_reason
)
{
return
chain
->
callNext
(
getPrivate
<
CBasePlayer
>
(
_pthis
),
_reason
);
};
callVoidForward
(
RG_CBasePlayer_DropIdlePlayer
,
original
,
indexOfEdict
(
pthis
->
pev
),
reason
);
}
void
CBaseAnimating_ResetSequenceInfo
(
IReGameHook_CBaseAnimating_ResetSequenceInfo
*
chain
,
CBaseAnimating
*
pthis
)
{
auto
original
=
[
chain
](
int
_pthis
)
...
...
reapi/src/hook_callback.h
View file @
d954d042
...
...
@@ -389,6 +389,7 @@ void CBasePlayer_SetSpawnProtection(IReGameHook_CBasePlayer_SetSpawnProtection *
void
CBasePlayer_RemoveSpawnProtection
(
IReGameHook_CBasePlayer_RemoveSpawnProtection
*
chain
,
CBasePlayer
*
pthis
);
bool
CBasePlayer_HintMessageEx
(
IReGameHook_CBasePlayer_HintMessageEx
*
chain
,
CBasePlayer
*
pthis
,
const
char
*
pMessage
,
float
duration
,
bool
bDisplayIfPlayerDead
,
bool
bOverride
);
void
CBasePlayer_UseEmpty
(
IReGameHook_CBasePlayer_UseEmpty
*
chain
,
CBasePlayer
*
pthis
);
void
CBasePlayer_DropIdlePlayer
(
IReGameHook_CBasePlayer_DropIdlePlayer
*
chain
,
CBasePlayer
*
pthis
,
const
char
*
reason
);
void
CBaseAnimating_ResetSequenceInfo
(
IReGameHook_CBaseAnimating_ResetSequenceInfo
*
chain
,
CBaseAnimating
*
pthis
);
...
...
reapi/src/hook_list.cpp
View file @
d954d042
...
...
@@ -155,6 +155,7 @@ hook_t hooklist_player[] = {
DLL
(
CBasePlayer_RemoveSpawnProtection
),
DLL
(
CBasePlayer_HintMessageEx
),
DLL
(
CBasePlayer_UseEmpty
),
DLL
(
CBasePlayer_DropIdlePlayer
),
};
hook_t
hooklist_gamerules
[]
=
{
...
...
reapi/src/hook_list.h
View file @
d954d042
...
...
@@ -180,6 +180,7 @@ enum GamedllFunc_CBasePlayer
RG_CBasePlayer_RemoveSpawnProtection
,
RG_CBasePlayer_HintMessageEx
,
RG_CBasePlayer_UseEmpty
,
RG_CBasePlayer_DropIdlePlayer
,
// [...]
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment