News
CS2D v1.0.0.6
CS2D v1.0.0.6
43 repliesDC Admin
Offline
@
Fyreball: You can use a Lua admin script to still run commands on the server. This does not require RCon. There is a number of admin scripts in the file archive for that. @
DC: Thanks for your quick reply. Do you happen to know whether it's possible to kind of wrap rcon commands into a lua script? So, for example, I write "rcon sv_restartround 5" and the lua scripts handles that internally instead of using the offical rcon?
Background is, I'm not really eager to use a "bloated" admin script. While they're probably fine, I don't wanna risk security issues (the more functions the more risks) and would also prefer some kind of minimalism.
Thanks a lot for your time. DC Admin
Offline
@
Fyreball:
This is possible and simple:
Use the
say hook
Check if the text begins with "rcon"
If yes: Check if the player who said is has admin rights (via
player you can get the USGN and Steam ID)
If yes: Run the part behind the "rcon" text as a CS2D script using
parse & return 1 to prevent the normal chat output
Can be done with a few lines of Lua.
I recommend to use USGN ID for validation and to enable
sv_checkusgnlogin (it's enabled by default anyway).
Note that with this solution you now have to enter your rcon commands in chat, not in console (since you can't access the server console directly). This bears another tiny risk e.g. when entering sensitive commands containing a password. You may accidentally expose these commands and settings when you mistype "rcon". Moreover your chat input is not encrypted unlike internal RCon commands. @
DC: Thank you so much for the step by step explanation! Gonna dive deeper into lua soon and make a little script.
Have a good year.