Hi there!
This is my first very first post, but not my last
Is there any way to get the CommandLine (or maybe is accessible by other way) to get a command output?
For example (Blue=Input, Green=Output):
> server.maxplayers
server.maxplayers: "50"
I suppose that many of you will think that this may suppose a kind of security breach because you can access launch parameters at execution time but I tried with some importants, and, for example rcon.password is completely blocked.
Many thanks for your time!
Solved [C#] Execute command and get the output
Discussion in 'Rust Development' started by Luisango, Feb 24, 2015.
-
Wulf Community Admin
ConsoleSystem.SystemRealm.Normal("server.maxplayers 50") should work just fine.
You can view the other functions by using a program such as JustDecompiler and digging into Assembly-CSharp.dll. -
Wulf I don't think he wants to run the command but just get the value thats currently set.
If so just call:
var maxplayers = server.maxplayers; --maxplayers and most fields in the server class are static. -
Wulf Community Admin
-
Marked as solved, thanks Wulf and Hatemail, both of you solved both of my doubts!