@@ -190,7 +190,9 @@ export class EventsGateway implements OnGatewayConnection, OnGatewayDisconnect {
190190 socketId : SocketId ,
191191 { machine, code, password } : JoinLobbyPayload ,
192192 ) : Promise < EventMessage < ResponseStatusPayload > | undefined > {
193- if ( ! canJoinLobby ( code , password ) ) {
193+ const normalizedCode = code . toUpperCase ( ) ;
194+
195+ if ( ! canJoinLobby ( normalizedCode , password ) ) {
194196 return {
195197 event : 'responseStatus' ,
196198 data : {
@@ -211,7 +213,7 @@ export class EventsGateway implements OnGatewayConnection, OnGatewayDisconnect {
211213 this . disconnectMachine ( socketId ) ;
212214 }
213215
214- const lobby = LOBBYMAN . lobbies [ code ] ;
216+ const lobby = LOBBYMAN . lobbies [ normalizedCode ] ;
215217 if ( lobby === undefined ) {
216218 return responseStatusFailure ( 'joinLobby' , 'Lobby not found' ) ;
217219 }
@@ -230,10 +232,10 @@ export class EventsGateway implements OnGatewayConnection, OnGatewayDisconnect {
230232 ...machine ,
231233 socketId,
232234 } ;
233- ROOMMAN . join ( socketId , code ) ;
234- LOBBYMAN . machineConnections [ socketId ] = code ;
235+ ROOMMAN . join ( socketId , normalizedCode ) ;
236+ LOBBYMAN . machineConnections [ socketId ] = normalizedCode ;
235237
236- this . broadcastLobbyState ( code ) ;
238+ this . broadcastLobbyState ( normalizedCode ) ;
237239
238240 return undefined ;
239241 }
0 commit comments