- Home /
Is it possible to tell if a standalone player has been started with the -batchmode flag?
I would like to be able to test if an instance of a standalone player has been started with the -batchmode flag so that it will initialize as a server. Is this possible from within the player?
cheers andrew
Answer by Jaap Kreijkamp · Jan 23, 2010 at 04:50 AM
I don't believe there is an official way to do it, but a hack around is:
if (SystemInfo.graphicsDeviceName == "Null Device") {
// batch mode!
}
Note that the NULL rendering device is only implemented on Windows at the moment. On $$anonymous$$ac, batch mode does not actually render anything, but the underlying graphics device is still OpenGL.
Answer by Ashkan_gc · Jan 23, 2010 at 07:34 AM
also you can get any command line argument sent to your game by
string[] s = Environment.GetCommandLineArgs();
the first parameter is the name and path of the executable file and the other args are parameters sent to your app.
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Optimizing Headless Servers 2 Answers
Can you create a Stand alone server for your game? 0 Answers
Insert the model from the server system 0 Answers