Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Out of bounds teleportation

Newbie Spellweaver
Joined
Sep 3, 2016
Messages
7
Reaction score
0
I always thought this would be client sided, but I guess not.
In GMS when you fall out of a map you're always teleported to one of the spawn points.
This does not seem to be the case for me using MapleSolaxia V83 source.
Is there any way I could add this into the source?
Example of falling out of the map & teleporting:

Cheers.
 
Joined
Apr 10, 2008
Messages
4,087
Reaction score
1,264
Yes, this is quite easy actually. When the player movement packet is received and parsed, you have to check if there are footholds beneath the player. If it happens over 3 times or so, the player has fallen out of the map aka has no footholds beaneath them.

You can take a look at Vana's implementation of this .

Perhaps Eric can shed some light about how it's actually done server-side in GMS.
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
You sure this isn't client-sided? I have no movement foothold checks like Vana does because the client when falling under that foothold and off-bounds should send a TransferFieldRequest packet. Nexon has checks in the handler that as long as a packet is sent, regardless of any valid portal or anything, that if the target location doesn't exist or any position is invalid, that it ends up generating a random spawnpoint portal within the map and moves the player to that location instead.

They do it like so:
PHP:
if (sPortal == null || sPortal.isEmpty() || (pPortal = pField.GetPortalMap().FindPortal(sPortal)) == null) {
	if (ptPos.x == 0 && ptPos.y == 0)
		pPortal = pField.GetPortalMap().GetRandStartPoint();
	else
		pPortal = pField.GetPortalMap().FindCloseStartPoint(ptPos.x, ptPos.y);
}
ptPos.x = pPortal.ptPos.x;
ptPos.y = pPortal.ptPos.y;

In Odin, I don't think the TransferField (ChangeMap) handlers are as nearly in-depth as Nexon's and probably do nothing if the target's location and/or portal doesn't exist (tbh knowing Odin they probably just do enableActions() on null portals). If that's so, then that explains why nothing happens. Try it out, either log packets or put a debug statement inside of your ChangeMap handler and see if it prints when you fall under. If it does, then it definitely triggers it and you just have to handle it there to rewarp you.
 
Upvote 0
Back
Top