class RuneRb::System::Errors::SessionReceptionError

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

Public Class Methods

new(type, expected, received) click to toggle source
Calls superclass method RuneRb::System::Error::new
# File deployment/app/system/errors.rb, line 21
def initialize(type, expected, received)
  case type
  when :banned then super(received, "#{received} is banned from this network!")
  when :op_code then super(received, "Unrecognized operation code received in handshake!\t[Expected:] #{COLOR.green.bold(expected)}, [Received:] #{COLOR.red.bold(received)}")
  when :seed then super(received, "Mismatched seed received in handshake!\t[Expected:] #{COLOR.green.bold(expected)}, [Received:] #{COLOR.red.bold(received)}")
  when :magic then super(received, "Unexpected Magic received in handshake!\t[Expected:] #{COLOR.green.bold(expected)}, [Received:] #{COLOR.red.bold(received)}")
  when :username then super(received, "Invalid Username in handshake!\t[Received:] #{COLOR::red.bold(received)}")
  when :password then super(received, 'Incorrect Password in handshake!')
  when :revision then super(received, "Incompatible revision received in handshake!\t[Received:] #{COLOR::red.bold(received)}")
  else super(received,"Unspecified SessionReceptionError! [Type: #{type.inspect}][Ex: #{COLOR.green.bold(expected)}][Rec: #{COLOR.red.bold(received)}]")
  end
end