Exception: RuneRb::System::Errors::SessionReceptionError

Inherits:
StandardError
  • Object
show all
Defined in:
app/system/errors.rb

Overview

Raised when a Session is not received by a RuneRb::Game::World::Instance

Since:

  • 0.9.3

Instance Method Summary collapse

Constructor Details

#initialize(type, expected, received) ⇒ SessionReceptionError

Returns a new instance of SessionReceptionError.

Since:

  • 0.9.3


4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/system/errors.rb', line 4

def initialize(type, expected, received)
  case type
  when :banned then super("#{received} is banned from this network!")
  when :op_code then super("Unrecognized operation code received in handshake!\t[Expected:] #{RuneRb::GLOBAL[:COLOR].green.bold(expected)}, [Received:] #{RuneRb::GLOBAL[:COLOR].red.bold(received)}")
  when :seed then super("Mismatched seed received in handshake!\t[Expected:] #{RuneRb::GLOBAL[:COLOR].green.bold(expected)}, [Received:] #{RuneRb::GLOBAL[:COLOR].red.bold(received)}")
  when :magic then super("Unexpected Magic received in handshake!\t[Expected:] #{RuneRb::GLOBAL[:COLOR].green.bold(expected)}, [Received:] #{RuneRb::GLOBAL[:COLOR].red.bold(received)}")
  when :username then super("Invalid Username in handshake!\t[Received:] #{RuneRb::GLOBAL[:COLOR]::red.bold(received)}")
  when :password then super('Incorrect Password in handshake!')
  when :revision then super("Incompatible revision received in handshake!\t[Received:] #{RuneRb::GLOBAL[:COLOR]::red.bold(received)}")
  else super("Unspecified SessionReceptionError! [Type: #{type.inspect}][Ex: #{RuneRb::GLOBAL[:COLOR].green.bold(expected)}][Rec: #{RuneRb::GLOBAL[:COLOR].red.bold(received)}]")
  end
end