MWFIAE avatar

Steemnova - Correct language for fleet activities

mwfiae

Published: 17 Mar 2018 › Updated: 17 Mar 2018Steemnova - Correct language for fleet activities

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:

image.png
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:
image.png

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.
image.png

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@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:

Written by

German Developer | CIO@fivefingergames | Martin wuschelt flauschige Igel aus England

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