For my game, I would like to let users setup the game server before logging in.
The server could be distant or on the same pc, no problem, But the server is ran in a Headless context,
so I’m trying to get how I should implement a user’s friendly GUI in this case. (which seems to make no sense…)
Is there a way to use some default context and then switch in runtime to a headless context ?
Or maybe the server gui appli should close when hit “start” and then run another headless appli with parameters ?
You want to have a JME GUI for your server? That seems a bit overkill.
Just create a normal Java GUI that launches your server… and really a headless JME application is 90% overkill, I think. None of my network games do it… they just create their own game loop and… well, that’s it. That’s really the only thing you need.
Well i will just list stuff, you have to differenbtiate pro and cons yourself:
Swing gui, that starts the game logic.
Add a argument to the game, that sets gui or headless + server settings. Now if server is started, using processlauncher start a secondary jvm with the cmd line server, System.exit the first one
Have two jars, one server one gui, that communicate via network. Allows to start server on a terminal only linux root, and connect the gui via internet after that to set map/kick people ect.
Make server controllable via cmd, and do a low level ui in the style of old DOS applications.
I don’t NEED a JME gui for the serveur, but using nifty would be simplier than learning how to skin nicely my swing… Just look & feel thing.
I’ll work on swing gui then.