From 18c1464dc258ea772d22349b80a719b1a7fcc435 Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Sat, 30 Nov 2024 03:44:46 +0100 Subject: [PATCH 01/12] Remove all other game state updates other than `Launching` --- lua/ui/lobby/autolobby/AutolobbyController.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lua/ui/lobby/autolobby/AutolobbyController.lua b/lua/ui/lobby/autolobby/AutolobbyController.lua index 94d3bf59e0..364fc8df4a 100644 --- a/lua/ui/lobby/autolobby/AutolobbyController.lua +++ b/lua/ui/lobby/autolobby/AutolobbyController.lua @@ -746,7 +746,6 @@ AutolobbyCommunications = Class(MohoLobbyMethods, AutolobbyServerCommunicationsC self:DebugSpew("LaunchGame") self:DebugSpew(reprs(gameConfig, { depth = 10 })) - self:SendGameStateToServer('Launching') return MohoLobbyMethods.LaunchGame(self, gameConfig) end, @@ -820,7 +819,6 @@ AutolobbyCommunications = Class(MohoLobbyMethods, AutolobbyServerCommunicationsC -- start prefetching the scenario self:Prefetch(self.GameOptions, self.GameMods) - self:SendGameStateToServer('Lobby') self:SendLaunchStatusToServer('Hosting') -- update UI for game options @@ -855,8 +853,6 @@ AutolobbyCommunications = Class(MohoLobbyMethods, AutolobbyServerCommunicationsC self.LocalPeerId = localPeerId self.HostID = hostPeerId - self:SendGameStateToServer('Lobby') - -- occasionally send data over the network to create pings on screen self.Trash:Add(ForkThread(self.ShareLaunchStatusThread, self)) -- self.Trash:Add(ForkThread(self.CheckForRejoinThread, self)) -- disabled, for now From dcf1a3895d8677b52c4b84d0e6b6b810e251512e Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Sat, 30 Nov 2024 03:49:27 +0100 Subject: [PATCH 02/12] Remove the idle game state message --- lua/ui/lobby/autolobby.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/lua/ui/lobby/autolobby.lua b/lua/ui/lobby/autolobby.lua index 19ef125605..220dfb8029 100644 --- a/lua/ui/lobby/autolobby.lua +++ b/lua/ui/lobby/autolobby.lua @@ -64,8 +64,6 @@ function CreateLobby(protocol, localPort, desiredPlayerName, localPlayerUID, nat AutolobbyCommunicationsInstance.LobbyParameters.LocalPlayerPeerId = localPlayerUID AutolobbyCommunicationsInstance.LobbyParameters.NatTraversalProvider = natTraversalProvider - AutolobbyCommunicationsInstance:SendGameStateToServer('Idle') - return AutolobbyCommunicationsInstance end From 854cf24e100a72a197d0e1ea9da53cdaaf7a311b Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Sat, 30 Nov 2024 03:49:45 +0100 Subject: [PATCH 03/12] Add a sanity safe guard to sending the game state --- .../components/AutolobbyServerCommunicationsComponent.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua b/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua index c3fb273ac1..f62bc6b0f3 100644 --- a/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua +++ b/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua @@ -107,6 +107,11 @@ AutolobbyServerCommunicationsComponent = ClassSimple { ---@param self UIAutolobbyServerCommunicationsComponent | UIAutolobbyCommunications ---@param value UILobbyState SendGameStateToServer = function(self, value) + -- any other value seriously messes with the lobby protocol on the server + if value ~= 'Launching' then + return + end + GpgNetSend('GameState', value) end, @@ -124,7 +129,7 @@ AutolobbyServerCommunicationsComponent = ClassSimple { GpgNetSend('EstablishedPeer', peerId) end, - --- Sends a message to the server that we disconnected from a peer. Note that a peer may be trying to rejoin. See also the launch status of the given peer. + --- Sends a message to the server that we disconnected from a peer. Note that a peer may be trying to rejoin. See also the launch status of the given peer. ---@param self UIAutolobbyServerCommunicationsComponent | UIAutolobbyCommunications ---@param peerId UILobbyPeerId SendDisconnectedPeer = function(self, peerId) From 4debd629b23ec7511baad136ecd7991dcf6c1fdc Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Sat, 30 Nov 2024 04:10:53 +0100 Subject: [PATCH 04/12] Document the procedure to test with an actual server --- ...AutolobbyServerCommunicationsComponent.lua | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua b/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua index f62bc6b0f3..067c031263 100644 --- a/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua +++ b/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua @@ -22,7 +22,7 @@ ------------------------------------------------------------------------------- --#region Game <-> Server communications - +-- -- All the following logic is tightly coupled with functionality on either the -- lobby server, the ice adapter, the java server and/or the client. For more -- context you can search for the various keywords in the following repositories: @@ -32,6 +32,36 @@ -- -- Specifically, the following file processes these messages on the server: -- - https://github.com/FAForever/server/blob/98271c421412467fa387f3a6530fe8d24e360fa4/server/gameconnection.py +-- +-- ## How to test game communications +-- +-- You can not test the game <-> server communications using the launch script to +-- launch local instances of the game. This requires a bit of effort. +-- +-- Prerequisites: +-- - A Lua development environment +-- - Two separate instances of the FAF client +-- +-- Procedure: +-- - Start the FAF client and then logout to view the login screen. +-- - Choose the test server. +-- - Navigate to the leaderboards. +-- - Navigate to the last page of the leaderboards. +-- - Both clients should pick a player with almost no games. +-- - Back in the FAF client login screen, click on 'login'. +-- - - Sanity check: it should state somewhere on screen that you are logging into the test server. +-- - Use the nickname of the player as login. Use `foo` as the password. Not all accounts that exist +-- in production also exist in the test server, so you'll have to try a few to find one that works. +-- +-- Once logged in: +-- - Via the hamburger menu (top left) go to Settings -> Forged Alliance Forever +-- - Update the command line format to `"%s" /init init_dev.lua`, it auto saves +-- - Start searching +-- +-- The procedure applies to both clients. By updating the command line format you override the +-- game files that the client is loading. Using this approach you can launch the game from +-- any pull request. Just make sure that both clients use the same pull request and have gone +-- through the same procedure. -- upvalue scope for performance local GpgNetSend = GpgNetSend From 75632707699455ba84f0cbbfd13c72d36e035333 Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Sat, 30 Nov 2024 04:12:43 +0100 Subject: [PATCH 05/12] Add a comment to nog log the natTraversalProvider argument --- lua/ui/lobby/autolobby.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/ui/lobby/autolobby.lua b/lua/ui/lobby/autolobby.lua index 220dfb8029..e103138d1d 100644 --- a/lua/ui/lobby/autolobby.lua +++ b/lua/ui/lobby/autolobby.lua @@ -42,6 +42,7 @@ local AutolobbyCommunicationsInstance = false ---@param natTraversalProvider any ---@return UIAutolobbyCommunications function CreateLobby(protocol, localPort, desiredPlayerName, localPlayerUID, natTraversalProvider) + -- we intentionally do not log the 'natTraversalProvider' parameter as it can cause issues LOG("CreateLobby", protocol, localPort, desiredPlayerName, localPlayerUID) -- create the interface, needs to be done before the lobby is From c9121117c359f2affc30d3a5015d6cfcd292946a Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Sat, 30 Nov 2024 04:12:54 +0100 Subject: [PATCH 06/12] Bump the game version --- lua/version.lua | 6 +++--- mod_info.lua | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/version.lua b/lua/version.lua index 3299c7914d..3631c223aa 100644 --- a/lua/version.lua +++ b/lua/version.lua @@ -34,9 +34,9 @@ local Commit = 'unknown' -- The use of `'` instead of `"` is **intentional** --#endregion -local Version = "3814" ----@alias PATCH "3814" ----@alias VERSION "1.5.3814" +local Version = "3815" +---@alias PATCH "3815" +---@alias VERSION "1.5.3815" ---@return PATCH # Game release function GetVersion() LOG(string.format('Supreme Commander: Forged Alliance Lua version %s at %s (%s)', Version, GameType, Commit)) diff --git a/mod_info.lua b/mod_info.lua index d1eb0427bd..b0f3331b2b 100644 --- a/mod_info.lua +++ b/mod_info.lua @@ -27,7 +27,7 @@ -- - https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/MODS.LUA name = "Forged Alliance Forever" -version = 3814 -- needs to be an integer as it is parsed as a short (16 bit integer) +version = 3815 -- needs to be an integer as it is parsed as a short (16 bit integer) _faf_modname='faf' copyright = "Forged Alliance Forever Community" description = "Forged Alliance Forever extends Forged Alliance, bringing new patches, game modes, units, ladder, and much more!" From b74caf8fc4e198efee6a16fb185b8a983e23475e Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Sat, 30 Nov 2024 04:17:48 +0100 Subject: [PATCH 07/12] Add a changelog file for the documentation website --- docs/_posts/2024-11-29-3815.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 docs/_posts/2024-11-29-3815.md diff --git a/docs/_posts/2024-11-29-3815.md b/docs/_posts/2024-11-29-3815.md new file mode 100644 index 0000000000..070e6a66cd --- /dev/null +++ b/docs/_posts/2024-11-29-3815.md @@ -0,0 +1,17 @@ +--- +layout: post +title: Game version 3815 +permalink: changelog/3815 +--- + +# Game version 3815 (29th of November, 2024) + +Fix the autolobby messing with the expected server state. We hope the autolobby functions as expected now. + +With thanks to Nomander for investigating the issue and deciphering a procedure to test the autolobby changes on the test server. Previously the changes were only tested locally by running multiple game instances on the same computer. When testing locally there is no server, and therefore we did not detect this issue sooner. + +Apologies for the inconveniences, + +With kind regards, + +Jip From 71794b0b8e1a82b96566ed1083bfb7c14f9b60d4 Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Sat, 30 Nov 2024 04:19:10 +0100 Subject: [PATCH 08/12] Add in-game changelog --- lua/ui/lobby/changelogData.lua | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lua/ui/lobby/changelogData.lua b/lua/ui/lobby/changelogData.lua index 7ec35e243b..d0357f7af4 100644 --- a/lua/ui/lobby/changelogData.lua +++ b/lua/ui/lobby/changelogData.lua @@ -1,8 +1,29 @@ ---@type number -last_version = 3814 +last_version = 3815 ---@type PatchNotes[] gamePatches = { + { + version = 3815, + name = "Hotfix", + hasPrettyGithubRelease = true, + hasPrettyPatchnotes = false, + description = { + "# Game version 3815 (29th of November, 2024)", + "", + "Fix the autolobby messing with the expected server state. We hope the autolobby functions as expected now.", + "", + "With thanks to Nomander for investigating the issue and deciphering a procedure to test the autolobby changes on ", + "the test server. Previously the changes were only tested locally by running multiple game instances on the same ", + "computer. When testing locally there is no server, and therefore we did not detect this issue sooner.", + "", + "Apologies for the inconveniences,", + "", + "With kind regards,", + "", + "Jip", + }, + }, { version = 3814, name = "Hotfix", From 28ea7bc46e4dead70524050945dbf7b12674203d Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Sat, 30 Nov 2024 04:23:51 +0100 Subject: [PATCH 09/12] Update lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com> --- .../components/AutolobbyServerCommunicationsComponent.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua b/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua index 067c031263..d59f530427 100644 --- a/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua +++ b/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua @@ -51,7 +51,7 @@ -- - Back in the FAF client login screen, click on 'login'. -- - - Sanity check: it should state somewhere on screen that you are logging into the test server. -- - Use the nickname of the player as login. Use `foo` as the password. Not all accounts that exist --- in production also exist in the test server, so you'll have to try a few to find one that works. +-- in production also exist in the test server, so you may have to try a few to find one that works. -- -- Once logged in: -- - Via the hamburger menu (top left) go to Settings -> Forged Alliance Forever From c29de8b44c497214b0433f6887ecb2e77e94c21e Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Sat, 30 Nov 2024 04:23:56 +0100 Subject: [PATCH 10/12] Update lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com> --- .../components/AutolobbyServerCommunicationsComponent.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua b/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua index d59f530427..51c58c3089 100644 --- a/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua +++ b/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua @@ -35,7 +35,7 @@ -- -- ## How to test game communications -- --- You can not test the game <-> server communications using the launch script to +-- You cannot test the game <-> server communications using the launch script to -- launch local instances of the game. This requires a bit of effort. -- -- Prerequisites: From 7cacc55f8f94bc6fd049733858703d29a5fd2b14 Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Sat, 30 Nov 2024 04:24:19 +0100 Subject: [PATCH 11/12] Update lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com> --- .../components/AutolobbyServerCommunicationsComponent.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua b/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua index 51c58c3089..95e3b62beb 100644 --- a/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua +++ b/lua/ui/lobby/autolobby/components/AutolobbyServerCommunicationsComponent.lua @@ -55,7 +55,7 @@ -- -- Once logged in: -- - Via the hamburger menu (top left) go to Settings -> Forged Alliance Forever --- - Update the command line format to `"%s" /init init_dev.lua`, it auto saves +-- - Update the command line format to `"%s" /init init_local_development.lua`, it auto saves -- - Start searching -- -- The procedure applies to both clients. By updating the command line format you override the From 67bceb6acd92e332577f0b6dff63f246a47285a1 Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Sat, 30 Nov 2024 04:24:53 +0100 Subject: [PATCH 12/12] Update lua/ui/lobby/autolobby.lua Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com> --- lua/ui/lobby/autolobby.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/ui/lobby/autolobby.lua b/lua/ui/lobby/autolobby.lua index e103138d1d..76b1e4239f 100644 --- a/lua/ui/lobby/autolobby.lua +++ b/lua/ui/lobby/autolobby.lua @@ -42,7 +42,7 @@ local AutolobbyCommunicationsInstance = false ---@param natTraversalProvider any ---@return UIAutolobbyCommunications function CreateLobby(protocol, localPort, desiredPlayerName, localPlayerUID, natTraversalProvider) - -- we intentionally do not log the 'natTraversalProvider' parameter as it can cause issues + -- we intentionally do not log the 'natTraversalProvider' parameter as it can cause issues due to being an uninitialized C object LOG("CreateLobby", protocol, localPort, desiredPlayerName, localPlayerUID) -- create the interface, needs to be done before the lobby is