server

package
v0.0.0-...-84bc974 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package server implements the request/response logic of the server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

func NewConn

func NewConn(conn net.Conn) (*Conn, error)

func (*Conn) Close

func (c *Conn) Close() error

Close closes the conn.

func (*Conn) Disconnect

func (c *Conn) Disconnect(reason types.TextComponent)

Disconnect disconnects the client and closes the conn.

func (*Conn) Handle

func (c *Conn) Handle(ctx context.Context)

handleConn handles a new connection.

type HasJoinedResponse

type HasJoinedResponse struct {
	// Player's identifier, in the format 11111111222233334444555555555555
	ID string `json:"id"`
	// Player's username
	Name string `json:"name"`
	// Other properties, normally has one containing the user's skin blob:
	// {Name: "textures", Value: "base64 string",
	//  Signature: "base64 string signed using Yggdrasil's private key'"}
	Properties []HasJoinedResponseProperty `json:"properties"`
}

HasJoinedResponse is the response from the /hasJoined Mojang endpoint.

type HasJoinedResponseProperty

type HasJoinedResponseProperty struct {
	// Name of the property.
	Name string `json:"name"`
	// Value of the property.
	Value string `json:"value"`
	// Signature of the value.
	Signature string `json:"signature"`
}

HasJoinedResponseProperty is a property in HasJoinedResponse.

Directories

Path Synopsis
Package serverstate contains an enum for the current server state.
Package serverstate contains an enum for the current server state.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL