Raised This Month: $404 Target: $400
 101% 

Solved [SM Core] How to get caller ID of console command?


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
Dragokas
Senior Member
Join Date: Nov 2017
Location: Ukraine
Old 05-16-2018 , 13:12   [SM Core] How to get caller ID of console command?
#1

Hi !

.\core\logic\PluginSys.cpp

Code:
void CPluginManager::OnRootConsoleCommand(const char *cmdname, const ICommandArgs *command)
How to extract client ID to check whether command caller is RCON? (ID == 0)

Thanks,
Alex.
__________________
Expert of CMD/VBS/VB6. Malware analyst.

Last edited by Dragokas; 05-16-2018 at 15:01.
Dragokas is offline
KliPPy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-16-2018 , 14:11   Re: [SM Core] How to get caller ID of console command?
#2

The client ID never gets passed around for those commands, so there's no way: https://github.com/alliedmodders/sou...nu.cpp#L60-L63
I bet that's intentional.
__________________

Last edited by KliPPy; 05-16-2018 at 14:11.
KliPPy is offline
Dragokas
Senior Member
Join Date: Nov 2017
Location: Ukraine
Old 05-16-2018 , 14:25   Re: [SM Core] How to get caller ID of console command?
#3

How can I change DefineCommand to pass 1 additional argument (client) in callback function?

And where prototype for OnRootConsoleCommand is stored (or it's better to add additional method to ICommandArgs class)?

Thanks.
__________________
Expert of CMD/VBS/VB6. Malware analyst.

Last edited by Dragokas; 05-16-2018 at 14:27.
Dragokas is offline
Dragokas
Senior Member
Join Date: Nov 2017
Location: Ukraine
Old 05-16-2018 , 15:01   Re: [SM Core] How to get caller ID of console command?
#4

P.S. Not actual anymore.
Found, this handler intended for RCON only.

I was need PlayerManager::OnClientCommand from PlayerManager.cpp.

Topic is resolved.
__________________
Expert of CMD/VBS/VB6. Malware analyst.
Dragokas is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 05-16-2018 , 15:12   Re: [SM Core] How to get caller ID of console command?
#5

The real root menu never receives commands from clients.

What do you actually want to do?
Fyren is offline
Dragokas
Senior Member
Join Date: Nov 2017
Location: Ukraine
Old 05-16-2018 , 15:34   Re: [SM Core] How to get caller ID of console command?
#6

It does not matter. Already done.
Thanks all for help.
__________________
Expert of CMD/VBS/VB6. Malware analyst.
Dragokas is offline
Crasher_3637
AlliedModders Donor
Join Date: May 2012
Old 05-16-2018 , 22:08   Re: [SM Core] How to get caller ID of console command?
#7

Quote:
Originally Posted by Dragokas View Post
It does not matter. Already done.
Thanks all for help.
Could you please post the solution, if possible?
__________________
AFK like JFK
Crasher_3637 is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 05-16-2018 , 22:47   Re: [SM Core] How to get caller ID of console command?
#8

I'm going to assume you're both attempting to hide the plugin list. If so, do not discuss this at all on the forum.
Fyren is offline
Closed Thread


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:11.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode