FastTransfer
FastTransfer copied to clipboard
Removed redundant &0xFF
According to a local test in PHP 5.6.3, chr(256) returns a null byte. This shows that chr() used in DataPacket.php returns the integer representation of the least significant byte only, so & 0xFF
is not necessary.
What if they send an invalid IP ^.^
Can't you do a ping test to check if the server is online? If not return a message like "Invalid server/ip. Is the server offline?"
@Subtleoliver What about servers that still accept players even when they are full?
@PEMapModder There is some variable to check if a player can join(Server is full etc.). I assume there isn't a playerCanConnect Handler for plugin developers. Make them able to change the "canPlayerJoin" thingy. So for example if a player has the (example) JoinWhenFull.join permission they can join. I assume that something like that is already used. call that if it's a valid server. If it returns true send the player.
You can't execute a function or check permission for an offline player from remote :/
@PEMapModder Well. Then just send em over if it's a server. Ping it and then if you get a valid response send the player no matter if the server is full.
@Subtleoliver this is not the place to discuss it.
Anyway, note that there might be latency between the CanSpawn response and actually sending the StrangePacket to the client. It may range from 0.1 second to seconds. In this period, everything can happen, from a simple player join to the sky falling onto your head.