Esim - Technical Difficulties moving a Server
Login:
Password:

Forgot password Register

Article


21
   
Report


Hi there!
I would like to go over some of the technical difficulties when moving a server, especially a game server such as this, and methods of solving them. I've seen a lot of people impatient and not really understanding why battles, working days in a row and the congress election had been proceeding as if nothing happened, "ignoring" the downtime.

The backup
First of all, the state of the database was returned to the way it was day 444 at 03:30. This explains why some people could work yesterday as well as why some couldn't (they had already worked before 03:30 on day 444).

Restoring a pure backup such as this into a game could be pretty damaging to the game itself if no modifications are done before restoring the database. Luckily there seems to have been the means necessary to alter the state of all battles in a way that "suspended" them, thus preventing them to go on while the server was down.

Time representation
In databases the easiest way to store a date and time is to store a single number. This number is composed of the number of seconds that have passed since first of January 1970. Using methods available in most (if not all) programming languages you can then translate this number to show an appropriate date the the user, you. Most likely all (or at least most) events in the game have this number connected to them.

A lost day
That we can "feel" this lost day is simply a result of the hard written code that make up the game and the impropriate structure or preparation of the database before the game was turned back online.

Every day at midnight a procedure is called in the server software telling the game to prepare for the new day. The game then adds 50 health and restores your food and gift limit. All these updates happen in the database. Working days is also a part of the database and would be reset if there wasn't an entry (or most likely, a timestamp) that the user have worked the day before. Looking at the most probable method of using a timestamp we meet a couple of problems.

Since noone managed to work on day 445 the timestamp would represent a date in day 443 or 444 (or less if the user was inactive or similar). The timestamp would correspond to last time of work. The procedure of updating the database detects this as that the last day of work wasn't conducted in the previous day, thus resetting the counter.

A way of solving the above problem would have been to run another procedure on the database, increasing all timestamps of work so that the last day of work would look like day 445 to the database. All this works on the assumption that the timestamp is separated from the production data you can see for the last ten days when looking at a company.

Congress elections
When it comes the the congress elections proceeding like nothing happened things get a little trickier. This since the problem to solve is no longer in the database but in the actual code that interpret the database and make up this entire game.

The times for when elections are to take place and the candidature times are most likely "hardcoded", meaning that they can only be changed by going into the code. Going down into the code is something that should be avoid as much as possible, however in this case there should be time for an exception.

A simple patch to the code, changing the hardcoded dates, would be able to move the elections one or two days forward, giving the appropriate time for people to participate. Then after the elections conclude, another patch could be deployed removing the previous alteration, thus returning the game to normal. The only downside, apart from having to alter the code, is that the congress of that month would be in power for one or two days less than normal.

Depending on the internal structure of the elections in the database some alterations could also be needed here. This however would most likely be fairly simple to fix.

So, why weren't all of this fixed?
There could be several reasons for this. The most likely reason however is that they (Railman) didn't have the time. He had most likely his hands full battling the hosting companies as well as the DDoS. Copying a database also takes quite some time, especially a database of this size, and wanting to get the game back up as soon as possible some things had to be sacrificed for the time being.

These sacrificed things, working days in a row, congress elections etcetera is what is annoying some users. The thing is, if these things where to be fixed before getting the game back online, the game might not even be back online today (depending a little on the skill of the programmer). Having to fix these problems now that the game is running however, Railman stands before quite a challenge where some things can be fixed, while others can not.

The biggest issue is the lost days of work and is something that could be the trickiest to fix. One way of solving it would be to cross-reference the current database with the backup of day 444 and thus giving us the appropriate working days in a row. This however is not as easy as it sounds and I wish Railman good luck and am looking forward to the fix.

Questions?
If you have any questions or feedback, please leave a comment below.

Next article:
Manifest kongressvalet Februari 2013 (13 years ago)

ESim
or
Register for free:
Only letters, numbers, underscore and space are allowed (A-Z,a-z,0-9,_,' ')
Show more

By clicking 'Sign Up!', you agree to the Rules and that you have read the Privacy Policy.

About the game:


USA as a world power? In E-Sim it is possible!

In E-Sim we have a huge, living world, which is a mirror copy of the Earth. Well, maybe not completely mirrored, because the balance of power in this virtual world looks a bit different than in real life. In E-Sim, USA does not have to be a world superpower, It can be efficiently managed as a much smaller country that has entrepreneurial citizens that support it's foundation. Everything depends on the players themselves and how they decide to shape the political map of the game.

Work for the good of your country and see it rise to an empire.

Activities in this game are divided into several modules. First is the economy as a citizen in a country of your choice you must work to earn money, which you will get to spend for example, on food or purchase of weapons which are critical for your progress as a fighter. You will work in either private companies which are owned by players or government companies which are owned by the state. After progressing in the game you will finally get the opportunity to set up your own business and hire other players. If it prospers, we can even change it into a joint-stock company and enter the stock market and get even more money in this way.


In E-Sim, international wars are nothing out of the ordinary.

"E-Sim is one of the most unique browser games out there"

Become an influential politician.

The second module is a politics. Just like in real life politics in E-Sim are an extremely powerful tool that can be used for your own purposes. From time to time there are elections in the game in which you will not only vote, but also have the ability to run for the head of the party you're in. You can also apply for congress, where once elected you will be given the right to vote on laws proposed by your fellow congress members or your president and propose laws yourself. Voting on laws is important for your country as it can shape the lives of those around you. You can also try to become the head of a given party, and even take part in presidential elections and decide on the shape of the foreign policy of a given state (for example, who to declare war on). Career in politics is obviously not easy and in order to succeed in it, you have to have a good plan and compete for the votes of voters.


You can go bankrupt or become a rich man while playing the stock market.

The international war.

The last and probably the most important module is military. In E-Sim, countries are constantly fighting each other for control over territories which in return grant them access to more valuable raw materials. For this purpose, they form alliances, they fight international wars, but they also have to deal with, for example, uprisings in conquered countries or civil wars, which may explode on their territory. You can also take part in these clashes, although you are also given the opportunity to lead a life as a pacifist who focuses on other activities in the game (for example, running a successful newspaper or selling products).


At the auction you can sell or buy your dream inventory.

E-Sim is a unique browser game. It's creators ensured realistic representation of the mechanisms present in the real world and gave all power to the players who shape the image of the virtual Earth according to their own. So come and join them and help your country achieve its full potential.


Invest, produce and sell - be an entrepreneur in E-Sim.


Take part in numerous events for the E-Sim community.


| Terms of Service | Privacy policy | Support | Alpha | Luxia | Primera | Secura | Suna | Sora | Magna | Pangea | e-Sim: Countryballs Country Game
PLAY ON