Hey guys
When player login to the game client app in the lobby tab he can create one or more campaigns, then he can invite friends to his campaign to play with.
When a campaign is created master server will assign it a secret token. The game server will use this token to communicate with the master server. For each campaign, there needs to be a game server running.
Here is the setup process I am thinking about, I want to hear your thoughts about it.
The player will download the game server executables separately.
Through the client app, from the lobby section, the player will be able to create one or more campaigns. Each campaign will have a unique name assigned by the player and a secret token given by the master server.
When the player clicks on the campaign, a Campaign Hosting Guide button will be shown, if the player clicks on it a panel will be displayed with these contents:
Please create a directory on your computer hard disk and name it to your campaign name. Inside that folder create a file named application.properties and copy and paste the below text into it:
port:27015
secretToken=bla bla bla…Now you can execute the game server, upon start it will open a console and asks for a path to the directory you created above. Please set the path and press enter to continue. Done! your server is running now.
After the game server started it will look up that directory and will read the server configuration from there and, it also will create the entities database files inside that directory (this process will be done by Zay-ES).
Now if the player wants to host multiple campaigns he will just need to re-run the game server executable and provide the path to the directory of the campaign he wants to host.
And to determine the game server public IP address, as some clients might have dynamic IP which gets renewed by ISP every time they restart the modem, I thought it would be better to determine it on the master-server side when the game server makes a REST call to my master server (that handles the REST services) to update its status. I can get the game server IP address from HttpServletRequest.getRemoteAddr()
and give it to anyone who wants to connect to that campaign server. Is this a good idea?
What do you guys think, could this whole hosting process be any simpler? Do you have any other suggestions?
Any help is appreciated
Regards
Edit:
Note, I am taking out the NAT port forwarding process for the moment.