MCPcopy Index your code
hub / github.com/cooldogedev/spectrum

github.com/cooldogedev/spectrum @v0.0.43

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.43 ↗ · + Follow
232 symbols 647 edges 50 files 181 documented · 78%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Spectrum

Spectrum is a blazingly fast, lightweight, and easy to use Minecraft: Bedrock Edition proxy.

Discord

Examples

Explore how to use Spectrum in the example directory.

Implementations

Spectrum's protocol uses Spectral, TCP and QUIC instead of RakNet and the standard Minecraft protocol, providing better reliability and performance. Check out compatible implementations:

Usage

API

Spectrum provides an external TCP service for communication between downstream servers and the proxy through packets. This service supports tasks such as player transfers and kicks and is designed to be extensible, allowing you to register your own packets and handlers.

For a practical example, see the example API implementation. Official implementations include an API client for easy integration. If you’re using Go, you can use the Dial function from the API package to dial an API service.

Discovery

Spectrum introduces Discovery, a method for server determination when players join. It handles connections asynchronously, determining the server address for connection or signaling disconnection errors. This process allows for blocking operations like database queries and HTTP requests. In addition, Spectrum offers an in-built static discovery that maintains a constant server address. Furthermore, the discovery feature can also function as a server load balancer.

Processor

The Processor interface in Spectrum handles incoming and outgoing packets within sessions, enabling custom filtering and manipulation. This functionality supports implementing anti-cheat measures and other security features. Downstream servers are responsible for prefixing packets to indicate decoding necessity, as per Spectrum protocol specifications.

Why Spectrum?

  • Protocol Innovation: Utilizes Spectral and QUIC for enhanced reliability and performance, unlike traditional proxies relying on RakNet and standard Minecraft protocol.

  • Efficient Packet Handling: Maintains high throughput by bypassing unnecessary packet decoding, optimizing data transmission and reducing latency.

  • Customizability: Provides extensive customization options, including defining transfer transitions and custom behaviors, for unique gameplay experiences.

  • Lightweight and Fast: Built for high performance with a lightweight architecture, capable of handling various connection loads efficiently.

  • Stateless: Simplifies scalability with a stateless design, enhancing flexibility and efficiency in server management by not keeping track of registered servers within the proxy. Transfer between servers is as easy as sending Spectrum's transfer packet to the player from downstream servers.

  • Deterministic: Takes a unique approach by sidestepping entity translations altogether, relying solely on deterministic entity identifiers provided by the downstream servers.

Extension points exported contracts — how you extend this code

Animation (Interface)
Animation is an interface used by sessions to manage visual animations during server transfers. [4 implementers]
session/animation/animation.go
Packet (Interface)
Packet represents a protocol packet that can be sent over an API connection. It defines methods for identifying the pack [4 …
api/packet/packet.go
Transport (Interface)
Transport defines an interface for establishing server connections. [2 implementers]
transport/transport.go
Processor (Interface)
Processor defines methods for processing various actions within a proxy session. [1 implementers]
session/processor.go
Authentication (Interface)
Authentication defines an interface for authentication methods. [1 implementers]
api/authentication.go
Discovery (Interface)
Discovery defines an interface for discovering servers based on a player's connection. [1 implementers]
server/discovery.go

Core symbols most depended-on inside this repo

WritePacket
called by 41
server/conn.go
Processor
called by 15
session/session.go
CloseWithError
called by 13
session/session.go
NewContext
called by 13
session/processor.go
ID
called by 10
api/packet/packet.go
Write
called by 9
server/conn.go
NewSpectrum
called by 8
spectrum.go
Listen
called by 8
spectrum.go

Shape

Method 149
Function 41
Struct 35
Interface 6
TypeAlias 1

Languages

Go100%

Modules by API surface

session/processor.go28 symbols
session/session.go25 symbols
server/conn.go23 symbols
spectrum.go10 symbols
session/tracker.go8 symbols
session/animation/animation.go8 symbols
api/api.go8 symbols
session/registry.go7 symbols
server/discovery.go7 symbols
session/handler.go6 symbols
api/client.go5 symbols
api/authentication.go5 symbols

For agents

$ claude mcp add spectrum \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact