class Client

Included Modules

Defined in:

client/client.cr

Constant Summary

BUFFER_SIZE = 1024 * 1024

Constructors

Instance Method Summary

Instance methods inherited from class ClientHandler

handle(state : ProtocolState, data : Bytes)
handle(packet : Status::C::ServerInfo)
handle(packet : Status::C::Pong)
handle(packet : Login::C::LoginDisconnect)
handle(packet : Login::C::EncryptionRequest)
handle(packet : Login::C::LoginSuccess)
handle(packet : Login::C::EnableCompression)
handle(packet : Play::C::KeepAlive)
handle(packet : Play::C::JoinGame)
handle(packet : Play::C::Chat)
handle(packet : Play::C::TimeUpdate)
handle(packet : Play::C::EntityEquipment)
handle(packet : Play::C::SpawnPosition)
handle(packet : Play::C::UpdateHealth)
handle(packet : Play::C::Respawn)
handle(packet : Play::C::PlayerPosLook)
handle(packet : Play::C::HeldItemChange)
handle(packet : Play::C::UseBed)
handle(packet : Play::C::Animation)
handle(packet : Play::C::SpawnPlayer)
handle(packet : Play::C::CollectItem)
handle(packet : Play::C::SpawnObject)
handle(packet : Play::C::SpawnMob)
handle(packet : Play::C::SpawnPainting)
handle(packet : Play::C::SpawnExperienceOrb)
handle(packet : Play::C::EntityVelocity)
handle(packet : Play::C::DestroyEntities)
handle(packet : Play::C::Entity)
handle(packet : Play::C::EntityRelativeMove)
handle(packet : Play::C::EntityLook)
handle(packet : Play::C::EntityLookAndRelativeMove)
handle(packet : Play::C::EntityTeleport)
handle(packet : Play::C::EntityHeadLook)
handle(packet : Play::C::EntityStatus)
handle(packet : Play::C::AttachEntity)
handle(packet : Play::C::EntityMetadata)
handle(packet : Play::C::EntityEffect)
handle(packet : Play::C::RemoveEntityEffect)
handle(packet : Play::C::SetExperience)
handle(packet : Play::C::EntityProperties)
handle(packet : Play::C::ChunkData)
handle(packet : Play::C::MultiBlockChange)
handle(packet : Play::C::BlockChange)
handle(packet : Play::C::BlockAction)
handle(packet : Play::C::BlockBreakAnim)
handle(packet : Play::C::MapChunkBulk)
handle(packet : Play::C::Explosion)
handle(packet : Play::C::Effect)
handle(packet : Play::C::SoundEffect)
handle(packet : Play::C::Particles)
handle(packet : Play::C::ChangeGameState)
handle(packet : Play::C::SpawnGlobalEntity)
handle(packet : Play::C::OpenWindow)
handle(packet : Play::C::CloseWindow)
handle(packet : Play::C::SetSlot)
handle(packet : Play::C::WindowItems)
handle(packet : Play::C::WindowProperty)
handle(packet : Play::C::ConfirmTransaction)
handle(packet : Play::C::UpdateSign)
handle(packet : Play::C::Maps)
handle(packet : Play::C::UpdateTileEntity)
handle(packet : Play::C::SignEditorOpen)
handle(packet : Play::C::Statistics)
handle(packet : Play::C::PlayerListItem)
handle(packet : Play::C::PlayerAbilities)
handle(packet : Play::C::TabComplete)
handle(packet : Play::C::ScoreboardObjective)
handle(packet : Play::C::UpdateScore)
handle(packet : Play::C::DisplayScoreboard)
handle(packet : Play::C::Teams)
handle(packet : Play::C::CustomPayload)
handle(packet : Play::C::PlayDisconnect)
handle(packet : Play::C::ServerDifficulty)
handle(packet : Play::C::CombatEvent)
handle(packet : Play::C::Camera)
handle(packet : Play::C::SetWorldBorder)
handle(packet : Play::C::SetTitle)
handle(packet : Play::C::SetCompressionLevel)
handle(packet : Play::C::PlayerListHeaderFooter)
handle(packet : Play::C::ResourcePackSend)
handle(packet : Play::C::UpdateEntityNBT)
handle

Constructor methods inherited from class ClientHandler

new new

Constructor Detail

def self.new(username : String, password : String | Nil = nil) #

[View source]

Instance Method Detail

def authenticate #

[View source]
def close #

[View source]
def connect(host : String, port : Int32 = 25565) #

[View source]
def disconnect #

[View source]
def get_length_header(data : Bytes) #

[View source]
def handle(packet : Login::C::EncryptionRequest) #
Description copied from class ClientHandler

Generate the ClientHandler class


[View source]
def handle(packet : Login::C::LoginDisconnect) #
Description copied from class ClientHandler

Generate the ClientHandler class


[View source]
def handle(packet : Login::C::LoginSuccess) #
Description copied from class ClientHandler

Generate the ClientHandler class


[View source]
def handle(packet : Login::C::EnableCompression) #
Description copied from class ClientHandler

Generate the ClientHandler class


[View source]
def handle(packet : Play::C::KeepAlive) #
Description copied from class ClientHandler

Generate the ClientHandler class


[View source]
def handle(packet : Play::C::PlayDisconnect) #
Description copied from class ClientHandler

Generate the ClientHandler class


[View source]
def on #

[View source]
def once #

[View source]
def read #

[View source]
def receive #

[View source]
def write(packet : RawPacket) #

[View source]