A few weeks ago, we started investigating a bug regarding the team spirit (TS) updates of the National Teams. Users had realised that the TS drop in these updates were faster than usual. At first sight the updates seemed to be working fine, however after some time we discovered that once a week, during the Sunday update, something fishy happened. On Sundays, the code would either be triggered twice (leading to two team spirit updates, one after the other) or to no update at all.
Now, the team spirit update is applied to all teams at once, so there was never any case that some National Teams had a missed daily update while others had a double drop.
Finding and fixing this bug was made extra tricky by the fact that it only happened once a week, which reduced the number of chances we had to study it. In any case, the bug was easy to fix once the cause was found and since last week, the team spirit updates have been problem-free.
So, why this long post then? The matter is already resolved. Well, we simply thought the source of the problem was so funny, that we couldn’t keep it to ourselves!
Several years ago, we had the idea to create a feature that would include cash funds in the National Teams. As we do with most of our plans, we implemented part of it to see it in action. In the end, we weren’t satisfied with it. We never introduced the feature to the game, and we never mentioned it to the community as a potential addition. However, we did left our experimental code around, and it kept keeping a tally of the National Team cash as part of our weekly economy updates.
Guess what? Every Sunday, together with the team spirit update, all National Teams had a “secret” financial update. The wealthiest team had more than 2 billion SEK in their funds ready to spend on “not-implemented” features! For those of you that are not techie guys or gals, databases have a limit on integers, which means they cannot easily handle numbers that have a value higher than 2^31, or, to be more specific, higher than 2,147,483,647.
The result of this fantastical wealth was an arithmetic overflow that caused the update to either run twice or to just stop without running at all!
Now order is restored and austerity once again rules in the world of Hattrick national teams.
Better post than the previous one 🙂
Nice one 😀
Indeed… was a funny one 😀
And the problems of communities? GMs x users?
And that’s a good example of why you should get rid of technical debt…
Team management cannot be taught, but you can learn
My mistake was that we tried to find someone to manage the teams and tried to teach them or sent them to courses. In fact, it is impossible to teach this, but you can learn it yourself.
You can put a potential team leader next to a successful leader https://slotsmoney.com.ua so that he observes and learns. But just watching is not enough, you need to record lessons daily. This idea extends not only to teams – I tried it on myself. Give yourself the task of writing down daily the five lessons you learned while observing a successful leader. Then in everything that happens at work, you will begin to benefit for yourself.
Is that a picture of Tasos? I always imagined him to look exactly like his photo!
Those of us that Are techie guys/programmers also know, one of the first basic rules…
Always check variables for overflow.
A funny, but also embarrasing incident I think. Glad you shared it still 😉
Please learn from it, to also secure the rest of your code, from such (sorry to mention it again;-) newbeginner mistakes.
Hello I’m Ezequiel27 and I can not send the alignment of the Saudi Arabia team is not walking the old orders and the new interface is not walking either.
The only one I have is the simplest one.
In my teams and the u20 selection is doing well.
Thank you very much
Lisan comela!