Skip to content

Commit

Permalink
Add clan tag support in lobby code
Browse files Browse the repository at this point in the history
previous commit was clan tags for the launch script
  • Loading branch information
lL1l1 committed Dec 9, 2024
1 parent 89e8e7f commit b280465
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lua/ui/lobby/autolobby/AutolobbyController.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ local AutolobbyEngineStrings = {
---@field DIV string # Related to rating/divisions
---@field SUBDIV string # Related to rating/divisions
---@field PL number # Related to rating/divisions
---@field PlayerClan string

---@alias UIAutolobbyConnections boolean[][]
---@alias UIAutolobbyStatus UIPeerLaunchStatus[]
Expand Down Expand Up @@ -163,6 +164,7 @@ AutolobbyCommunications = Class(MohoLobbyMethods, AutolobbyServerCommunicationsC
info.DIV = self:GetCommandLineArgumentString("/division", "")
info.SUBDIV = self:GetCommandLineArgumentString("/subdivision", "")
info.PL = math.floor(info.MEAN - 3 * info.DEV)
info.PlayerClan = self:GetCommandLineArgumentString("/clan", "")

return info
end,
Expand Down Expand Up @@ -334,6 +336,21 @@ AutolobbyCommunications = Class(MohoLobbyMethods, AutolobbyServerCommunicationsC
return allDivisions
end,

---@param self UIAutolobbyCommunications
---@param playerOptions UIAutolobbyPlayer[]
---@return table<string, string>
CreateClanTagsTable = function(self, playerOptions)
local allClanTags = {}

for slot, options in pairs(playerOptions) do
if options.PlayerClan then
allClanTags[options.PlayerName] = options.PlayerClan
end
end

return allClanTags
end,

--- Verifies whether we can launch the game.
---@param self UIAutolobbyCommunications
---@param peerStatus UIAutolobbyStatus
Expand Down Expand Up @@ -532,6 +549,7 @@ AutolobbyCommunications = Class(MohoLobbyMethods, AutolobbyServerCommunicationsC
-- this way they are available in both the sim and the UI
self.GameOptions.Ratings = self:CreateRatingsTable(self.PlayerOptions)
self.GameOptions.Divisions = self:CreateDivisionsTable(self.PlayerOptions)
self.GameOptions.ClanTags = self:CreateClanTagsTable(self.PlayerOptions)

-- create game configuration
local gameConfiguration = {
Expand Down

0 comments on commit b280465

Please sign in to comment.