Page MenuHomeWildfire Games

Simple refactoring of build information getters
ClosedPublic

Authored by vladislavbelov on Mar 1 2018, 8:40 PM.

Details

Reviewers
elexis
Stan
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22035: Refactor build information getters and remove the useless code.
Summary

Removes a useless code and remove unneeded conversions.

Test Plan
  1. Apply the patch and compile the game
  2. Run the game
  3. Check build time and build revision in the main menu

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 5802
Build 9725: Vulcan BuildJenkins

Event Timeline

vladislavbelov created this revision.Mar 1 2018, 8:40 PM
vladislavbelov added a reviewer: Restricted Owners Package.
elexis added a subscriber: elexis.Mar 1 2018, 9:01 PM

Splitting the functions seems like a good idea. That current argument is ugly, nondescriptive.

source/ps/scripting/JSInterface_Debug.cpp
71

Vladislav you might want to have a look at temples open revisions, there is one changing how the date string is put together.
But as long as this doesn't change the format, can be considered independent.

I'm unconvinced that we want to return a string, a timestamp might be nicer. We do that in XmppClient.cpp too. But then again, see one of temples patches.

79

Agreed to nuke, as this information is covered by the other code already.

103

Hm. Just because it's not used yet doesn't mean it can't be used.
But just returning the unix timestamp would cover all cases.

vladislavbelov added inline comments.Mar 1 2018, 9:06 PM
source/ps/scripting/JSInterface_Debug.cpp
71

I'm not sure about returning a time, but probably it'd be useful in some cases. I suggest to make it in different patches.

103

I think, we don't need to have the time (only hours, minits and seconds) for the build. Because we don't build and distribute realeases couple times per day.

elexis added inline comments.Mar 1 2018, 9:31 PM
source/ps/scripting/JSInterface_Debug.cpp
103

If I recall correctly, UDate is a timestamp, so just returning that would cover all use cases independent of business logic, shorten the hell out this function and in JS we can more quickly change our minds.

In fact developers can trigger autobuilds manually then you get more than one per day.
Then again people should use revision number to distinguish them.

I guess you could commit it and let the one wanting to use the time to reimplement it. But it sounds like cheaping out, as it shouldn't really be too much effort and would prevent rewriting the same code twice.

vladislavbelov added inline comments.Mar 1 2018, 9:35 PM
source/ps/scripting/JSInterface_Debug.cpp
103

But the __DATE__ contains only a date string. So if we want a timestamp, we need to concat it with the __TIME__ after conversions.

Vulcan added a subscriber: Vulcan.Mar 1 2018, 10:52 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Default...
Executing section Source...

source/ps/scripting/JSInterface_Debug.cpp
|  44| »   return·*(volatile·int*)0;
|    | [MAJOR] CPPCheckBear (nullPointer):
|    | Null pointer dereference
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 413| 413| 				// Players see colors depending on diplomacy
| 414| 414| 				g_DisplayedPlayerColors[i] =
| 415| 415| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 416|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
|    | 416|+						g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 417| 417| 					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 418| 418| 					g_DiplomacyColorPalette.Enemy;
| 419| 419| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 414| 414| 				g_DisplayedPlayerColors[i] =
| 415| 415| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 416| 416| 					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 417|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
|    | 417|+							g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 418| 418| 					g_DiplomacyColorPalette.Enemy;
| 419| 419| 
| 420| 420| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 415| 415| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 416| 416| 					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 417| 417| 					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 418|    |-					g_DiplomacyColorPalette.Enemy;
|    | 418|+								g_DiplomacyColorPalette.Enemy;
| 419| 419| 
| 420| 420| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 421| 421| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 660| 660| 					"civ": setStringTags(g_CivData[g_Players[g_ViewedPlayer].civ].Name, { "font": "sans-bold-stroke-14" }),
| 661| 661| 					"hotkey_civinfo": colorizeHotkey("%(hotkey)s", "civinfo"),
| 662| 662| 					"hotkey_structree": colorizeHotkey("%(hotkey)s", "structree")
| 663|    |-			});
|    | 663|+				});
| 664| 664| 	}
| 665| 665| 
| 666| 666| 	Engine.GetGUIObjectByName("optionFollowPlayer").hidden = !g_IsObserver || !isPlayer;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1256|1256| 
|1257|1257| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1258|1258| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1259|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1259|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1260|1260| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1261|1261| 	});
|1262|1262| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1257|1257| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1258|1258| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1259|1259| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1260|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1260|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1261|1261| 	});
|1262|1262| 
|1263|1263| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1258|1258| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1259|1259| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1260|1260| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1261|    |-	});
|    |1261|+		});
|1262|1262| 
|1263|1263| 	let resCodes = g_ResourceData.GetCodes();
|1264|1264| 	for (let r = 0; r < resCodes.length; ++r)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1747|1747| 	for (let rct of resourcesCounterTypes)
|1748|1748| 		for (let rt of resourcesTypes)
|1749|1749| 			reportObject[rt + rct.substr(9)] = playerStatistics[rct][rt];
|1750|    |-			// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|    |1750|+	// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|1751|1751| 
|1752|1752| 	reportObject.vegetarianFoodGathered = playerStatistics.resourcesGathered.vegetarianFood;
|1753|1753| 	for (let type of unitsClasses)

binaries/data/mods/public/gui/session/session.js
|1084| »   let·getPanelEntNameTooltip·=·panelEntState·=>·"[font=\"sans-bold-16\"]"·+·template.name.specific·+·"[/font]";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEntState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1159| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1160| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1161| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

Link to build: https://jenkins.wildfiregames.com/job/differential/127/display/redirect

temple added a subscriber: temple.Mar 2 2018, 7:25 PM

My patches were D795, D1116, D1117, D1118 which dealt with translating JS times. I think the build time is a separate thing which uses the locale, so it doesn't go through Transifex.

elexis added inline comments.Mar 2 2018, 7:28 PM
source/ps/scripting/JSInterface_Debug.cpp
103

String concatenation shouldn't be too ugly here, would it?

vladislavbelov added inline comments.Mar 4 2018, 5:09 PM
source/ps/scripting/JSInterface_Debug.cpp
103

Do you suggest to return an object like:

return {
    "date": ...
    "time": ...
};

?

elexis added inline comments.Mar 4 2018, 5:14 PM
source/ps/scripting/JSInterface_Debug.cpp
103

Nah, returning a timestamp would be the easiest type to handle for JS.

I thought of
UDate dateTime = g_L10n.ParseDateTime(__DATE__ concat __TIME__, "YYY... HH:mm:ss", Locale::getUS());

Adds a build timestamp.

elexis added inline comments.Mar 4 2018, 10:23 PM
source/ps/scripting/JSInterface_Debug.cpp
71

Did you have a look at temples patches? (I didn't) I suspect we want to do the timestamp to string conversion in JS.

80

Good, but why not always return std::time_t? We only have and only need 1s precision anyway.

vladislavbelov added inline comments.Mar 4 2018, 10:29 PM
source/ps/scripting/JSInterface_Debug.cpp
71

Yep, and I think it'd better to split the C++ part refactoring and an applying of temple's patches.

80

Because std::time return the current time, what should we return else?

Stan added a subscriber: Stan.Mar 4 2018, 10:33 PM
Stan added inline comments.
source/ps/scripting/JSInterface_Debug.cpp
79

Could be inlined ;)

elexis added inline comments.Mar 4 2018, 10:48 PM
source/ps/scripting/JSInterface_Debug.cpp
71

It would still be easier to add the new JS function and patch that afterwards than adding a new function and deleting the new function and adding a new other function, no?

80

I was refering to the return type of the function, double. But I recall we can't convert 64bit numbers to JS numbers, so should be ok as is.

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Default...
Executing section Source...

source/ps/scripting/JSInterface_Debug.cpp
|  44| »   return·*(volatile·int*)0;
|    | [MAJOR] CPPCheckBear (nullPointer):
|    | Null pointer dereference
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 413| 413| 				// Players see colors depending on diplomacy
| 414| 414| 				g_DisplayedPlayerColors[i] =
| 415| 415| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 416|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
|    | 416|+						g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 417| 417| 					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 418| 418| 					g_DiplomacyColorPalette.Enemy;
| 419| 419| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 414| 414| 				g_DisplayedPlayerColors[i] =
| 415| 415| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 416| 416| 					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 417|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
|    | 417|+							g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 418| 418| 					g_DiplomacyColorPalette.Enemy;
| 419| 419| 
| 420| 420| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 415| 415| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 416| 416| 					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 417| 417| 					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 418|    |-					g_DiplomacyColorPalette.Enemy;
|    | 418|+								g_DiplomacyColorPalette.Enemy;
| 419| 419| 
| 420| 420| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 421| 421| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 660| 660| 					"civ": setStringTags(g_CivData[g_Players[g_ViewedPlayer].civ].Name, { "font": "sans-bold-stroke-14" }),
| 661| 661| 					"hotkey_civinfo": colorizeHotkey("%(hotkey)s", "civinfo"),
| 662| 662| 					"hotkey_structree": colorizeHotkey("%(hotkey)s", "structree")
| 663|    |-			});
|    | 663|+				});
| 664| 664| 	}
| 665| 665| 
| 666| 666| 	Engine.GetGUIObjectByName("optionFollowPlayer").hidden = !g_IsObserver || !isPlayer;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1256|1256| 
|1257|1257| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1258|1258| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1259|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1259|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1260|1260| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1261|1261| 	});
|1262|1262| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1257|1257| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1258|1258| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1259|1259| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1260|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1260|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1261|1261| 	});
|1262|1262| 
|1263|1263| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1258|1258| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1259|1259| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1260|1260| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1261|    |-	});
|    |1261|+		});
|1262|1262| 
|1263|1263| 	let resCodes = g_ResourceData.GetCodes();
|1264|1264| 	for (let r = 0; r < resCodes.length; ++r)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1747|1747| 	for (let rct of resourcesCounterTypes)
|1748|1748| 		for (let rt of resourcesTypes)
|1749|1749| 			reportObject[rt + rct.substr(9)] = playerStatistics[rct][rt];
|1750|    |-			// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|    |1750|+	// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|1751|1751| 
|1752|1752| 	reportObject.vegetarianFoodGathered = playerStatistics.resourcesGathered.vegetarianFood;
|1753|1753| 	for (let type of unitsClasses)

binaries/data/mods/public/gui/session/session.js
|1084| »   let·getPanelEntNameTooltip·=·panelEntState·=>·"[font=\"sans-bold-16\"]"·+·template.name.specific·+·"[/font]";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEntState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1159| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1160| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1161| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

Link to build: https://jenkins.wildfiregames.com/job/differential/158/display/redirect

bb added a subscriber: bb.Mar 19 2018, 11:09 PM
bb added inline comments.
binaries/data/mods/public/gui/session/session.js
1480–1481

why don't we merge those dupe functions in gui/common?

vladislavbelov updated this revision to Diff 6352.EditedApr 8 2018, 8:11 PM

Added @bb's suggestion, @elexis's suggestion to remove the build date will be completed after @temple's fixes (when they will be committed) and committed in other diff. This one is mostly needed for the C++ part, to make changes for svn_revision, and then for windows resources.

Vulcan added a comment.Apr 8 2018, 8:16 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Default...
Executing section Source...

source/ps/scripting/JSInterface_Debug.cpp
|  44| »   return·*(volatile·int*)0;
|    | [MAJOR] CPPCheckBear (nullPointer):
|    | Null pointer dereference
Executing section JS...

binaries/data/mods/public/gui/common/functions_utility.js
| 189| »   }·catch·(e)·{
|    | [NORMAL] ESLintBear (no-empty):
|    | Empty block statement.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 407| 407| 				// Players see colors depending on diplomacy
| 408| 408| 				g_DisplayedPlayerColors[i] =
| 409| 409| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 410|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
|    | 410|+						g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 411| 411| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 412| 412| 					getDiplomacyColor("enemy");
| 413| 413| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 408| 408| 				g_DisplayedPlayerColors[i] =
| 409| 409| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 410| 410| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 411|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
|    | 411|+							g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 412| 412| 					getDiplomacyColor("enemy");
| 413| 413| 
| 414| 414| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 409| 409| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 410| 410| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 411| 411| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 412|    |-					getDiplomacyColor("enemy");
|    | 412|+								getDiplomacyColor("enemy");
| 413| 413| 
| 414| 414| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 415| 415| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 665| 665| 					"civ": setStringTags(g_CivData[g_Players[g_ViewedPlayer].civ].Name, { "font": "sans-bold-stroke-14" }),
| 666| 666| 					"hotkey_civinfo": colorizeHotkey("%(hotkey)s", "civinfo"),
| 667| 667| 					"hotkey_structree": colorizeHotkey("%(hotkey)s", "structree")
| 668|    |-			});
|    | 668|+				});
| 669| 669| 	}
| 670| 670| 
| 671| 671| 	Engine.GetGUIObjectByName("optionFollowPlayer").hidden = !g_IsObserver ||
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1255|1255| 
|1256|1256| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1257|1257| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1258|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1258|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1259|1259| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1260|1260| 	});
|1261|1261| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1256|1256| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1257|1257| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1258|1258| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1259|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1259|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1260|1260| 	});
|1261|1261| 
|1262|1262| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1257|1257| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1258|1258| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1259|1259| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1260|    |-	});
|    |1260|+		});
|1261|1261| 
|1262|1262| 	let resCodes = g_ResourceData.GetCodes();
|1263|1263| 	for (let r = 0; r < resCodes.length; ++r)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1747|1747| 	for (let rct of resourcesCounterTypes)
|1748|1748| 		for (let rt of resourcesTypes)
|1749|1749| 			reportObject[rt + rct.substr(9)] = playerStatistics[rct][rt];
|1750|    |-			// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|    |1750|+	// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|1751|1751| 
|1752|1752| 	reportObject.vegetarianFoodGathered = playerStatistics.resourcesGathered.vegetarianFood;
|1753|1753| 	for (let type of unitsClasses)

binaries/data/mods/public/gui/session/session.js
|1083| »   let·getPanelEntNameTooltip·=·panelEntState·=>·"[font=\"sans-bold-16\"]"·+·template.name.specific·+·"[/font]";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEntState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1158| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1159| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1160| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

Link to build: https://jenkins.wildfiregames.com/job/differential/367/display/redirect

elexis accepted this revision.Apr 23 2018, 6:51 PM

I still disapprove of of keeping GetBuildDate when we already have a timestamp function in the interface which could be called from JS (doing translations in JS is more comfortable than C++), but it is a good enough improvement if you are not interested in further implementing this.

Patch needs a rebase for rP21688, couldn't test, but nothing of logic changed meanwhile and in this diff, so it should work.
If you want to rebase the diff first before committing that wouldn't hurt, but accepting in case you tested well.

binaries/data/mods/public/gui/session/session.js
1489

nice find

source/ps/scripting/JSInterface_Debug.cpp
66

(Being exact is something we should expect all comments to be, so it shouldn't have to be mentioned.) ScriptGlue.cpp. Ok.

76

Since this line is the exact same as before, this shall not break.

89

Correct, initializing a wstring from a wchar_t array is available according to http://www.cplusplus.com/reference/string/basic_string/basic_string/

91

Ok, same string conversion was here before and only an unneeded sprintf removed

source/ps/scripting/JSInterface_Debug.h
35

as wished and correct

This revision is now accepted and ready to land.Apr 23 2018, 6:51 PM

Rebase the diff.

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Default...
Executing section Source...

source/ps/scripting/JSInterface_Debug.cpp
|  44| »   return·*(volatile·int*)0;
|    | [MAJOR] CPPCheckBear (nullPointer):
|    | Null pointer dereference
Executing section JS...

binaries/data/mods/public/gui/common/functions_utility.js
| 178| »   }·catch·(e)·{
|    | [NORMAL] ESLintBear (no-empty):
|    | Empty block statement.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 407| 407| 				// Players see colors depending on diplomacy
| 408| 408| 				g_DisplayedPlayerColors[i] =
| 409| 409| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 410|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
|    | 410|+						g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 411| 411| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 412| 412| 					getDiplomacyColor("enemy");
| 413| 413| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 408| 408| 				g_DisplayedPlayerColors[i] =
| 409| 409| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 410| 410| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 411|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
|    | 411|+							g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 412| 412| 					getDiplomacyColor("enemy");
| 413| 413| 
| 414| 414| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 409| 409| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 410| 410| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 411| 411| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 412|    |-					getDiplomacyColor("enemy");
|    | 412|+								getDiplomacyColor("enemy");
| 413| 413| 
| 414| 414| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 415| 415| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 665| 665| 					"civ": setStringTags(g_CivData[g_Players[g_ViewedPlayer].civ].Name, { "font": "sans-bold-stroke-14" }),
| 666| 666| 					"hotkey_civinfo": colorizeHotkey("%(hotkey)s", "civinfo"),
| 667| 667| 					"hotkey_structree": colorizeHotkey("%(hotkey)s", "structree")
| 668|    |-			});
|    | 668|+				});
| 669| 669| 	}
| 670| 670| 
| 671| 671| 	// Following gaia can be interesting on scripted maps
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1261|1261| 
|1262|1262| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1263|1263| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1264|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1264|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1265|1265| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1266|1266| 	});
|1267|1267| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1262|1262| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1263|1263| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1264|1264| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1265|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1265|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1266|1266| 	});
|1267|1267| 
|1268|1268| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1263|1263| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1264|1264| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1265|1265| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1266|    |-	});
|    |1266|+		});
|1267|1267| 
|1268|1268| 	let resCodes = g_ResourceData.GetCodes();
|1269|1269| 	for (let r = 0; r < resCodes.length; ++r)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1753|1753| 	for (let rct of resourcesCounterTypes)
|1754|1754| 		for (let rt of resourcesTypes)
|1755|1755| 			reportObject[rt + rct.substr(9)] = playerStatistics[rct][rt];
|1756|    |-			// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|    |1756|+	// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|1757|1757| 
|1758|1758| 	reportObject.vegetarianFoodGathered = playerStatistics.resourcesGathered.vegetarianFood;
|1759|1759| 	for (let type of unitsClasses)

binaries/data/mods/public/gui/session/session.js
|1089| »   let·getPanelEntNameTooltip·=·panelEntState·=>·"[font=\"sans-bold-16\"]"·+·template.name.specific·+·"[/font]";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEntState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1164| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1165| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1166| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

Link to build: https://jenkins.wildfiregames.com/job/differential/432/display/redirect

I didn't consider that we are in string freeze.
pregame/ and common/ are part of public-gui-other.pot, session is part of public-gui-ingame.pot.
So it should only be a removed string and a relocated one in the same translation resources. So it ought not to change strings, but I'd suggest to wait one more week and not taking any responsibilities for any broken SF.

Vulcan added a comment.Jan 2 2019, 2:39 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Default...
Executing section Source...

source/ps/scripting/JSInterface_Debug.cpp
|  43| »   return·*(volatile·int*)0;
|    | [MAJOR] CPPCheckBear (nullPointer):
|    | Null pointer dereference
Executing section JS...

binaries/data/mods/public/gui/common/functions_utility.js
|  86| »   catch·(e)·{}
|    | [NORMAL] ESLintBear (no-empty):
|    | Empty block statement.

binaries/data/mods/public/gui/common/functions_utility.js
| 177| »   catch·(e)·{}
|    | [NORMAL] ESLintBear (no-empty):
|    | Empty block statement.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 397| 397| 				// Players see colors depending on diplomacy
| 398| 398| 				g_DisplayedPlayerColors[i] =
| 399| 399| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 400|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
|    | 400|+						g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 401| 401| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 402| 402| 					getDiplomacyColor("enemy");
| 403| 403| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 398| 398| 				g_DisplayedPlayerColors[i] =
| 399| 399| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 400| 400| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 401|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
|    | 401|+							g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 402| 402| 					getDiplomacyColor("enemy");
| 403| 403| 
| 404| 404| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 399| 399| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 400| 400| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 401| 401| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 402|    |-					getDiplomacyColor("enemy");
|    | 402|+								getDiplomacyColor("enemy");
| 403| 403| 
| 404| 404| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 405| 405| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
| 655| 655| 					"civ": setStringTags(g_CivData[g_Players[g_ViewedPlayer].civ].Name, { "font": "sans-bold-stroke-14" }),
| 656| 656| 					"hotkey_civinfo": colorizeHotkey("%(hotkey)s", "civinfo"),
| 657| 657| 					"hotkey_structree": colorizeHotkey("%(hotkey)s", "structree")
| 658|    |-			});
|    | 658|+				});
| 659| 659| 	}
| 660| 660| 
| 661| 661| 	// Following gaia can be interesting on scripted maps
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1239|1239| 
|1240|1240| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1241|1241| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1242|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1242|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1243|1243| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1244|1244| 	});
|1245|1245| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1240|1240| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1241|1241| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1242|1242| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1243|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1243|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1244|1244| 	});
|1245|1245| 
|1246|1246| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1241|1241| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1242|1242| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1243|1243| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1244|    |-	});
|    |1244|+		});
|1245|1245| 
|1246|1246| 	let resCodes = g_ResourceData.GetCodes();
|1247|1247| 	for (let r = 0; r < resCodes.length; ++r)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/session.js
|1732|1732| 	for (let rct of resourcesCounterTypes)
|1733|1733| 		for (let rt of resourcesTypes)
|1734|1734| 			reportObject[rt + rct.substr(9)] = playerStatistics[rct][rt];
|1735|    |-			// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|    |1735|+	// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|1736|1736| 
|1737|1737| 	reportObject.vegetarianFoodGathered = playerStatistics.resourcesGathered.vegetarianFood;
|1738|1738| 	for (let type of unitsClasses)

binaries/data/mods/public/gui/session/session.js
|1067| »   let·getPanelEntNameTooltip·=·panelEntState·=>·"[font=\"sans-bold-16\"]"·+·template.name.specific·+·"[/font]";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEntState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1142| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1143| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1144| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

Link to build: https://jenkins.wildfiregames.com/job/differential/873/

Stan accepted this revision.Jan 2 2019, 9:56 PM
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Jan 6 2019, 3:33 PM