server
server copied to clipboard
🐛 Clients Can Enter Invalid/Offline Zones
I affirm:
- [x] I understand that if I do not agree to the following points by completing the checkboxes my issue will be ignored.
- [x] I have read and understood the Contributing Guide and the Code of Conduct.
- [x] I have searched existing issues to see if the issue has already been opened, and I have checked the commit log to see if the issue has been resolved since my server was last updated.
OS / platform the server is running (if known)
Windows 11 Pro 22H2
Branch affected by issue
base
Steps to reproduce
- Clone, install, compile and configure LandSandBoat.
- Initialize a blank new database.
- Inside of
zone_settings
, set all zones'zoneport
to 0 except: Southern San d'Oria, Northern San d'Oria, and Port San d'Oria - Start the server.
- Create a character, select San d'Oria as the home nation.
- Move the character to Southern San d'Oria.
- Attempt to zone the character into East Ronfaure.
The character will R0 into a black screen because the server does not block the player from entering invalid zones.
Expected behavior
The server should block the zone attempt due to the zone being invalid, offline, etc.
Further Discussions
On retail, there is a special message that will be sent to the player when trying to enter an invalid zone. This can happen for a number of reasons such as:
- The zone is down for maintenance.
- The zone crashed.
- The player is cheating and attempted to zone too fast.
When this happens, the server rejects the players zone attempt, kicks them back to the zoneline they tried to enter from and sends a message that says:
You could not enter the next area.
In a similar situation, when the player attempts to zone into an area that is part of an expansion, if they do not have the expansion installed, or if they have it installed but have not purchased the proper access to said expansion, the same rejection will happen but a different message will be sent to the player that says either:
-
Unable to enter next area. Expansion pack not registered.
-
Unable to enter next area. Expansion pack not installed.
These messages are all built into the client DAT information already.
This issue happens due to how SmallPacket0x05E
is currently coded:
https://github.com/LandSandBoat/server/blob/f316e6c2e6134b7d3ca0dbdd705d307ba9181f57/src/map/packet_system.cpp#L3812
While there is the start of blocking certain kinds of zone attempts, it is still possible to allow the player to try and enter invalid zones. Due to the various changes to how LSB loads zones at the start of the server, setting the zones zoneport
to 0 is enough for LSB to consider it 'offline' / 'disabled'. However, the code here does not reflect that change.
The line:
zoneLine_t* PZoneLine = PChar->loc.zone->GetZoneLine(zoneLineID);
Will succeed as the zoneline is valid, however, following that:
CZone* PDestination = zoneutils::GetZone(PZoneLine->m_toZone);
Will return null. This is expected, but the checks that follow after do not properly check if this is null and handle it accordingly.
Updating this issue was forgotten when the change came in the repository, but 1 of the 3 messages was implemented, and being used in some cases meant for the other 2.
This screenshot was taken after I wiped the zone IP and tried to zone a freshly created character.