RCON with Android client

Started by habi, Apr 18, 2023, 11:06 AM

Previous topic - Next topic

habi

Hi Welcome to my version of RCON. This one operates on the same port as the server ( 8192, 8193, etc ).

Installation of Plugin
Put rcon04rel32/64.dll on 'plugins' folder. Add rcon04rel32 (or 64) to server.cfg
Add a new line rcon_password ChangeMe

Quotegamemode Default
port 8192
plugins  rcon04rel32 xmlconf04rel32 sqlite04rel32  squirrel04rel32
rcon_password ChangeMe
...

Connecting to server
You can
  • Connect with a remote console (i have made one, see downloads)
  • Join game and become admin by typing /rcon login password

Commands
CommandDescription
/rcon cmdlistShows a list with commands.
/rcon echo textPrints text on server console.
/rcon hostname newhostname          Changes the hostname of the server.
/rcon gamemodetext textSets the gamemode text of the server
/rcon password newpasswordSets the server password. Use this command without second parameter to remove the password
/rcon rcon_password password    Changes the rcon_password until shutdown.
/rcon playersFetches a list of players with their IDs.
/rcon kick id/nameKicks a player
/rcon ban id/nameBans a player
/rcon banip ipBans an IP Address
/rcon unbanip ipUnbans an IP Address
/rcon say textShows a message in game to every players.
/rcon gravityChanges the gravity. eg. /rcon gravity 0.008
/rcon weatherChanges the weather
/rcon exitShut downs the server
/rcon plgncmdSends a plugin command.
/rcon execCompiles a string and call it ( for squirrel ). eg. /rcon exec return GetPlayers()
*/rcon loadfsLoads a filterscript
*/rcon unloadfsUnloads a filterscript
*/rcon reloadfsReloads a filterscript
*Requires my other plugin filterscript04rel32 (or 64)

Connecting through remote console
You can use the remote console rcon_client.exe provided in downloads. Here, i am connecting to the server at localhost. 1234 is my rcon password. You can use two options - i or c. i means interactive and c means execute command and exit. Here i is used. The following is a preview of command line of windows.
QuoteC:\Users\...\client>rcon_client -h 127.0.0.1 -P 8192 -p 1234 -i
>cmdlist
echo, hostname, gamemodetext, kick, ban, say,players, banip, unbanip, gravity, weather, rcon_password, password, exit, plgncmd, exec, loadfs, unloadfs, realoadfs
Callbacks or plugin commands
  • onRconLoginFailed( ipaddress )
    If a player failed to login through in-game or a user failed to login through remote-console, the function is called.
    ipaddress  -The ip address of the user/player who failed to login
    If the squirrel V.M is not available, a plugin command with 0x2A1A3D01 as identifier and ip address as message is send.
  • onRconCommand( command, ip )
    This function is called when a player logged in as admin or a remote user has typed a command which is not in the cmdlist.
    command  -The command which was typed. You must parse this and separate tokens if needed.
    ip  -The ip address of the user/player who typed the command
    If a string is returned by this function, it is send back to the client or player who typed the rcon command.

    If the squirrel virtual machine is not available, a plugin command 0x2A1A3D02 is send with command and ip formatted as "%s %s".

Script Functions
  • SendRconCommand( command )
    An rcon command can be send with the above function and passing command as parameter. If squirrel gamemode is not available, again this can be achieved by sending a plugin command 0x2A1A3D09 with command as message.

Downloads


Mirror 2

Any player can become admin:

habi

#1
I made a Android app for RCON:

       

Use cmdlist to show all commands.

Download Link: vcmp-rcon.apk (mediafire)

Source Code of apk: github

Ridwan Rz

This gives me feel of using samp rcon ngl! Keep it up man! ;D  ;D

habi

#3
Version 1.2 (21.Sep 2023)

QuoteAdded support for Windows XP.

Added Security. Through server.cfg, rcon_max_attempts can be defined and after reaching this limit, the user's IP will be banned and queries from this IP will be dropped. By default it is 5.

plgncmd accepts hexcodes. Earlier the command identifier of plugin commands was accepted only as decimal numbers, now you can prefix 0x and pass hexadecimal numbers also.

plgncmd works without 'message' part. i.e. it can be omitted and will be treated as "". i.e. earlier plgncmd 123456 x was necessary. x being the message part. Now plgncmd 123456 will send the plugin command with an empty string.

Now 'exec' is shown on 'cmdlist' only if squirrel server. Otherwise, it is not shown.

Rcon client update: Now host (-h) will default to 127.0.0.1, and port (-P) will default to 8192. Thus, to connect to the local server (server running on the same machine), rcon -p xxx where xxx is the password will be enough. (-p) is the (password) switch.

The new server.cfg:
plugins  squirrel04rel32 rcon04rel32
sqgamemode scripts/main.nut
rcon_password 1234
rcon_max_attempts 7

Screenshot(s) ( from XP )

'Loaded Rcon v1.2 by habi' can be seen at middle of server console.

(dependency walker)


(from a 32-bit linux system):


(On Ubuntu):
ldd plugins/rcon04rel64.so


(When login failed):


(IP banned after rcon_max_attempts):


Note that rcon_password need not be number like 34566, but can be any string like 40@Ej2_YAGk+ aswell.

links update in first post:
Quote from: habi on Apr 18, 2023, 11:06 AMDownloads


Mirror