Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion client/src/network/NetClient.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ local function processLeaveRoomMessage(self, message)
-- instead we actively abort the match ourselves
self.room.match:abort()
self.room.match:deinit()
transition = MessageTransition(love.timer.getTime(), 5, message.reason or "", false)

if message.reason then
-- the server sends a reason for leaveRoom only if a player (not a spectator) in the room leaves/crashes/disconnects
-- the other player and spectators should be informed why the room is being closed
transition = MessageTransition(love.timer.getTime(), 5, message.reason, false)
end
end

-- and then shutdown the room
Expand Down
2 changes: 1 addition & 1 deletion server/Room.lua
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function Room:remove_spectator(spectator)
self.spectators[i].state = "lobby"
logger.debug(spectator.name .. " left " .. self.name .. " as a spectator")
table.remove(self.spectators, i)
spectator:removeFromRoom(self, spectator.name .. " left")
spectator:removeFromRoom(self)
lobbyChanged = true
break
end
Expand Down