Table of Contents

Class GeyserConfigService

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

Geyser's config.yml: where it lives, and the two ports the launcher has to set in it.

public static class GeyserConfigService
Inheritance
GeyserConfigService
Inherited Members

Remarks

Geyser works out the Java server's address and port on its own. It does not work out the authentication: a server with Floodgate installed sat on auth-type: online for eight days, so Geyser tried to authenticate against Mojang, had no account to do it with, and Floodgate turned every Bedrock player away asking whether it was configured correctly. The launcher writes that setting rather than trusting it to be detected.

Two things it cannot work out by itself. The first is which local UDP port to listen on, when the default 19132 is taken by another server. The second is broadcast-port, and that one matters more than it looks: behind a Playit tunnel the port players connect to is the tunnel's public port, never the local one, and Geyser's own comment says not to touch this setting unless exactly that is true. Left alone, the Bedrock server list advertises a port that does not work. The launcher is the one component that knows both numbers, because it creates the tunnel.

Fields

SupportedTypes

The server types Geyser publishes a build for.

public static readonly ServerType[] SupportedTypes

Field Value

ServerType[]

Remarks

Forge and Vanilla are absent because Geyser genuinely has no build for them — not an oversight here. Vanilla has no plugin or mod loader at all, and Geyser dropped Forge in favour of NeoForge. Both could in principle be served by Geyser Standalone, which is a separate process to supervise, and that is deliberately out of scope.

Methods

ConfigPath(string, ServerType)

Geyser's config file for a server, or null for a type it cannot run on.

public static string? ConfigPath(string serverFolder, ServerType type)

Parameters

serverFolder string
type ServerType

Returns

string

Remarks

Plugins keep their configuration under plugins/ and mods under config/, and each Geyser build names its own folder after the platform it was built for.

MinimalConfig(int, int?, bool)

The smallest config that works, for before Geyser has ever run.

public static string MinimalConfig(int bedrockPort, int? broadcastPort, bool floodgate)

Parameters

bedrockPort int
broadcastPort int?
floodgate bool

Returns

string

Remarks

Geyser writes a full commented config on first start and fills in whatever a hand-written one leaves out, so this only needs to carry the parts it could not have guessed. Written before the first start so crossplay works on the first run rather than the second.

SetBedrockPorts(string, int, int?, bool)

Returns yaml with the two Bedrock ports set, leaving everything else — comments included — exactly as it was.

public static string SetBedrockPorts(string yaml, int bedrockPort, int? broadcastPort, bool floodgate = true)

Parameters

yaml string

The current contents of config.yml.

bedrockPort int

The local UDP port Geyser should listen on.

broadcastPort int?

The port players connect to. Null removes the setting, for a server no longer behind a tunnel: leaving a stale one behind would advertise a port that stopped existing.

floodgate bool

Whether Floodgate is installed beside Geyser, which decides the authentication mode written into the java section: Bedrock players need "floodgate" there, and "online" turns every one of them away.

Returns

string

Remarks

Edited line by line rather than parsed and re-emitted. A YAML round-trip would drop every comment in the file, and in Geyser's config the comments are the documentation — the next person to open it by hand would find it stripped bare.

SetJavaAuth(string, bool, string?)

Sets the authentication Geyser uses towards the Java server, and where to find the key.

public static string SetJavaAuth(string yaml, bool floodgate, string? keyPath = null)

Parameters

yaml string

The current contents of config.yml.

floodgate bool

Whether Floodgate is installed beside Geyser.

keyPath string

Where Floodgate actually leaves its key, relative to Geyser's own config folder. Pointed at rather than copied: Floodgate can regenerate it, and a copy would go stale silently.

Returns

string

Remarks

Same line surgery as SetBedrockPorts(string, int, int?, bool), so the comments Geyser ships — which are its real documentation — survive being edited.

Supports(ServerType)

Whether crossplay can be offered at all for this kind of server.

public static bool Supports(ServerType type)

Parameters

type ServerType

Returns

bool