转载module DataManager
#存档
def self.save_game_without_rescue(index)
File.open(make_filename(index), "wb") do |file|
$game_system.on_before_save
Marshal.dump("解包穷三代",file) #额外的Marshal.dump
Marshal.dump(make_save_header, file)
Marshal.dump("作弊毁一生",file) #额外的Marshal.dump
Marshal.dump(make_save_contents, file)
@last_savefile_index = index
end
return true
end
#读取存档内容
def self.load_game_without_rescue(index)
File.open(make_filename(index), "rb") do |file|
Marshal.load(file) #额外的Marshal.load
Marshal.load(file)
Marshal.load(file) #额外的Marshal.load
extract_save_contents(Marshal.load(file))
reload_map_if_updated
@last_savefile_index = index
end
return true
end
#读取存档头
def self.load_header_without_rescue(index)
File.open(make_filename(index), "rb") do |file|
Marshal.load(file) #额外的Marshal.load
return Marshal.load(file)
end
return nil
end
end