Added initial support for extracting map preview images from game level mixes that include a screenshot or overhead map

This commit is contained in:
2026-09-18 22:21:20 -05:00
parent 0a1909a84c
commit 53e7a72ceb
9 changed files with 137 additions and 8 deletions

View File

@@ -16,6 +16,10 @@ module W3DHubLauncher
Worker::Request.new(:ico_to_png, { ico_path: ico_path, png_path: png_path }, &block)
end
def self.server_map_image(server, &block)
Worker::Request.new(:server_map_image, { server: { address: server.address, port: server.port, map: server.current_map } }, &block)
end
def self.dns_resolution(&block)
Worker::Request.new(:dns_resolution, "", &block)
end

View File

@@ -89,6 +89,10 @@ module W3DHubLauncher
0xff_3d3846
end
end
def map_preview_image_path
format("%s/map_preview_%s.png", W3DHubLauncher::CACHE_PATH, Digest::SHA256.hexdigest("#{@game}_#{@channel}_#{@current_map}"))
end
end
class Team

View File

@@ -35,7 +35,10 @@ module W3DHubLauncher
end
def application_installed?(application, channel)
applications.find { |app| app.id == application&.id && app.channel == channel&.id }
app_id = application.is_a?(String) ? application : application.id
channel_id = channel.is_a?(String) ? channel : channel.id
applications.find { |app| app.id == app_id && app.channel == channel_id }
end
# User explictly set options