Deceth / Battle-City

Build a city, hire a team, drive a tank, orb the enemy! Multiplayer online game.
http://battlecity.org
GNU General Public License v3.0
48 stars 24 forks source link

Don't hard-code server IP address in client! #35

Closed Deceth closed 11 years ago

Deceth commented 14 years ago

Right now the IP address for the server is hard-coded. This needs to be changed. Users should be able to change the IP address to point to any server of their choice.

rileyw commented 11 years ago

Should the login dialog be expanded to accept an IP address? Screen Shot 2013-04-02 at 12 23 25 PM Screen Shot 2013-04-02 at 12 24 41 PM

Deceth commented 11 years ago

Yes, that would be a perfect way to do things for now, especially if an IP address can still be set by default by whomever is distributing the game. First time players who download the game will just want it to work when they open it. But eventually, players will want a way to host their own server or login to their friends server.

Ideally there can eventually be a metaserver of sorts where players can select a server to join from a list of active servers, but that's overkill at the moment :)

rileyw commented 11 years ago

The metaserver route may have the highest value for players to find a game server with players, low latency, map rotation, and/or running a certain modification. I will attempt to build a version that adds an ip address text box and passes the value to the Winsock object.

rileyw commented 11 years ago

Looking at the game logic the ip address will need to be set before this dialog box; therefore, I am going to rearrange the game logic to open a connection window to capture from the user the appropriate ip address / hostname and port for the game server. These options will be saved to options.ini.

rileyw commented 11 years ago

Been working on documenting the game logic #48

rileyw commented 11 years ago

Should we store the last used game server address in options.ini?

Deceth commented 11 years ago

Yes, when a user loads Battle City, the game should remember the last server used.

The default value for a player loading Battle City for the first time should be = deceth.no-ip.org (this server is not currently online, but it's online more often than any other server... so that's the logic)

If the server is offline, an error message should pop-up indicating: "Server currently offline. Please visit battlecity.org to find a list of active servers".

The goal here being, if the default server is down, players will visit battlecity.org and ask for/find an IP address to an active server. If there are no active servers, it could still start a discussion that ends with someone hosting a server which is a good thing.

Ideally, the IP address input can be a drop-down-list.

Then, if the user changes the default IP address, Battle City could keep a history of the last IP addresses used in the drop-down-list. That way, it would be possible for players to easily re-try connecting to several known servers before giving up.


One day in the future, another project would be to build a light-weight lobby server. This would be a chat-room / metaserver. Battle City servers would connect to the lobby and the lobby would then always have a list of active servers. This is a much bigger under-taking, so I'm only writing this here as a side-note.

rileyw commented 11 years ago

Thank you for the clarification. I have the following notes from your response.

New Business Rule Players should visit battlecity.org to find the current active game server. If they are unable to find an active game server, the player should start a conversation in the community that should result in someone hosting a game server.

  • Battle City will manage a history of game server addresses in history.ini
  • Battle City will display the game server address history through a drop-down list
Deceth commented 11 years ago

Dude, you're awesome! You unraveled my spaghetti ramblings eloquently! :+1:

rileyw commented 11 years ago

A file named "gameServerHistory.log" will be generated to store game server addresses. This is delimited by newline. Need to update the message box text for failing to connect to a game server. @Deceth Should there be a Disconnect button on the Login screen that allows someone to return to the Connection Manager?