English CS2D v1.0.0.6

43 replies
Goto Page
To the start Previous 1 2 3 Next To the start
05.01.18 05:19:27 pm
Up
DC
Admin
Offline Off
@user 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.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
05.01.18 05:37:35 pm
Up
@user 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.
05.01.18 05:46:33 pm
Up
DC
Admin
Offline Off
@user Fyreball:
This is possible and simple:

• Use the cs2d lua hook say hook
• Check if the text begins with "rcon"
• If yes: Check if the player who said is has admin rights (via cs2d lua cmd player you can get the USGN and Steam ID)
• If yes: Run the part behind the "rcon" text as a CS2D script using cs2d lua cmd 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 cs2d cmd 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.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
05.01.18 06:52:57 pm
Up
@user 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.
To the start Previous 1 2 3 Next To the start