Class: RuneRb::Network::RS377::MembersAndIndexMessage

Inherits:
Message
  • Object
show all
Defined in:
app/network/protocol/rs377/outgoing/membership_and_index.rb

Overview

Since:

  • 0.9.3

Constant Summary

Constants included from Constants

Constants::BIT_MASK_OUT, Constants::BYTE_MUTATIONS, Constants::BYTE_ORDERS, Constants::BYTE_SIZE, Constants::CONNECTION_TYPES, Constants::LOGIN_RESPONSES, Constants::MESSAGE_SIZES, Constants::PROTOCOL_TEMPLATES, Constants::RW_TYPES, Constants::SIDEBAR_INTERFACES

Instance Attribute Summary

Attributes inherited from Message

#header, #mode

Instance Method Summary collapse

Methods inherited from Message

compile_header, #inspect, #peek, validate

Methods included from System::Log

#class_name, #err, #err!, #log, #log!, #symbolize_file

Constructor Details

#initialize(data) ⇒ MembersAndIndexMessage

Constructs a MembersAndIndexMessage

Parameters:

  • data (Hash)

    data containing the members value and player index which will be written to the message.

Since:

  • 0.9.3


6
7
8
9
10
# File 'app/network/protocol/rs377/outgoing/membership_and_index.rb', line 6

def initialize(data)
  super('w', { op_code: 126 }, :FIXED)
  write_byte(data[:members] ? 1 : 0)
  write_short(data[:player_idx], :LITTLE)
end