Skip to content

Commit

Permalink
Read and interpret divisions from command arguments (FAForever#4263)
Browse files Browse the repository at this point in the history
  • Loading branch information
4z0t authored Jan 28, 2023
1 parent 5eb5cb5 commit b067d18
Show file tree
Hide file tree
Showing 53 changed files with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/ui/lobby/autolobby.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ local function MakeLocalPlayerInfo(name)
result.DEV = tonumber(GetCommandLineArg("/deviation", 1)[1]) or ""
result.MEAN = tonumber(GetCommandLineArg("/mean", 1)[1]) or ""
result.NG = tonumber(GetCommandLineArg("/numgames", 1)[1]) or ""
result.DIV = (GetCommandLineArg("/division", 1)[1]) or ""
result.SUBDIV = (GetCommandLineArg("/subdivision", 1)[1]) or ""
result.PL = math.floor(result.MEAN - 3 * result.DEV)
LOG('Local player info: ' .. repr(result))
return result
Expand Down Expand Up @@ -209,16 +211,19 @@ local function CheckForLaunch()
end

local allRatings = {}
local allDivisions = {}
for k,v in gameInfo.PlayerOptions do
if v.Human and v.PL then
allRatings[v.PlayerName] = v.PL
allDivisions[v.PlayerName]= v.DIV .. v.SUBDIV
-- Initialize peer launch statuses
peerLaunchStatuses[v.OwnerID] = false
end
end
-- We don't need to wait for a launch status from ourselves
peerLaunchStatuses[localPlayerID] = nil
gameInfo.GameOptions['Ratings'] = allRatings
gameInfo.GameOptions['Divisions'] = allDivisions

LOG("Host launching game.")
lobbyComm:BroadcastData({ Type = 'Launch', GameInfo = gameInfo })
Expand Down
Binary file added textures/divisions/bronzeI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/bronzeII.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/bronzeIII.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/bronzeIII_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/bronzeII_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/bronzeIV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/bronzeIV_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/bronzeI_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/bronzeV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/bronzeV_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/diamondI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/diamondII.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/diamondIII.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/diamondIII_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/diamondII_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/diamondIV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/diamondIV_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/diamondI_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/diamondV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/diamondV_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/goldI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/goldII.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/goldIII.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/goldIII_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/goldII_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added textures/divisions/goldIV.png
Binary file added textures/divisions/goldIV_medium.png
Binary file added textures/divisions/goldI_medium.png
Binary file added textures/divisions/goldV.png
Binary file added textures/divisions/goldV_medium.png
Binary file added textures/divisions/grandmaster.png
Binary file added textures/divisions/grandmaster_medium.png
Binary file added textures/divisions/masterI.png
Binary file added textures/divisions/masterII.png
Binary file added textures/divisions/masterIII.png
Binary file added textures/divisions/masterIII_medium.png
Binary file added textures/divisions/masterII_medium.png
Binary file added textures/divisions/masterIV.png
Binary file added textures/divisions/masterIV_medium.png
Binary file added textures/divisions/masterI_medium.png
Binary file added textures/divisions/masterV.png
Binary file added textures/divisions/masterV_medium.png
Binary file added textures/divisions/silverI.png
Binary file added textures/divisions/silverII.png
Binary file added textures/divisions/silverIII.png
Binary file added textures/divisions/silverIII_medium.png
Binary file added textures/divisions/silverII_medium.png
Binary file added textures/divisions/silverIV.png
Binary file added textures/divisions/silverIV_medium.png
Binary file added textures/divisions/silverI_medium.png
Binary file added textures/divisions/silverV.png
Binary file added textures/divisions/silverV_medium.png

0 comments on commit b067d18

Please sign in to comment.