Ejemplo n.º 1
0
        public void BroadcastVehicleDocking(VehicleDockingBay dockingBay, Vehicle vehicle)
        {
            NitroxId dockId;

            if (dockingBay.GetSubRoot() is BaseRoot)
            {
                dockId = NitroxEntity.GetId(dockingBay.GetComponentInParent <BaseRoot>().gameObject);
            }
            else if (dockingBay.GetSubRoot() is SubRoot)
            {
                dockId = NitroxEntity.GetId(dockingBay.GetSubRoot().gameObject);
            }
            else
            {
                dockId = NitroxEntity.GetId(dockingBay.GetComponentInParent <ConstructableBase>().gameObject);
            }

            NitroxId vehicleId = NitroxEntity.GetId(vehicle.gameObject);
            ushort   playerId  = multiplayerSession.Reservation.PlayerId;

            VehicleDocking packet = new VehicleDocking(vehicleId, dockId, playerId);

            packetSender.Send(packet);

            PacketSuppressor <Movement> movementSuppressor = packetSender.Suppress <Movement>();

            vehicle.StartCoroutine(AllowMovementPacketsAfterDockingAnimation(movementSuppressor));
        }
Ejemplo n.º 2
0
        public void BroadcastVehicleDocking(VehicleDockingBay dockingBay, Vehicle vehicle)
        {
            string dockGuid    = GuidHelper.GetGuid(dockingBay.gameObject);
            string vehicleGuid = GuidHelper.GetGuid(vehicle.gameObject);
            ushort playerId    = multiplayerSession.Reservation.PlayerId;

            VehicleDocking packet = new VehicleDocking(vehicleGuid, dockGuid, playerId);

            packetSender.Send(packet);

            PacketSuppressor <Movement> movementSuppressor = packetSender.Suppress <Movement>();

            vehicle.StartCoroutine(AllowMovementPacketsAfterDockingAnimation(movementSuppressor));
        }
Ejemplo n.º 3
0
        public void BroadcastVehicleDocking(VehicleDockingBay dockingBay, Vehicle vehicle)
        {
            NitroxId dockId = NitroxEntity.GetId(dockingBay.gameObject);


            NitroxId vehicleId = NitroxEntity.GetId(vehicle.gameObject);
            ushort   playerId  = multiplayerSession.Reservation.PlayerId;

            VehicleDocking packet = new VehicleDocking(vehicleId, dockId, playerId);

            packetSender.Send(packet);

            PacketSuppressor <Movement>        movementSuppressor        = packetSender.Suppress <Movement>();
            PacketSuppressor <VehicleMovement> vehicleMovementSuppressor = packetSender.Suppress <VehicleMovement>();

            vehicle.StartCoroutine(AllowMovementPacketsAfterDockingAnimation(movementSuppressor, vehicleMovementSuppressor));
        }
Ejemplo n.º 4
0
        public void BroadcastVehicleDocking(VehicleDockingBay dockingBay, Vehicle vehicle)
        {
            string dockGuid = string.Empty;

            if (dockingBay.GetSubRoot() is BaseRoot)
            {
                dockGuid = GuidHelper.GetGuid(dockingBay.GetComponentInParent <BaseRoot>().gameObject);
            }
            else
            {
                dockGuid = GuidHelper.GetGuid(dockingBay.GetComponentInParent <ConstructableBase>().gameObject);
            }

            string vehicleGuid = GuidHelper.GetGuid(vehicle.gameObject);
            ushort playerId    = multiplayerSession.Reservation.PlayerId;

            VehicleDocking packet = new VehicleDocking(vehicleGuid, dockGuid, playerId);

            packetSender.Send(packet);

            PacketSuppressor <Movement> movementSuppressor = packetSender.Suppress <Movement>();

            vehicle.StartCoroutine(AllowMovementPacketsAfterDockingAnimation(movementSuppressor));
        }