mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-20 13:50:46 +00:00
Enhance standalone mode with VM IP handling and UI updates
- Updated `GamesController` to parse and store VM IPs from JSON input, improving player state management. - Modified `Game` model to include VM IPs in the context for better integration with gameplay. - Enhanced `Mission` model's `vm_object` method to override IPs from the context when available. - Revamped `new.html.erb` to provide a clearer interface for entering VM IP addresses and flag hints. - Improved `vm-launcher-minigame.js` to display VM IPs and provide connection instructions in standalone mode.
This commit is contained in:
@@ -42,6 +42,16 @@ module BreakEscape
|
||||
end
|
||||
end
|
||||
|
||||
# Standalone mode with VM IPs JSON
|
||||
if params[:vm_ips_json].present?
|
||||
begin
|
||||
vm_ips = JSON.parse(params[:vm_ips_json])
|
||||
initial_player_state['vm_ips'] = vm_ips if vm_ips.is_a?(Hash)
|
||||
rescue JSON::ParserError => e
|
||||
Rails.logger.warn "[BreakEscape] Invalid vm_ips_json: #{e.message}"
|
||||
end
|
||||
end
|
||||
|
||||
# Standalone mode with XML flag hints
|
||||
if params[:flag_hints_xml].present?
|
||||
flags_by_vm = Mission.parse_flag_hints_xml(params[:flag_hints_xml])
|
||||
|
||||
Reference in New Issue
Block a user