mojira.dev

B_Craft

Assigned

No issues.

Comments

Additional findings and confirmed workaround

Packet captures show that Bedrock clients send a 33-byte RakNet Unconnected Ping broadcast to UDP port 19132. The packet reaches the Linux server, but Bedrock Dedicated Server 1.26.51.1 does not respond and does not listen on UDP 19132 while idle.

The server does listen on TCP 19132 for NetherNet and on UDP 7551. Direct connections by IP address work normally.

As a test, I ran a small UDP responder on port 19132. It replies to the client with a RakNet Unconnected Pong containing the server information.

This workaround has the following confirmed results:

  • The dedicated server immediately appears in the LAN worlds list on PlayStation 4.

  • The iPhone processes the response and updates the displayed name of a manually added server.

  • Without the responder, the PlayStation 4 does not display the server.

  • The responder only provides LAN discovery; it does not proxy or handle the actual game connection.

Minimal proof-of-concept:

#!/usr/bin/env python3

import secrets
import socket
import struct

MAGIC = bytes.fromhex(
    "00ffff00fefefefefdfdfdfd12345678"
)

SERVER_GUID = secrets.randbits(63)

motd = (
    f"MCPE;"
    f"Test Server;"       # Server name
    f"2193;"              # Protocol version for 1.26.51
    f"1.26.51;"           # Game version
    f"0;"                 # Current players
    f"10;"                # Maximum players
    f"{SERVER_GUID};"
    f"Test World;"        # Level name
    f"Survival;"
    f"1;"
    f"19132;"
    f"19133;"
).encode("utf-8")

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(("0.0.0.0", 19132))

while True:
    data, client = sock.recvfrom(2048)

    # RakNet Unconnected Ping
    if len(data) < 33 or data[0] not in (0x01, 0x02):
        continue

    if data[9:25] != MAGIC:
        continue

    response = (
        b"\x1c"                           # Unconnected Pong
        + data[1:9]                       # Original timestamp
        + struct.pack(">Q", SERVER_GUID)
        + MAGIC
        + struct.pack(">H", len(motd))
        + motd
    )

    sock.sendto(response, client)

This strongly suggests that LAN discovery is failing because the dedicated server no longer responds to the legacy RakNet discovery broadcasts sent by the clients. Sending the expected response is sufficient for the PlayStation 4 to display the server again.