Page MenuHomeWildfire Games

Actually dont compile lobby code if building --without-lobby
Needs ReviewPublic

Authored by elexis on Sep 11 2019, 5:58 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

The --without-lobby flag from rP14098 and rP14113 doesn't exclude all lobby code that it could.

But the expected behavior is that if the flag is passed, that there will be hard compile errors if some author referred lobby code but lobby was not meant to be built.

The patch arose from D2271 which adds glooxwrapper ToJSVal conversions in lobby/scripting/ and thus must either add the macro or drop the folder, and the latter seems more like what was ordered.

Test Plan

Compile --without-lobby. Consider that glooxwrapper can be built standalone using build-shared-glooxwrapper and thus sounds like it shouldn't have the config2 guard.
Notice that one can insert invalid cpp code to the glooxwrapper files if building --without-lobby so as to confirm that this file will be excluded in that case.
Notice that excluding the #include files also means that the source files can be distributed with the source/lobby/ folder being erased, so there is advantage to having that excluded.

Compile with and without precompiled headers.

Event Timeline

elexis created this revision.Sep 11 2019, 5:58 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/134/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/643/display/redirect

elexis added inline comments.Sep 11 2019, 6:11 PM
source/network/NetClient.cpp
528

This looks like it's not right, I suppose there should be disconnect handling, not only a message, but I will exclude it from this patch.

elexis updated this revision to Diff 9716.Sep 11 2019, 6:23 PM

Drop StunClient thing change.

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/135/display/redirect

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

Linter detected issues:
Executing section Source...

source/lobby/XmppClient.h
|  26| 
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceStunClient{' is invalid C code. Use --std or --language to configure the language.

source/lobby/StanzaExtensions.h
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/lobby/StanzaExtensions.h
|  90| »   }
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceglooxwrapper{' is invalid C code. Use --std or --language to configure the language.

source/lobby/scripting/JSInterface_Lobby.h
|  29| namespace·JSI_Lobby
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceJSI_Lobby{' is invalid C code. Use --std or --language to configure the language.

source/lobby/StanzaExtensions.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/lobby/glooxwrapper/glooxwrapper.h
|  90| namespace·glooxwrapper
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceglooxwrapper{' is invalid C code. Use --std or --language to configure the language.

source/lobby/IXmppClient.h
|  26| namespace·StunClient·{
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceStunClient{' is invalid C code. Use --std or --language to configure the language.

source/main.cpp
|   0| }
|    | [NORMAL] CPPCheckBear (toomanyconfigs):
|    | Too many #ifdef configurations - cppcheck only checks 12 configurations. Use --force to check all configurations. For more details, use --enable=information.
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/644/display/redirect

elexis edited the test plan for this revision. (Show Details)Sep 11 2019, 6:49 PM
elexis edited the summary of this revision. (Show Details)Sep 11 2019, 6:55 PM
elexis updated this revision to Diff 9717.Sep 11 2019, 7:09 PM

Fix build without pch.

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/136/display/redirect

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

Linter detected issues:
Executing section Source...

source/lobby/IXmppClient.h
|  26| namespace·StunClient·{
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceStunClient{' is invalid C code. Use --std or --language to configure the language.

source/lobby/StanzaExtensions.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/lobby/scripting/JSInterface_Lobby.h
|  29| namespace·JSI_Lobby
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceJSI_Lobby{' is invalid C code. Use --std or --language to configure the language.

source/main.cpp
|   0| }
|    | [NORMAL] CPPCheckBear (toomanyconfigs):
|    | Too many #ifdef configurations - cppcheck only checks 12 configurations. Use --force to check all configurations. For more details, use --enable=information.

source/lobby/glooxwrapper/glooxwrapper.h
|  90| namespace·glooxwrapper
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceglooxwrapper{' is invalid C code. Use --std or --language to configure the language.

source/lobby/XmppClient.h
|  26| #include·<deque>
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceStunClient{' is invalid C code. Use --std or --language to configure the language.

source/lobby/StanzaExtensions.h
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/lobby/StanzaExtensions.h
|  90| »   }
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceglooxwrapper{' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/645/display/redirect

elexis updated this revision to Diff 9718.Sep 11 2019, 7:52 PM

Have precompiled.h prior to #if CONFIG2_LOBBY as proposed by Angen on #0ad-dev.

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/137/display/redirect

Silier added a subscriber: Silier.Sep 11 2019, 7:58 PM
Silier added inline comments.
source/lobby/scripting/JSInterface_Lobby.cpp
18

missed

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

Linter detected issues:
Executing section Source...

source/lobby/XmppClient.h
|  26| #include·<deque>
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceStunClient{' is invalid C code. Use --std or --language to configure the language.

source/lobby/scripting/JSInterface_Lobby.h
|  29| namespace·JSI_Lobby
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceJSI_Lobby{' is invalid C code. Use --std or --language to configure the language.

source/lobby/StanzaExtensions.h
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/lobby/StanzaExtensions.h
|  90| »   }
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceglooxwrapper{' is invalid C code. Use --std or --language to configure the language.

source/lobby/StanzaExtensions.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/main.cpp
|   0| }
|    | [NORMAL] CPPCheckBear (toomanyconfigs):
|    | Too many #ifdef configurations - cppcheck only checks 12 configurations. Use --force to check all configurations. For more details, use --enable=information.

source/lobby/glooxwrapper/glooxwrapper.h
|  90| namespace·glooxwrapper
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceglooxwrapper{' is invalid C code. Use --std or --language to configure the language.

source/lobby/IXmppClient.h
|  26| namespace·StunClient·{
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceStunClient{' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/646/display/redirect

elexis edited the summary of this revision. (Show Details)Sep 11 2019, 11:22 PM
elexis added a comment.EditedSep 11 2019, 11:30 PM

flag is fraud, because most of the lobby code (especially XmppClient and half of the JSInterface) are still compiled, the flag only unsubscribes few JSinterface functions.

So that is false in fact.
The XmppClient.cpp has not been compiled if --without-lobby was passed, because the source directories for the lobby project if --without-lobby was enabled excluded the lobby/ folder but included the lobby/scripting/ folder.
It still seems correct to exclude all lobby code (including IXmppClient.cpp), since that is what the two words --without-lobby mean, what the user may reasonably expect.

(The interface IXmppClient is useful regardless, because it allows implementing the lobby with a different library than gloox for example.)

(There won't be an IXmppClient object, but the references are still valid, when they could throw compile errors, example is the StunClient use)

A backup of the patch where the macro is present in every source/lobby/ file, which ought to be unneeded since premake excludes the folder due to the diff

.

The main problem with removing source/lobby/scripting/ entirely is that there is one JS function HasXmppClient that is used in 34 places.
The choices are:

  1. Register JSInterface function HasXmppClient even on --without-lobby.
  2. Add a global helper HasXmppClient and use that in those 34 places..
  3. Change every Engine.HasXmppClient() to Engine.HasXmppClient && Engine.HasXmppClient() in 34 places.
  1. is contrary to the objective of dropping lobby C++ code. It would yield ugly C++ code (registering a stray function in ScriptFunctions.cpp? that would start compromising the rework that had carefully split it into multiple files.)
  2. is contrary to the idea of removign all functions from gui/common/. That idea arises from the fact that all of the functions are unrelated (i.e. logical fragmentation), and secondly many of the GUI JS global functions are used only by 2 or 3 GUI pages, not by 10 of them (so not really global only a bit more local that local to one page..) With #5387 I hoped to make that a bit more clean. There were already some commits in the past years to that folder that removed functions from there.

Another issue with that global helper function is that it hides the fact that every JS code didnt consider the fact that C++ code can be dropped, and that the JS GUI should account for that - rather than only checking whether we're currently connected via Xmpp!

  1. Doesn't have the two conceptual problems above. It makes it so that every JS code has to check whteher lobby support is compiled in and then test for behaving appropriately. The disadvantage is touching 34 conditions and making code a bit longer. In most cases being disconnected is treated equally to not having C++ lobby support. However in principle the code should always first consider whether there is support and then start deciding later what it wants to do if there is support. Example: The option g_Checkboxes.rating in gamesetup.js can be removed entirely if there is no such support, rather than adding the option but hiding it.

So there are three choices that are all ugly, but the last one is the one that seems ugly and correct.

elexis edited the summary of this revision. (Show Details)Sep 12 2019, 11:12 AM
elexis retitled this revision from Actually dont compile lobby classes if building --without-lobby to Actually dont compile lobby code if building --without-lobby.Sep 12 2019, 11:17 AM
elexis updated this revision to Diff 9722.Sep 12 2019, 11:38 AM

Remove any config2 from source/lobby/ since premake should exclude it already.
Update JS functions to account for the removed HasXmppClient function.

Can't actually test because compiling takes hours :-(

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

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/140/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Linter detected issues:
Executing section Source...

source/lobby/scripting/JSInterface_Lobby.h
|  25| namespace·JSI_Lobby
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'namespaceJSI_Lobby{' is invalid C code. Use --std or --language to configure the language.

source/main.cpp
|   0| }
|    | [NORMAL] CPPCheckBear (toomanyconfigs):
|    | Too many #ifdef configurations - cppcheck only checks 12 configurations. Use --force to check all configurations. For more details, use --enable=information.
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js
| 210| 210| 				error("Unrecognised net message type: " + message.type);
| 211| 211| 			}
| 212| 212| 		else
| 213|    |-			// Not rejoining - just trying to connect to server
|    | 213|+		// Not rejoining - just trying to connect to server
| 214| 214| 
| 215| 215| 			switch (message.type)
| 216| 216| 			{

binaries/data/mods/public/gui/session/menu.js
| 469| »   »   button.onPress·=·(function(player,·stance)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'stance' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 501| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 501| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'resCode' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 501| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'button' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 544| »   button.onPress·=·(function(i)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 610| »   button.onPress·=·(function(i,·button)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 610| »   button.onPress·=·(function(i,·button)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'button' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  62|  62| var g_RomanNumbers = [undefined, "I", "II", "III", "IV", "V", "VI", "VII", "VIII"];
|  63|  63| 
|  64|  64| var g_PlayerTeamList = prepareForDropdown([{
|  65|    |-		"label": translateWithContext("team", "None"),
|    |  65|+	"label": translateWithContext("team", "None"),
|  66|  66| 		"id": -1
|  67|  67| 	}].concat(
|  68|  68| 		Array(g_MaxTeams).fill(0).map((v, i) => ({
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  63|  63| 
|  64|  64| var g_PlayerTeamList = prepareForDropdown([{
|  65|  65| 		"label": translateWithContext("team", "None"),
|  66|    |-		"id": -1
|    |  66|+	"id": -1
|  67|  67| 	}].concat(
|  68|  68| 		Array(g_MaxTeams).fill(0).map((v, i) => ({
|  69|  69| 			"label": i + 1,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 0 tabs but found 1.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  64|  64| var g_PlayerTeamList = prepareForDropdown([{
|  65|  65| 		"label": translateWithContext("team", "None"),
|  66|  66| 		"id": -1
|  67|    |-	}].concat(
|    |  67|+}].concat(
|  68|  68| 		Array(g_MaxTeams).fill(0).map((v, i) => ({
|  69|  69| 			"label": i + 1,
|  70|  70| 			"id": i
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  65|  65| 		"label": translateWithContext("team", "None"),
|  66|  66| 		"id": -1
|  67|  67| 	}].concat(
|  68|    |-		Array(g_MaxTeams).fill(0).map((v, i) => ({
|    |  68|+	Array(g_MaxTeams).fill(0).map((v, i) => ({
|  69|  69| 			"label": i + 1,
|  70|  70| 			"id": i
|  71|  71| 		}))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  66|  66| 		"id": -1
|  67|  67| 	}].concat(
|  68|  68| 		Array(g_MaxTeams).fill(0).map((v, i) => ({
|  69|    |-			"label": i + 1,
|    |  69|+		"label": i + 1,
|  70|  70| 			"id": i
|  71|  71| 		}))
|  72|  72| 	)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  67|  67| 	}].concat(
|  68|  68| 		Array(g_MaxTeams).fill(0).map((v, i) => ({
|  69|  69| 			"label": i + 1,
|  70|    |-			"id": i
|    |  70|+		"id": i
|  71|  71| 		}))
|  72|  72| 	)
|  73|  73| );
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  68|  68| 		Array(g_MaxTeams).fill(0).map((v, i) => ({
|  69|  69| 			"label": i + 1,
|  70|  70| 			"id": i
|  71|    |-		}))
|    |  71|+	}))
|  72|  72| 	)
|  73|  73| );
|  74|  74| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 0 tabs but found 1.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  69|  69| 			"label": i + 1,
|  70|  70| 			"id": i
|  71|  71| 		}))
|  72|    |-	)
|    |  72|+)
|  73|  73| );
|  74|  74| 
|  75|  75| /**
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  78|  78| var g_RelicCountList = Object.keys(g_CivData).map((civ, i) => i + 1);
|  79|  79| 
|  80|  80| var g_PlayerCivList = g_CivData && prepareForDropdown([{
|  81|    |-		"name": translateWithContext("civilization", "Random"),
|    |  81|+	"name": translateWithContext("civilization", "Random"),
|  82|  82| 		"tooltip": translate("Picks one civilization at random when the game starts."),
|  83|  83| 		"color": g_ColorRandom,
|  84|  84| 		"code": "random"
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  79|  79| 
|  80|  80| var g_PlayerCivList = g_CivData && prepareForDropdown([{
|  81|  81| 		"name": translateWithContext("civilization", "Random"),
|  82|    |-		"tooltip": translate("Picks one civilization at random when the game starts."),
|    |  82|+	"tooltip": translate("Picks one civilization at random when the game starts."),
|  83|  83| 		"color": g_ColorRandom,
|  84|  84| 		"code": "random"
|  85|  85| 	}].concat(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  80|  80| var g_PlayerCivList = g_CivData && prepareForDropdown([{
|  81|  81| 		"name": translateWithContext("civilization", "Random"),
|  82|  82| 		"tooltip": translate("Picks one civilization at random when the game starts."),
|  83|    |-		"color": g_ColorRandom,
|    |  83|+	"color": g_ColorRandom,
|  84|  84| 		"code": "random"
|  85|  85| 	}].concat(
|  86|  86| 		Object.keys(g_CivData).filter(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  81|  81| 		"name": translateWithContext("civilization", "Random"),
|  82|  82| 		"tooltip": translate("Picks one civilization at random when the game starts."),
|  83|  83| 		"color": g_ColorRandom,
|  84|    |-		"code": "random"
|    |  84|+	"code": "random"
|  85|  85| 	}].concat(
|  86|  86| 		Object.keys(g_CivData).filter(
|  87|  87| 			civ => g_CivData[civ].SelectableInGameSetup
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 0 tabs but found 1.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  82|  82| 		"tooltip": translate("Picks one civilization at random when the game starts."),
|  83|  83| 		"color": g_ColorRandom,
|  84|  84| 		"code": "random"
|  85|    |-	}].concat(
|    |  85|+}].concat(
|  86|  86| 		Object.keys(g_CivData).filter(
|  87|  87| 			civ => g_CivData[civ].SelectableInGameSetup
|  88|  88| 		).map(civ => ({
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  83|  83| 		"color": g_ColorRandom,
|  84|  84| 		"code": "random"
|  85|  85| 	}].concat(
|  86|    |-		Object.keys(g_CivData).filter(
|    |  86|+	Object.keys(g_CivData).filter(
|  87|  87| 			civ => g_CivData[civ].SelectableInGameSetup
|  88|  88| 		).map(civ => ({
|  89|  89| 			"name": g_CivData[civ].Name,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  84|  84| 		"code": "random"
|  85|  85| 	}].concat(
|  86|  86| 		Object.keys(g_CivData).filter(
|  87|    |-			civ => g_CivData[civ].SelectableInGameSetup
|    |  87|+		civ => g_CivData[civ].SelectableInGameSetup
|  88|  88| 		).map(civ => ({
|  89|  89| 			"name": g_CivData[civ].Name,
|  90|  90| 			"tooltip": g_CivData[civ].History,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  85|  85| 	}].concat(
|  86|  86| 		Object.keys(g_CivData).filter(
|  87|  87| 			civ => g_CivData[civ].SelectableInGameSetup
|  88|    |-		).map(civ => ({
|    |  88|+	).map(civ => ({
|  89|  89| 			"name": g_CivData[civ].Name,
|  90|  90| 			"tooltip": g_CivData[civ].History,
|  91|  91| 			"color": g_ColorRegular,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  86|  86| 		Object.keys(g_CivData).filter(
|  87|  87| 			civ => g_CivData[civ].SelectableInGameSetup
|  88|  88| 		).map(civ => ({
|  89|    |-			"name": g_CivData[civ].Name,
|    |  89|+		"name": g_CivData[civ].Name,
|  90|  90| 			"tooltip": g_CivData[civ].History,
|  91|  91| 			"color": g_ColorRegular,
|  92|  92| 			"code": civ
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  87|  87| 			civ => g_CivData[civ].SelectableInGameSetup
|  88|  88| 		).map(civ => ({
|  89|  89| 			"name": g_CivData[civ].Name,
|  90|    |-			"tooltip": g_CivData[civ].History,
|    |  90|+		"tooltip": g_CivData[civ].History,
|  91|  91| 			"color": g_ColorRegular,
|  92|  92| 			"code": civ
|  93|  93| 		})).sort(sortNameIgnoreCase)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  88|  88| 		).map(civ => ({
|  89|  89| 			"name": g_CivData[civ].Name,
|  90|  90| 			"tooltip": g_CivData[civ].History,
|  91|    |-			"color": g_ColorRegular,
|    |  91|+		"color": g_ColorRegular,
|  92|  92| 			"code": civ
|  93|  93| 		})).sort(sortNameIgnoreCase)
|  94|  94| 	)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  89|  89| 			"name": g_CivData[civ].Name,
|  90|  90| 			"tooltip": g_CivData[civ].History,
|  91|  91| 			"color": g_ColorRegular,
|  92|    |-			"code": civ
|    |  92|+		"code": civ
|  93|  93| 		})).sort(sortNameIgnoreCase)
|  94|  94| 	)
|  95|  95| );
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  90|  90| 			"tooltip": g_CivData[civ].History,
|  91|  91| 			"color": g_ColorRegular,
|  92|  92| 			"code": civ
|  93|    |-		})).sort(sortNameIgnoreCase)
|    |  93|+	})).sort(sortNameIgnoreCase)
|  94|  94| 	)
|  95|  95| );
|  96|  96| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 0 tabs but found 1.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|  91|  91| 			"color": g_ColorRegular,
|  92|  92| 			"code": civ
|  93|  93| 		})).sort(sortNameIgnoreCase)
|  94|    |-	)
|    |  94|+)
|  95|  95| );
|  96|  96| 
|  97|  97| /**
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1330|1330| 			offset = -Math.min(slideSpeed * dt, maxOffset);
|1331|1331| 	}
|1332|1332| 
|1333|    |-	updateSettingsPanelPosition(offset);	
|    |1333|+	updateSettingsPanelPosition(offset);
|1334|1334| }
|1335|1335| 
|1336|1336| /**
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 489| 489| 	Engine.GetGUIObjectByName("summaryText").caption =
| 490| 490| 		g_GameData.gui.isInGame ?
| 491| 491| 			translate("Current Scores") :
| 492|    |-		g_GameData.gui.isReplay ?
|    | 492|+			g_GameData.gui.isReplay ?
| 493| 493| 			translate("Scores at the end of the game.") :
| 494| 494| 		g_GameData.gui.disconnected ?
| 495| 495| 			translate("You have been disconnected.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 490| 490| 		g_GameData.gui.isInGame ?
| 491| 491| 			translate("Current Scores") :
| 492| 492| 		g_GameData.gui.isReplay ?
| 493|    |-			translate("Scores at the end of the game.") :
|    | 493|+				translate("Scores at the end of the game.") :
| 494| 494| 		g_GameData.gui.disconnected ?
| 495| 495| 			translate("You have been disconnected.") :
| 496| 496| 		!assignedState ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 491| 491| 			translate("Current Scores") :
| 492| 492| 		g_GameData.gui.isReplay ?
| 493| 493| 			translate("Scores at the end of the game.") :
| 494|    |-		g_GameData.gui.disconnected ?
|    | 494|+				g_GameData.gui.disconnected ?
| 495| 495| 			translate("You have been disconnected.") :
| 496| 496| 		!assignedState ?
| 497| 497| 			translate("You have left the game.") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 492| 492| 		g_GameData.gui.isReplay ?
| 493| 493| 			translate("Scores at the end of the game.") :
| 494| 494| 		g_GameData.gui.disconnected ?
| 495|    |-			translate("You have been disconnected.") :
|    | 495|+					translate("You have been disconnected.") :
| 496| 496| 		!assignedState ?
| 497| 497| 			translate("You have left the game.") :
| 498| 498| 		assignedState.state == "won" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 493| 493| 			translate("Scores at the end of the game.") :
| 494| 494| 		g_GameData.gui.disconnected ?
| 495| 495| 			translate("You have been disconnected.") :
| 496|    |-		!assignedState ?
|    | 496|+					!assignedState ?
| 497| 497| 			translate("You have left the game.") :
| 498| 498| 		assignedState.state == "won" ?
| 499| 499| 			translate("You have won the battle!") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 494| 494| 		g_GameData.gui.disconnected ?
| 495| 495| 			translate("You have been disconnected.") :
| 496| 496| 		!assignedState ?
| 497|    |-			translate("You have left the game.") :
|    | 497|+						translate("You have left the game.") :
| 498| 498| 		assignedState.state == "won" ?
| 499| 499| 			translate("You have won the battle!") :
| 500| 500| 		assignedState.state == "defeated" ?
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 495| 495| 			translate("You have been disconnected.") :
| 496| 496| 		!assignedState ?
| 497| 497| 			translate("You have left the game.") :
| 498|    |-		assignedState.state == "won" ?
|    | 498|+						assignedState.state == "won" ?
| 499| 499| 			translate("You have won the battle!") :
| 500| 500| 		assignedState.state == "defeated" ?
| 501| 501| 			translate("You have been defeated…") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 496| 496| 		!assignedState ?
| 497| 497| 			translate("You have left the game.") :
| 498| 498| 		assignedState.state == "won" ?
| 499|    |-			translate("You have won the battle!") :
|    | 499|+							translate("You have won the battle!") :
| 500| 500| 		assignedState.state == "defeated" ?
| 501| 501| 			translate("You have been defeated…") :
| 502| 502| 			translate("You have abandoned the game.");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 497| 497| 			translate("You have left the game.") :
| 498| 498| 		assignedState.state == "won" ?
| 499| 499| 			translate("You have won the battle!") :
| 500|    |-		assignedState.state == "defeated" ?
|    | 500|+							assignedState.state == "defeated" ?
| 501| 501| 			translate("You have been defeated…") :
| 502| 502| 			translate("You have abandoned the game.");
| 503| 503| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 498| 498| 		assignedState.state == "won" ?
| 499| 499| 			translate("You have won the battle!") :
| 500| 500| 		assignedState.state == "defeated" ?
| 501|    |-			translate("You have been defeated…") :
|    | 501|+								translate("You have been defeated…") :
| 502| 502| 			translate("You have abandoned the game.");
| 503| 503| 
| 504| 504| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 499| 499| 			translate("You have won the battle!") :
| 500| 500| 		assignedState.state == "defeated" ?
| 501| 501| 			translate("You have been defeated…") :
| 502|    |-			translate("You have abandoned the game.");
|    | 502|+								translate("You have abandoned the game.");
| 503| 503| 
| 504| 504| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 505| 505| 		translate("Game time elapsed: %(time)s"), {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/summary/summary.js
| 504| 504| 	Engine.GetGUIObjectByName("timeElapsed").caption = sprintf(
| 505| 505| 		translate("Game time elapsed: %(time)s"), {
| 506| 506| 			"time": timeToString(g_GameData.sim.timeElapsed)
| 507|    |-	});
|    | 507|+		});
| 508| 508| 
| 509| 509| 	let mapType = g_Settings.MapTypes.find(type => type.Name == g_GameData.sim.mapSettings.mapType);
| 510| 510| 	let mapSize = g_Settings.MapSizes.find(size => size.Tiles == g_GameData.sim.mapSettings.Size || 0);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 392| 392| 				// Players see colors depending on diplomacy
| 393| 393| 				g_DisplayedPlayerColors[i] =
| 394| 394| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 395|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
|    | 395|+						g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 396| 396| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 397| 397| 					getDiplomacyColor("enemy");
| 398| 398| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 393| 393| 				g_DisplayedPlayerColors[i] =
| 394| 394| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 395| 395| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 396|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
|    | 396|+							g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 397| 397| 					getDiplomacyColor("enemy");
| 398| 398| 
| 399| 399| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 394| 394| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 395| 395| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 396| 396| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 397|    |-					getDiplomacyColor("enemy");
|    | 397|+								getDiplomacyColor("enemy");
| 398| 398| 
| 399| 399| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 400| 400| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 656| 656| 					"civ": setStringTags(g_CivData[g_Players[g_ViewedPlayer].civ].Name, { "font": "sans-bold-stroke-14" }),
| 657| 657| 					"hotkey_civinfo": colorizeHotkey("%(hotkey)s", "civinfo"),
| 658| 658| 					"hotkey_structree": colorizeHotkey("%(hotkey)s", "structree")
| 659|    |-			});
|    | 659|+				});
| 660| 660| 	}
| 661| 661| 
| 662| 662| 	// Following gaia can be interesting on scripted maps
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|1211|1211| 
|1212|1212| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1213|1213| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1214|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1214|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1215|1215| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1216|1216| 	});
|1217|1217| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|1212|1212| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1213|1213| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1214|1214| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1215|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1215|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1216|1216| 	});
|1217|1217| 
|1218|1218| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|1213|1213| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1214|1214| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1215|1215| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1216|    |-	});
|    |1216|+		});
|1217|1217| 
|1218|1218| 	let resCodes = g_ResourceData.GetCodes();
|1219|1219| 	for (let r = 0; r < resCodes.length; ++r)

binaries/data/mods/public/gui/session/session.js
|1072| »   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
|1147| »   »   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
|1148| »   »   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
|1149| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/650/display/redirect

Stan added a subscriber: Stan.Sep 30 2019, 5:13 PM

Could restart the build, was broken because of checkrefs.pl.

Stan added inline comments.Nov 20 2019, 4:06 PM
binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js
266 ↗(On Diff #9722)

C++ Could return that directly ?

source/network/NetClient.cpp
520

I guess that flag is in the lobby ?

source/network/scripting/JSInterface_Network.cpp
130

Why is that ? I can use a stun server without connecting to the lobby, ex stun.ekiga.net