diff --git a/Rakefile b/Rakefile index e22d8e3..c073ec4 100644 --- a/Rakefile +++ b/Rakefile @@ -12,7 +12,7 @@ Releasy::Project.new do verbose add_build :windows_folder do - # icon "assets/icon.ico" + icon "static/icon.ico" executable_type :console # Assuming you don't want it to run with a console window. add_package :exe # Windows self-extracting archive. end diff --git a/_background_menu_test.rb b/_background_menu_test.rb index bc72da4..a2dd0ae 100644 --- a/_background_menu_test.rb +++ b/_background_menu_test.rb @@ -1,5 +1,8 @@ -require "gosu" -require_relative "lib/objects/text" +begin + require_relative "../cyberarm_engine/lib/cyberarm_engine" +rescue LoadError + require "cyberarm_engine" +end class Window < Gosu::Window def initialize @@ -9,8 +12,8 @@ class Window < Gosu::Window @slope = 250 @color_step = 10 @base_color = Gosu::Color.rgb(255, 127, 0) - @title = Text.new("I-MIC FPS", color: Gosu::Color.rgb(255,127,0), size: 100, x: 0, y: 15, alignment: :center) - @singleplayer = Text.new("Singleplayer", color: Gosu::Color.rgb(0,127,127), size: 50, x: 0, y: 150, alignment: :center) + @title = CyberarmEngine::Text.new("I-MIC FPS", color: Gosu::Color.rgb(255,127,0), size: 100, x: 0, y: 15, alignment: :center) + @singleplayer = CyberarmEngine::Text.new("Singleplayer", color: Gosu::Color.rgb(0,127,127), size: 50, x: 0, y: 150, alignment: :center) end def draw diff --git a/i-mic-fps.rb b/i-mic-fps.rb index 8c7c7f6..66de036 100644 --- a/i-mic-fps.rb +++ b/i-mic-fps.rb @@ -3,10 +3,12 @@ require "yaml" require "json" require "abbrev" require "time" +require "socket" require "opengl" require "glu" require "nokogiri" +require "async/websocket" begin require_relative "../cyberarm_engine/lib/cyberarm_engine" diff --git a/lib/managers/network_manager.rb b/lib/managers/network_manager.rb index e69de29..310f7f1 100644 --- a/lib/managers/network_manager.rb +++ b/lib/managers/network_manager.rb @@ -0,0 +1,26 @@ +class IMICFPS + class NetworkManager + MULTICAST_ADDRESS = "224.0.0.1" + MULTICAST_PORT = 30_000 + + REMOTE_GAMEHUB = "i-mic.rubyclan.org" + REMOTE_GAMEHUB_PORT = 98765 + + DEFAULT_SERVER_HOST = "0.0.0.0" + DEFAULT_SERVER_PORT = 56789 + DEFAULT_SERVER_QUERY_PORT = 28900 + def initialize + end + + # https://github.com/jpignata/blog/blob/master/articles/multicast-in-ruby.md + def broadcast_lan_lobby + socket = UDPSocket.open + socket.setsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL, 1) + socket.send("IMICFPS_LAN_LOBBY", 0, MULTICAST_ADDRESS, MULTICAST_PORT) + socket.close + end + + def handle_lan_multicast + end + end +end \ No newline at end of file diff --git a/pixel_test.png b/pixel_test.png deleted file mode 100644 index 819f819..0000000 Binary files a/pixel_test.png and /dev/null differ diff --git a/static/icon.ico b/static/icon.ico new file mode 100644 index 0000000..71c5555 Binary files /dev/null and b/static/icon.ico differ