- Home /
Sending messages to a command prompt when running in batchmode and nographics
Hi
I am working on a multiplayer game and I am planning on using the command prompt for some server stuff. But I have run into a small problem. I do not know how I can send messages to it. For example:
When a player clicks the server.bat file it should open the server. It has the basic arguments of "Game.exe -batchmode -nographics -executeMethod NetworkScript.StartServer". Now I want to give the player some feedback in the command prompt, like "Server started with this port, this many players e.t.c". But how do I do this? How can I send messages and handle the command prompt from the game?
Thanks in advance
Answer by Landern · Aug 21, 2015 at 03:46 PM
Trying using an empty -logFile argument without a file specified which should allow the logfile to print to screen/console. Use the print() method in unity as some in the past have had success with it outputting to the logfile/console.
I tried this and I am not sure if it works or not. The way I currently have this setup is "game.exe -batchmode -nographics -logFile -execute$$anonymous$$ethod Network$$anonymous$$anager_Custom.CommandPromptStartServer" and this does not seem to work. The function is a public static function and the script is a $$anonymous$$onoBehaviour. Do you know if I am doing something wrong here?
-logfile will only work for $$anonymous$$ac and Linux machines.
Your answer
![](https://koobas.hobune.stream/wayback/20220612000907im_/https://answers.unity.com/themes/thub/images/avi.jpg)