Enable server to require i-mic-fps.rb without launching game, fixed missing update method from connection/server, update gemfile to add releasy and rake

This commit is contained in:
2020-05-04 09:28:57 -05:00
parent 85dd90b2f4
commit d524c21332
7 changed files with 42 additions and 25 deletions

View File

@@ -1,9 +1,11 @@
source "https://rubygems.org" source "https://rubygems.org"
gem "rake"
gem "opengl-bindings", require: "opengl" gem "opengl-bindings", require: "opengl"
gem "cyberarm_engine", git: "https://github.com/cyberarm/cyberarm_engine" gem "cyberarm_engine", git: "https://github.com/cyberarm/cyberarm_engine"
gem "nokogiri", ">= 1.11.0.rc1" gem "nokogiri", ">= 1.11.0.rc1"
gem "async-websocket" gem "async-websocket"
group(:packaging) do group(:packaging) do
gem "releasy", github: "gosu/releasy"
gem "ocra" gem "ocra"
end end

View File

@@ -6,6 +6,16 @@ GIT
gosu (~> 0.15.0) gosu (~> 0.15.0)
gosu_more_drawables (~> 0.3) gosu_more_drawables (~> 0.3)
GIT
remote: https://github.com/gosu/releasy.git
revision: e8a24c079c4930c6ddbab17fc444027ba41491ca
specs:
releasy (0.2.3)
bundler (>= 1.2.1)
cri (~> 2.1.0)
ocra (~> 1.3.0)
rake (>= 0.9.2.2)
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
@@ -22,13 +32,14 @@ GEM
protocol-http2 (~> 0.14.0) protocol-http2 (~> 0.14.0)
async-io (1.29.0) async-io (1.29.0)
async (~> 1.14) async (~> 1.14)
async-pool (0.3.0) async-pool (0.3.1)
async (~> 1.25) async (~> 1.25)
async-websocket (0.14.0) async-websocket (0.14.0)
async-http (~> 0.51) async-http (~> 0.51)
async-io (~> 1.23) async-io (~> 1.23)
protocol-websocket (~> 0.7.0) protocol-websocket (~> 0.7.0)
console (1.8.2) console (1.8.2)
cri (2.1.0)
gosu (0.15.1) gosu (0.15.1)
gosu (0.15.1-x64-mingw32) gosu (0.15.1-x64-mingw32)
gosu_more_drawables (0.3.0) gosu_more_drawables (0.3.0)
@@ -49,6 +60,7 @@ GEM
protocol-websocket (0.7.4) protocol-websocket (0.7.4)
protocol-http (~> 0.2) protocol-http (~> 0.2)
protocol-http1 (~> 0.2) protocol-http1 (~> 0.2)
rake (13.0.1)
timers (4.3.0) timers (4.3.0)
PLATFORMS PLATFORMS
@@ -61,6 +73,8 @@ DEPENDENCIES
nokogiri (>= 1.11.0.rc1) nokogiri (>= 1.11.0.rc1)
ocra ocra
opengl-bindings opengl-bindings
rake
releasy!
BUNDLED WITH BUNDLED WITH
2.1.4 2.1.4

View File

@@ -3,8 +3,8 @@ require 'bundler/setup' # Releasy requires that your application uses bundler.
require_relative "lib/version" require_relative "lib/version"
Releasy::Project.new do Releasy::Project.new do
name "I-MIC FPS" name IMICFPS::NAME
version "#{IMICFPS::VERSION}" version IMICFPS::VERSION
executable "i-mic-fps.rb" executable "i-mic-fps.rb"
files ["lib/**/*.*", "assets/**/*.*", "blends/**/*.*", "shaders/**/*.*", "static/**/*.*", "maps/**/*.*", "data/**/*.*"] files ["lib/**/*.*", "assets/**/*.*", "blends/**/*.*", "shaders/**/*.*", "static/**/*.*", "maps/**/*.*", "data/**/*.*"]

View File

@@ -1,12 +1,4 @@
require "async/websocket" require_relative "i-mic-fps"
require_relative "lib/networking/director"
require_relative "lib/networking/packet_handler"
require_relative "lib/networking/server"
require_relative "lib/networking/client"
require_relative "lib/networking/backends/memory_server"
require_relative "lib/networking/backends/memory_connection"
director = IMICFPS::Networking::Director.new(mode: :server, hostname: "0.0.0.0", port: 56789, interface: IMICFPS::Networking::MemoryServer) director = IMICFPS::Networking::Director.new(mode: :server, hostname: "0.0.0.0", port: 56789, interface: IMICFPS::Networking::MemoryServer)
director.define_singleton_method(:tick) do |dt| director.define_singleton_method(:tick) do |dt|

View File

@@ -129,6 +129,8 @@ require_relative "lib/window"
require_relative "lib/tools/asset_viewer" require_relative "lib/tools/asset_viewer"
require_relative "lib/tools/map_editor" require_relative "lib/tools/map_editor"
# Don't launch game if __FILE__ != launching command
if __FILE__ == $0
if ARGV.join.include?("--profile") if ARGV.join.include?("--profile")
begin begin
require "ruby-prof" require "ruby-prof"
@@ -143,3 +145,4 @@ if ARGV.join.include?("--profile")
else else
IMICFPS::Window.new.show IMICFPS::Window.new.show
end end
end

View File

@@ -7,6 +7,9 @@ class IMICFPS
def connect def connect
end end
def update
end
def close def close
end end
end end

View File

@@ -19,6 +19,9 @@ class IMICFPS
def broadcast(packet) def broadcast(packet)
end end
def update
end
def close def close
end end
end end