Steemnova - Correct language for fleet activities
Bug Fix
What was the issue?
The messages that are generated by fleet activities were always in the language of the attacking player, even if the receiver is using another language.
Also see my bugreport
Example:

Should be in german instead:

What was the solution?
Even though the code change was very small, it was a very hard to spot issue.
First I thought that the language for the user was never read and that the variable from the attacker was just reused, so I looked into "MissionCaseAttack.class.php" where the report is generated:
Click to go directly to github
But as you can see a method called "getLanguage" is used, with the correct userId...
After looking through the code some more and finding nothing wrong with it, I looked into the "getLanguage" method:
Click to go directly to github
Well the code doesn't look too bad, it get the language or the userId. If the language is null and a userId is provided it would then select the language for a user...
It then builds a language object and returns that.
But after looking through the method in detail I realized that "userId" was not used in the select! Instead the userid of the owner of the fleet (the attacker) was used to select the language. After realizing this it was very easy to fix.
Click to go directly to github
This didn't only fix the issues with player attacking others, but also a few more, like pointed out by @mys.
This also fixes foreign messages about incoming transport deliveries, ACS invitations and others
Relevant Links
Posted on Utopian.io - Rewarding Open Source Contributors
Leave Steemnova - Correct language for fleet activities to:
Read more #utopian-io posts
Best Posts From MWFIAE
We have not curated any of mwfiae's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From MWFIAE
- Sleepy me messed up
- [DE] Projekt-Update fivefingergames und steemknights
- Snax Account Authentication
- [DE] Mintos Rückblick 2018
- ... bei mir hat der Postbote geklingelt!
- [Steemplus API] [v1.0] [Bug-Report] Not counting SPP for transfers to postpromoter
- [Steemplus API] [v1.0] [Bug-Report] DOS Vulnerability in the API caused by the SPP-Job
- Steemit-Sidebar - Version 0.6.1
- Pushing Reputation 4 Byteball Airdrop
- [DE] Mintos führt das Freunde werben Programm wieder ein