@@ -105,11 +105,11 @@ func (handler *V1Handler) postLobby(writer http.ResponseWriter, request *http.Re
105105 }
106106
107107 languageData , languageKey , languageInvalid := ParseLanguage (request .Form .Get ("language" ))
108- drawingTime , drawingTimeInvalid := ParseDrawingTime (request .Form .Get ("drawing_time" ))
109- rounds , roundsInvalid := ParseRounds (request .Form .Get ("rounds" ))
110- maxPlayers , maxPlayersInvalid := ParseMaxPlayers (request .Form .Get ("max_players" ))
108+ drawingTime , drawingTimeInvalid := ParseDrawingTime (handler . cfg , request .Form .Get ("drawing_time" ))
109+ rounds , roundsInvalid := ParseRounds (handler . cfg , request .Form .Get ("rounds" ))
110+ maxPlayers , maxPlayersInvalid := ParseMaxPlayers (handler . cfg , request .Form .Get ("max_players" ))
111111 customWordsPerTurn , customWordsPerTurnInvalid := ParseCustomWordsPerTurn (request .Form .Get ("custom_words_per_turn" ))
112- clientsPerIPLimit , clientsPerIPLimitInvalid := ParseClientsPerIPLimit (request .Form .Get ("clients_per_ip_limit" ))
112+ clientsPerIPLimit , clientsPerIPLimitInvalid := ParseClientsPerIPLimit (handler . cfg , request .Form .Get ("clients_per_ip_limit" ))
113113 publicLobby , publicLobbyInvalid := ParseBoolean ("public" , request .Form .Get ("public" ))
114114
115115 var lowercaser cases.Caser
@@ -174,7 +174,7 @@ func (handler *V1Handler) postLobby(writer http.ResponseWriter, request *http.Re
174174
175175 SetUsersessionCookie (writer , player )
176176
177- lobbyData := CreateLobbyData (lobby )
177+ lobbyData := CreateLobbyData (handler . cfg , lobby )
178178
179179 if started , _ , err := easyjson .MarshalToHTTPResponseWriter (lobbyData , writer ); err != nil {
180180 if ! started {
@@ -221,7 +221,7 @@ func (handler *V1Handler) postPlayer(writer http.ResponseWriter, request *http.R
221221 player .SetLastKnownAddress (GetIPAddressFromRequest (request ))
222222 }
223223
224- lobbyData = CreateLobbyData (lobby )
224+ lobbyData = CreateLobbyData (handler . cfg , lobby )
225225 })
226226
227227 if lobbyData != nil {
@@ -280,11 +280,11 @@ func (handler *V1Handler) patchLobby(writer http.ResponseWriter, request *http.R
280280 }
281281
282282 // Editable properties
283- maxPlayers , maxPlayersInvalid := ParseMaxPlayers (request .Form .Get ("max_players" ))
284- drawingTime , drawingTimeInvalid := ParseDrawingTime (request .Form .Get ("drawing_time" ))
285- rounds , roundsInvalid := ParseRounds (request .Form .Get ("rounds" ))
283+ maxPlayers , maxPlayersInvalid := ParseMaxPlayers (handler . cfg , request .Form .Get ("max_players" ))
284+ drawingTime , drawingTimeInvalid := ParseDrawingTime (handler . cfg , request .Form .Get ("drawing_time" ))
285+ rounds , roundsInvalid := ParseRounds (handler . cfg , request .Form .Get ("rounds" ))
286286 customWordsPerTurn , customWordsPerTurnInvalid := ParseCustomWordsPerTurn (request .Form .Get ("custom_words_per_turn" ))
287- clientsPerIPLimit , clientsPerIPLimitInvalid := ParseClientsPerIPLimit (request .Form .Get ("clients_per_ip_limit" ))
287+ clientsPerIPLimit , clientsPerIPLimitInvalid := ParseClientsPerIPLimit (handler . cfg , request .Form .Get ("clients_per_ip_limit" ))
288288 publicLobby , publicLobbyInvalid := ParseBoolean ("public" , request .Form .Get ("public" ))
289289
290290 owner := lobby .Owner
@@ -389,9 +389,9 @@ type LobbyData struct {
389389
390390// CreateLobbyData creates a ready to use LobbyData object containing data
391391// from the passed Lobby.
392- func CreateLobbyData (lobby * game.Lobby ) * LobbyData {
392+ func CreateLobbyData (cfg * config. Config , lobby * game.Lobby ) * LobbyData {
393393 return & LobbyData {
394- SettingBounds : game .LobbySettingBounds ,
394+ SettingBounds : cfg .LobbySettingBounds ,
395395 EditableLobbySettings : lobby .EditableLobbySettings ,
396396 LobbyID : lobby .LobbyID ,
397397 DrawingBoardBaseWidth : game .DrawingBoardBaseWidth ,
0 commit comments