Class: RuneRb::Network::RS377::StatUpdateMessage

Inherits:
Message
  • Object
show all
Defined in:
app/network/protocol/rs377/outgoing/stat.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) ⇒ StatUpdateMessage

Constructs a new StatUpdateMessage

Parameters:

  • data (Hash)

    data containing the skill ID, experience and level to write to the message.

Since:

  • 0.9.3


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

def initialize(data)
  super('w', { op_code: 49 }, :FIXED)
  write_byte(data[:skill_id], :NEGATE)
  write_byte(data[:level])
  write_int(data[:experience])
end