Raised This Month: $51 Target: $400
 12% 

[EXTENSION] Rcon Hooks 1.0


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Samantha
SourceMod Donor
Join Date: Feb 2010
Location: Madagascar
Old 01-07-2011 , 18:29   [EXTENSION] Rcon Hooks 1.0
Reply With Quote #1

RCON Hooks

What?
Rhooks is an extension that allows you to hook 2 major rcon functions, allowing you to change the result. I thought it would be very useful for servers in which admins get rcon access, because you can assign separate passwords per different admins based on ip, and it can also prevent brute force attacks, because you can deny access from anywhere other than your ip!

This is derived from gmsv_rcon from gmod. Contains lots of code from that project.

Compatibility
This currently works on orange box games, on windows only. However im gonna be making a Linux version as soon as i learn how to do it and eventually make versions for l4d.

Forwards
Code:
**
 * Called when an auth message is sent to the engine. 
 * Return Plugin_Continue to allow the auth to be handled by the engine.
 * Else the value in AllowAccess is used.
 *
 * Note: AllowAccess contains whether the engine wants to deny or give access
 *        to the rcon message.
 *
 * @param Password        Password sent in the query.
 * @param AllowAccess    Bool that shows whether the password is valid or invalid.
 * @param Ip            Ip Address of the origin on the message.
 * @param Port            Port of the origin on the message.
 * @return                Plugin_Continue to allow the engine to handle it, else it uses the bool 
 *                         AllowAccess to allow/deny access.
 */

forward Action:OnRconCheckPassword( String:Password[], &bool:AllowAccess, String:Ip[], Port );

/**
 * Called when a data request is sent to the server.
 * Return Plugin_Continue to allow the request to be handled by the engine.
 * Else it is blocked.
 *
 * Note: AllowAccess contains whether the engine wants to deny or give access
 *        to the rcon message.
 *
 * @param Id            Id of the rcon message.
 * @param Request        Request type of the message, ( 2 = Command ), (3 = Auth )
 * @param Data            String the contains the rcon message sent from the Ip.
 * @param Ip            Ip Address of the origin on the message.
 * @param Port            Port of the origin on the message.
 * @return                Plugin_Continue to allow the engine to proccess and preform the message
 *                        otherwise it will be denied.
 */
forward Action:OnWriteDataRequest( Id, Request, String:Data[], String:Ip[], Port );
Info
- Request is the type of rcon message. 2 or 3 are valid types, 2 is used to send commands and 3 is used for authentication. Other types are not used.
- Id is simply the order of commands sent from one source, per session.
- IP format includes the seperaters ( dont know the name of them lol ).

Why?
I've always wanted a more secure rcon method and i saw gmsv_rcon, on facepuch and i've always wanted it in sourcemod. Therefore a few days i wanted to learn C++ cause i was bored so i though why not convert it to work in sourcemod!

Credits
Long list here lol
- gmsv_rcon author chrisaster - most of this is derived from his code, how ever lots was recoded.
- asherkin for taking his time and teaching me how to fix my detour errors and learn more indepth about detours.
- psychonic for telling me to scrap the gmod detours and use the ones SM uses, and providing me with an example of how to use it.
- Drifter for helping me fix countless errors and helping me get started.
- Other people on IRC such as Matt and Kyle.

http://code.google.com/p/samanthas-work/downloads/list

Source Code
__________________
"I give sopport and knolage in making extractions"
"MASTER(D) - dun0: are you mocing me?" -Master the grate

Plugins
Godmode Until Attack | No Block Team Filter
Extensions
Rcon Hooks

Last edited by Samantha; 01-08-2011 at 00:06.
Samantha is offline
 



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 14:25.


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