mirror of
https://github.com/glest/glest-source.git
synced 2025-09-29 17:09:02 +02:00
- initial work for a headless server. Currently this code allows you to launch a server with the commandline option: --masterserver-mode
The first client that connects to the server is the administrator and is able to change most settings and launch the game. Still lots of work to do but this is a start.
This commit is contained in:
@@ -102,6 +102,7 @@ const char *GAME_ARGS[] = {
|
||||
"--autostart-lastgame",
|
||||
"--connecthost",
|
||||
"--starthost",
|
||||
"--masterserver-mode",
|
||||
"--load-scenario",
|
||||
"--preview-map",
|
||||
"--version",
|
||||
@@ -145,6 +146,7 @@ enum GAME_ARG_TYPE {
|
||||
GAME_ARG_AUTOSTART_LASTGAME,
|
||||
GAME_ARG_CLIENT,
|
||||
GAME_ARG_SERVER,
|
||||
GAME_ARG_MASTERSERVER_MODE,
|
||||
GAME_ARG_LOADSCENARIO,
|
||||
GAME_ARG_PREVIEW_MAP,
|
||||
GAME_ARG_VERSION,
|
||||
@@ -1010,6 +1012,7 @@ void printParameterHelp(const char *argv0, bool foundInvalidArgs) {
|
||||
printf("\n%s\t\tAutomatically starts a game with the last game settings you played.",GAME_ARGS[GAME_ARG_AUTOSTART_LASTGAME]);
|
||||
printf("\n%s=x\t\t\tAuto connects to a network server at IP or hostname x",GAME_ARGS[GAME_ARG_CLIENT]);
|
||||
printf("\n%s\t\t\tAuto creates a network server.",GAME_ARGS[GAME_ARG_SERVER]);
|
||||
printf("\n%s\t\t\tRuns as a masterserver.",GAME_ARGS[GAME_ARG_MASTERSERVER_MODE]);
|
||||
printf("\n%s=x\t\tAuto loads the specified scenario by scenario name.",GAME_ARGS[GAME_ARG_LOADSCENARIO]);
|
||||
printf("\n%s=x\t\tAuto Preview the specified map by map name.",GAME_ARGS[GAME_ARG_PREVIEW_MAP]);
|
||||
printf("\n%s\t\t\tdisplays the version string of this program.",GAME_ARGS[GAME_ARG_VERSION]);
|
||||
@@ -3125,6 +3128,9 @@ int glestMain(int argc, char** argv) {
|
||||
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SERVER]) == true) {
|
||||
program->initServer(mainWindow,false,true);
|
||||
}
|
||||
else if(hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_MASTERSERVER_MODE])) == true) {
|
||||
program->initServer(mainWindow,false,true,true);
|
||||
}
|
||||
else if(hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_AUTOSTART_LASTGAME])) == true) {
|
||||
program->initServer(mainWindow,true,false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user