Raised This Month: $32 Target: $400
 8% 

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


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
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. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

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
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
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. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 05-16-2018 at 14:27.
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
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. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
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
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
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. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
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?
__________________
Psyk0tik 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



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 19:57.


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