Пример #1
0
        public static void notifyTeleport(Unit u, float _x, float _y)
        {
            // Can't teleport to this point of the map
            if (!map.isWalkable(_x, _y))
            {
                _x = MovementVector.targetXToNormalFormat(u.getPosition().X);
                _y = MovementVector.targetYToNormalFormat(u.getPosition().Y);
            }
            else
            {
                u.setPosition(_x, _y);

                //TeleportRequest first(u.getNetId(), u.teleportToX, u.teleportToY, true);
                //sendPacket(currentPeer, first, Channel.CHL_S2C);

                _x = MovementVector.targetXToNormalFormat(_x);
                _y = MovementVector.targetYToNormalFormat(_y);
            }

            var second = new TeleportRequest(u.getNetId(), _x, _y, false);
            PacketHandlerManager.getInstace().broadcastPacketVision(u, second, Channel.CHL_S2C);
        }