Switching the server

Switching the server

Next version 1.1.2 will have a new server version as well. So I had to find a way of switching server versions without stopping the game availability for the players!

In the end it was quite an easy solution. New server listens on a new port number, so it is already running while the old server is still serving the data to the players. Both versions running together, each one on a different TCP port.

The new app version 1.1.2 will use the new TCP port, so the players will gradually update the app and switch the server without noticing any change.

There is a trick though. The version 1.1.1 already had a code to alert the user that it is necessary to update the game. So when the new server becomes the only running server the apps will start showing this message and requesting the user to update the game and thus start using the new TCP port.

So how does the old server knows when to alert the old apps to update the game? It is a node.js server so I only have to turn on a switch on the server code and restart the server, quite easy. Before doing that I will also copy all data from the old server into the new one and that is it!

This approach also makes it easier for Google and Apple reviewers to play the game, testing the new app version which already has a new server working. Otherwise they could reject the game for errors concerning the server version instead of the app version.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s