[Include] RemoteRCON - Managing external RCON packets!
#1

RemoteRCON - Managing External RCON Packets!
This include simply takes advantage of the OnRemoteRCONPacket callback in YSF r11(kurta999). It allows you to enable / disable the RCON system completely, whitelist IP addresses, log detailed access attempts, drop RCON packets and more.

This include solely depends on rcon being set to 1 in server.cfg so make sure it's enabled. You can simply use ToggleRCON with the include to disable it. The functions and their uses can be found below:

Functions:

pawn Код:
WhitelistIPAddress(ipaddr[])
Used to whitelist an IP address. This is useless if the whitelisting system isn't enabled with ToggleRemoteWhitelist.

pawn Код:
UnwhitelistIPAddress(ipaddr[])
Used to unwhitelist an IP address. This is useless if the whitelisting system isn't enabled with ToggleRemoteWhitelist.

pawn Код:
ToggleRemoteRCON(bool: toggle)
Used to toggle if the RCON system is activated or not. If disabled, all remote RCON packets are dropped.

pawn Код:
ToggleRemoteWhitelist(bool: toggle)
Used to toggle if the whitelist system is activated or not. If disabled, IP related requests aren't filtered.

pawn Код:
IsIPWhitelisted(ipaddr[])
Used to check if an IP is whitelisted or not.

pawn Код:
ToggleLogging(bool: toggle)
Used for important logs. It is not recommended to disable this, however if used correctly there should be no reason you can't disable it.

Callbacks:

pawn Код:
forward OnRemoteRCONFail(ipaddr[], port, password[], command[], reason);
Called when a remote RCON request fails. There are currently only two reasons as seen below.

Reasons:
0 - Never called, ever(unless the callback is called outside of the include)
1 - Unwhitelisted IP address
2 - Unsuccessful login / request.
3 - RCON system is disabled.

pawn Код:
forward OnRemoteRCONExecuted(ipaddr[], port, password[], command[]);
Called when a remote RCON request is successful. If 0 is returned in this callback, the RCON packet is dropped. If 1 is returned(or anything other than 0 for that matter), the packet is executed and not dropped.

REQUIREMENTS

Ofcourse this needs YSF r11 or above by Kurta999. It should be noted that this has only been tested on a local windows machine within a 20 minute testing session. This has never been tested on any linux machines although it should be identical to a windows system.

DOWNLOAD

The include can be found on github:
https://github.com/Abagail/RemoteRCON/

An example can additionally be found in the git repository. I have also written a tutorial about how you can use this include here:
http://forum.sa-mp.com/showthread.ph...wpost&t=568062
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)