Module: GG::PACKET_SEND_MSG

Defined in:
lib/GRuby/GG_packets.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#class=(value) ⇒ Object (writeonly)

klasa wiadomości */


215
216
217
# File 'lib/GRuby/GG_packets.rb', line 215

def class=(value)
  @class = value
end

#message=(value) ⇒ Object (writeonly)

treść */


216
217
218
# File 'lib/GRuby/GG_packets.rb', line 216

def message=(value)
  @message = value
end

#recipient=(value) ⇒ Object (writeonly)

numer odbiorcy */


213
214
215
# File 'lib/GRuby/GG_packets.rb', line 213

def recipient=(value)
  @recipient = value
end

#seq=(value) ⇒ Object (writeonly)

numer sekwencyjny */


214
215
216
# File 'lib/GRuby/GG_packets.rb', line 214

def seq=(value)
  @seq = value
end

Instance Method Details

#lengthObject


233
234
235
# File 'lib/GRuby/GG_packets.rb', line 233

def length
  4+4+4+@message.length
end

#packedObject


237
238
239
# File 'lib/GRuby/GG_packets.rb', line 237

def packed
  pack 'II IIIA*'
end

#packetObject


222
223
224
225
226
227
228
229
230
231
# File 'lib/GRuby/GG_packets.rb', line 222

def packet
  [
    type,
    length,
    @recipient ? @recipient     : 0,
    @seq       ? @seq           : 0,
    @class     ? @class         : 0x0008,
    @message   ? "#{@message}"  : "\0"
  ]
end

#typeObject


218
219
220
# File 'lib/GRuby/GG_packets.rb', line 218

def type
  SEND_MSG
end