Create models folder for all the storage classe
This commit is contained in:
parent
846b487eb2
commit
263e579661
|
@ -1,8 +1,8 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative 'player'
|
require_relative 'models/player'
|
||||||
|
require_relative 'models/chat_message'
|
||||||
require_relative 'packer'
|
require_relative 'packer'
|
||||||
require_relative 'chat_message'
|
|
||||||
|
|
||||||
class Context
|
class Context
|
||||||
attr_reader :old_data, :client
|
attr_reader :old_data, :client
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative 'map'
|
require_relative 'models/map'
|
||||||
require_relative 'server_info'
|
require_relative 'models/server_info'
|
||||||
require_relative 'game_info'
|
require_relative 'models/game_info'
|
||||||
|
|
||||||
class GameServer
|
class GameServer
|
||||||
attr_accessor :pred_game_tick, :ack_game_tick, :map
|
attr_accessor :pred_game_tick, :ack_game_tick, :map
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative 'packer'
|
require_relative '../packer'
|
||||||
|
|
||||||
class GameInfo
|
class GameInfo
|
||||||
attr_accessor :game_flags, :score_limit, :time_limit, :match_num, :match_current
|
attr_accessor :game_flags, :score_limit, :time_limit, :match_num, :match_current
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative 'bytes'
|
require_relative '../bytes'
|
||||||
|
|
||||||
class Map
|
class Map
|
||||||
attr_reader :name, :crc, :crc_str, :crc_arr, :size, :sha256, :sha256_str, :sha256_arr
|
attr_reader :name, :crc, :crc_str, :crc_arr, :size, :sha256, :sha256_str, :sha256_arr
|
|
@ -1,8 +1,8 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative 'network'
|
require_relative '../network'
|
||||||
require_relative 'player'
|
require_relative 'player'
|
||||||
require_relative 'packer'
|
require_relative '../packer'
|
||||||
|
|
||||||
class ServerInfo
|
class ServerInfo
|
||||||
attr_accessor :version, :name, :hostname, :map, :gametype, :flags, :num_players, :max_players, :num_clients,
|
attr_accessor :version, :name, :hostname, :map, :gametype, :flags, :num_players, :max_players, :num_clients,
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative 'bytes'
|
require_relative '../bytes'
|
||||||
|
|
||||||
class SecurityToken
|
class SecurityToken
|
||||||
def self.err_msg(msg, token)
|
def self.err_msg(msg, token)
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative 'token'
|
require_relative 'models/token'
|
||||||
|
|
||||||
##
|
##
|
||||||
# NetBase
|
# NetBase
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative 'net_addr'
|
require_relative 'models/net_addr'
|
||||||
require_relative 'packet_flags'
|
require_relative 'models/packet_flags'
|
||||||
|
|
||||||
require 'huffman_tw'
|
require 'huffman_tw'
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,10 @@ require_relative 'bytes'
|
||||||
require_relative 'network'
|
require_relative 'network'
|
||||||
require_relative 'packet'
|
require_relative 'packet'
|
||||||
require_relative 'chunk'
|
require_relative 'chunk'
|
||||||
require_relative 'server_info'
|
require_relative 'models/server_info'
|
||||||
require_relative 'net_base'
|
require_relative 'net_base'
|
||||||
require_relative 'packer'
|
require_relative 'packer'
|
||||||
require_relative 'player'
|
require_relative 'models/player'
|
||||||
require_relative 'game_client'
|
require_relative 'game_client'
|
||||||
require_relative 'message'
|
require_relative 'message'
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,11 @@ require_relative 'network'
|
||||||
require_relative 'packet'
|
require_relative 'packet'
|
||||||
require_relative 'chunk'
|
require_relative 'chunk'
|
||||||
require_relative 'net_base'
|
require_relative 'net_base'
|
||||||
require_relative 'net_addr'
|
require_relative 'models/net_addr'
|
||||||
require_relative 'packer'
|
require_relative 'packer'
|
||||||
require_relative 'game_server'
|
require_relative 'game_server'
|
||||||
require_relative 'message'
|
require_relative 'message'
|
||||||
require_relative 'token'
|
require_relative 'models/token'
|
||||||
|
|
||||||
class Client
|
class Client
|
||||||
attr_accessor :id, :addr, :vital_sent, :last_recv_time, :token, :player, :in_game
|
attr_accessor :id, :addr, :vital_sent, :last_recv_time, :token, :player, :in_game
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../lib/server_info'
|
require_relative '../lib/models/server_info'
|
||||||
|
|
||||||
describe 'ServerInfo', :server_info do
|
describe 'ServerInfo', :server_info do
|
||||||
context 'Pack to network' do
|
context 'Pack to network' do
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../lib/game_info'
|
require_relative '../lib/models/game_info'
|
||||||
|
|
||||||
describe 'GameInfo', :game_info do
|
describe 'GameInfo', :game_info do
|
||||||
context 'Pack to network' do
|
context 'Pack to network' do
|
||||||
|
|
Loading…
Reference in a new issue