# File lib/storage/yamlstore.rb, line 27 def initialize(dbfile) super() @dbfile = "#{dbfile}.yaml" # check if database exists and build it if not build_database log.info "Loading world..." @db = {} # load the yaml database and sets @dbtop to highest object id YAML::load_file(@dbfile).each do |o| @dbtop = o.id if o.id > @dbtop @db[o.id]=o end log.info "Database '#{@dbfile}' loaded...highest id = #{@dbtop}." # log.debug @db.inspect rescue log.fatal "Error loading database" log.fatal $! raise end