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"
gem "rake"
gem "opengl-bindings", require: "opengl"
gem "cyberarm_engine", git: "https://github.com/cyberarm/cyberarm_engine"
gem "nokogiri", ">= 1.11.0.rc1"
gem "async-websocket"
group(:packaging) do
gem "releasy", github: "gosu/releasy"
gem "ocra"
end

View File

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

View File

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

View File

@@ -1,12 +1,4 @@
require "async/websocket"
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"
require_relative "i-mic-fps"
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|

View File

@@ -129,17 +129,20 @@ require_relative "lib/window"
require_relative "lib/tools/asset_viewer"
require_relative "lib/tools/map_editor"
if ARGV.join.include?("--profile")
begin
require "ruby-prof"
RubyProf.start
IMICFPS::Window.new.show
result = RubyProf.stop
printer = RubyProf::MultiPrinter.new(result)
printer.print(path: ".", profile: "profile", min_percent: 2)
rescue LoadError
puts "ruby-prof not installed!"
# Don't launch game if __FILE__ != launching command
if __FILE__ == $0
if ARGV.join.include?("--profile")
begin
require "ruby-prof"
RubyProf.start
IMICFPS::Window.new.show
result = RubyProf.stop
printer = RubyProf::MultiPrinter.new(result)
printer.print(path: ".", profile: "profile", min_percent: 2)
rescue LoadError
puts "ruby-prof not installed!"
end
else
IMICFPS::Window.new.show
end
else
IMICFPS::Window.new.show
end
end

View File

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

View File

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