Vice City: Multiplayer

Server Development => Community Plugins => Topic started by: habi on Apr 18, 2023, 11:06 AM

Title: RCON with Android client
Post by: habi on Apr 18, 2023, 11:06 AM
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

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

Script Functions

Downloads
(https://i.imgur.com/k8fogmZ.png) (https://www.mediafire.com/file/2g6z094i7n81txz/rcon-plugin-with-client.7z/file)

Mirror 2 (https://sourceforge.net/projects/rcon-vcmp/files/rcon-plugin-with-client.7z/download)

Any player can become admin:
(https://i.imgur.com/WD91V8Y.png)
Title: Re: RCON + Android
Post by: habi on Apr 24, 2023, 03:32 PM
I made a Android app for RCON:

(https://imgur.com/9iAbvjG.jpg)        (https://imgur.com/SuwZnyn.jpg)

Use cmdlist to show all commands.

Download Link: vcmp-rcon.apk (https://www.mediafire.com/file/rwa9jko14owlkl2/vcmp-rcon.apk/file) (mediafire)

Source Code of apk: github (https://github.com/habi498/vcmp_rcon)
Title: Re: RCON + Android
Post by: Ridwan Rz on Apr 30, 2023, 03:02 AM
This gives me feel of using samp rcon ngl! Keep it up man! ;D  ;D
Title: Re: RCON with Android client
Post by: habi on Sep 22, 2023, 05:26 PM
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 )
(https://i.imgur.com/oWUReQv.jpg)
'Loaded Rcon v1.2 by habi' can be seen at middle of server console.

(dependency walker)
(https://i.imgur.com/lBEHqUX.png)

(from a 32-bit linux system):
(https://i.imgur.com/HFL6iaU.png)

(On Ubuntu):
ldd plugins/rcon04rel64.so
(https://i.imgur.com/NM5egDN.png)

(When login failed):
(https://i.imgur.com/zFpDNOD.png)

(IP banned after rcon_max_attempts):
(https://i.imgur.com/XkyrReA.png)

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
(https://i.imgur.com/k8fogmZ.png) (https://www.mediafire.com/file/2g6z094i7n81txz/rcon-plugin-with-client.7z/file)

Mirror (https://sourceforge.net/projects/rcon-vcmp/files/rcon-plugin-with-client.7z/download)