--[[
	Handles case when configuration changes in server - we'd have to reset some of the items in order for it to make
	sense.
]]

return function(contexts, services, remoteEvents)
	return function(config)
		local playerSpots = contexts.playerSpots

		-- Reset all player spots
		for userId, playerSpot in pairs(playerSpots) do
			playerSpot:cleanup()
			playerSpots[userId] = PlayerSpots.new(config.quotaPerPlayer)
		end

		-- Re-run setup code
		contexts.canvases = {}
		setupServer(contexts, services, remoteEvents)
	end
end
