Forum

> > News > CS2D v1.0.0.6
ForenübersichtNews-ÜbersichtEinloggen, um zu antworten

Englisch CS2D v1.0.0.6

43 Antworten
Seite
Zum Anfang Vorherige 1 2 3 Nächste Zum Anfang

alt Re: CS2D v1.0.0.6

DC
Admin Off Offline

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

alt Re: CS2D v1.0.0.6

Fyreball
User Off Offline

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

alt Re: CS2D v1.0.0.6

DC
Admin Off Offline

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

alt Re: CS2D v1.0.0.6

Fyreball
User Off Offline

Zitieren
@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.
Zum Anfang Vorherige 1 2 3 Nächste Zum Anfang
Einloggen, um zu antwortenNews-ÜbersichtForenübersicht