Class: Interlnk::Packet::ServerInfoRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/interlnk/packet/serverinfo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Request

#bytes

Constructor Details

#initializeServerInfoRequest

Returns a new instance of ServerInfoRequest.



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/interlnk/packet/serverinfo.rb', line 11

def initialize
  @os_type = 0
  @developer = 0
  @product = 0
  @version = 0x100
  @device_driver = 1
  @want_supported = 0
  @checksum = 0
  @crc = 1
  @max_ser_block = 8192
  @client_id = rand(0xFFFF)
  @last_server_id = 0
end

Instance Attribute Details

#client_idObject

Returns the value of attribute client_id.



9
10
11
# File 'lib/interlnk/packet/serverinfo.rb', line 9

def client_id
  @client_id
end

#developerObject

Returns the value of attribute developer.



6
7
8
# File 'lib/interlnk/packet/serverinfo.rb', line 6

def developer
  @developer
end

#device_driverObject

Returns the value of attribute device_driver.



7
8
9
# File 'lib/interlnk/packet/serverinfo.rb', line 7

def device_driver
  @device_driver
end

#last_server_idObject

Returns the value of attribute last_server_id.



9
10
11
# File 'lib/interlnk/packet/serverinfo.rb', line 9

def last_server_id
  @last_server_id
end

#max_ser_blockObject

Returns the value of attribute max_ser_block.



8
9
10
# File 'lib/interlnk/packet/serverinfo.rb', line 8

def max_ser_block
  @max_ser_block
end

#os_typeObject

Returns the value of attribute os_type.



6
7
8
# File 'lib/interlnk/packet/serverinfo.rb', line 6

def os_type
  @os_type
end

#productObject

Returns the value of attribute product.



6
7
8
# File 'lib/interlnk/packet/serverinfo.rb', line 6

def product
  @product
end

#versionObject

Returns the value of attribute version.



7
8
9
# File 'lib/interlnk/packet/serverinfo.rb', line 7

def version
  @version
end

#want_supportedObject

Returns the value of attribute want_supported.



8
9
10
# File 'lib/interlnk/packet/serverinfo.rb', line 8

def want_supported
  @want_supported
end

Instance Method Details

#rawObject



25
26
27
28
29
30
31
# File 'lib/interlnk/packet/serverinfo.rb', line 25

def raw
  [
    @os_type, @developer, @product, @version,
    @device_driver, @want_supported, @checksum, @crc,
    @max_ser_block, '', @client_id, @last_server_id
  ].pack('vvvvCCCCva12VV')
end