Forum

> > News > CS2D v1.0.0.6
Forums overviewNews overviewLog in to reply

English CS2D v1.0.0.6

43 replies
Page
To the start Previous 1 2 3 Next To the start

old Re: CS2D v1.0.0.6

DC
Admin Off Offline

Quote
@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.

old Re: CS2D v1.0.0.6

Fyreball
User Off Offline

Quote
@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.

old Re: CS2D v1.0.0.6

DC
Admin Off Offline

Quote
@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.

old Re: CS2D v1.0.0.6

Fyreball
User Off Offline

Quote
@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
Log in to replyNews overviewForums overview