Server-Side Behavior and Level Links
This document explains how the GServer serverside setting affects level link handling and client-server interactions.
The serverside Setting
The serverside option in serveroptions.txt controls whether the server automatically handles certain game mechanics:
# Determines whether the server handles certain things like signs and links.
# Don't set to true.
serverside = false
Default Value: true (despite the comment suggesting otherwise)
How It Affects Level Links
When serverside = true (Default)
Server automatically handles level link collisions
When a player walks into a level link area, the server warps them
Server does NOT send PLO_LEVELLINK packets to clients
Server does NOT send sign data to clients
When serverside = false
Server sends PLO_LEVELLINK packets to clients when entering levels
Server sends sign data to clients
Client must detect when player touches a level link
Client must send PLI_LEVELWARP to request the warp
Server respects
warptoforallsetting for warp permissions
Client Implementation Requirements
When connecting to a server with serverside = false, clients must:
Parse PLO_LEVELLINK packets to track level links
Sent immediately after PLO_BOARDPACKET when entering a level
Contains ALL links as a single newline-terminated string
Format: “destlevel x y width height destx desty” (space-separated)
Coordinates are in tiles (0-63), not pixels
Monitor player position to detect link collisions
Send PLI_LEVELWARP when player touches a link
Handle special destination values:
"playerx"or-1for X: Keep player’s current X position"playery"or-1for Y: Keep player’s current Y position
GMAP Considerations
When implementing level links in GMAP mode:
Edge links between GMAP segments should typically be ignored (automatic GMAP transitions handle these)
Indoor/dungeon links should be honored (transition to single-level mode)
Client should track whether current level is part of the GMAP to make this distinction
GServer Source Code References
From PlayerClient.cpp:
// Send links, signs, and mod time.
if (!settings.getBool("serverside", false)) // TODO: NPC server check instead.
{
pLevel->sendLinksToPlayer(shared_from_this());
pLevel->sendSignsToPlayer(shared_from_this());
}
From LevelLink.cpp (handling special values):
if (m_destinationX == "-1")
{
m_constantX = true;
m_destinationX = "playerx";
}
PyReborn Implementation
PyReborn correctly handles this by:
Checking
_check_level_links()on every movementLogging when a link is touched
Currently waiting for server to handle (needs client-side warp implementation)
Recommendations
Servers should generally keep
serverside = trueunless they have custom level link handlingClients should support both modes for maximum compatibility
The comment “Don’t set to true” in serveroptions.txt appears to be incorrect