Stopping server during startup?

Hello guys, 

I am currently working with my first plugin, fiddling around. I am currently using the OnTerrainInitialized hook. Is there a way to stop the server startup within my plugin? I don't need anything running afterwards and just want to stop the process as fast as possible.

Any idea on that? Thanks

Hey
I hope then you should try using Init hook, i hope it's called before the OnTerrainInitialized. Try testing it.
To stop the server use this or something similar:
global::SingletonComponent<global::ServerMgr>.Instance.Shutdown();
Net.sv.Stop("quit");
Rust.Application.Quit();​
p.s. taken from the quit command code

Also you can just execute the quit command itself

 

Rust.Application.Quit();​

This works perfect. Thanks a lot. Where is the documentation for all this? I haven't found it yet. Only the hooks you provide.

dnSpy / any other tool like that + dll files + search
In response to RoboBob ():
 Rust.Application.Quit();​This works perfect. Thanks a lot. Where is the documentation for all thi...
Oh ok. So there is no public available documentation on that.
In response to RoboBob ():
Oh ok. So there is no public available documentation on that.
It is part of the game, which you’d need a decompiler to see; we don’t document the entire game, only what we provide.