class Rosegold::ChatManager

Overview

Manages chat message signing, salt generation, and acknowledgment tracking according to the Minecraft 1.21.8 protocol requirements.

Defined in:

rosegold/chat_manager.cr

Constant Summary

MAX_LAST_SEEN_MESSAGES = 20
SIGNATURE_SIZE = 256

Constructors

Instance Method Summary

Constructor Detail

def self.new(client : Client) #

[View source]

Instance Method Detail

def add_last_seen_signature(signature : Bytes) #

Add a received message signature to the last seen list


[View source]
def increment_message_count #

Increment message count (used when receiving messages from server)


[View source]
def public_key_bytes : Bytes | Nil #

Get public key bytes for server authentication (if needed)


[View source]
def reset_session #

Reset chat session (useful for reconnections)


[View source]
def send_chat(message : String) : Bool #

Send chat message or command, automatically determining the correct method based on the message content and protocol version


[View source]
def send_command(command : String) : Bool #

Send a command with proper signing


[View source]
def send_message(message : String) : Bool #

Send a regular chat message with proper signing and acknowledgment


[View source]