Ejemplo n.º 1
0
        private static bool Interact(WorkstationController __instance, ReferenceHub ply, byte colliderId)
        {
            try
            {
                if (colliderId != __instance._activateCollder?.ColliderId || __instance.Status != 0)
                {
                    return(false);
                }

                if (ply == null)
                {
                    return(false);
                }

                var player  = ply.GetPlayer();
                var station = __instance.GetWorkStation();

                if (station != null)
                {
                    station.KnownUser = player;
                }

                Event.Get.Player.InvokePlayerStartWorkstation(player, station, out var allow);

                return(allow);
            }
            catch (Exception e)
            {
                Logger.Get.Error($"Synapse-Item: Connect Workstation Tablet failed!!\n{e}");
                return(false);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DeactivatingWorkstationEventArgs"/> class.
 /// </summary>
 /// <param name="controller"><inheritdoc cref="WorkstationController"/></param>
 /// <param name="isAllowed"><inheritdoc cref="IsAllowed"/></param>
 public DeactivatingWorkstationEventArgs(WorkstationController controller, bool isAllowed = true)
 {
     WorkstationController = controller;
     IsAllowed             = isAllowed;
 }
Ejemplo n.º 3
0
 internal WorkStation(WorkstationController station) => workStation = station;
 /// <summary>
 /// Initializes a new instance of the <see cref="ActivatingWorkstationEventArgs"/> class.
 /// </summary>
 /// <param name="player"><inheritdoc cref="Player"/></param>
 /// <param name="controller"><inheritdoc cref="WorkstationController"/></param>
 /// <param name="isAllowed"><inheritdoc cref="IsAllowed"/></param>
 public ActivatingWorkstationEventArgs(Player player, WorkstationController controller, bool isAllowed = true)
 {
     Player = player;
     WorkstationController = controller;
     IsAllowed             = isAllowed;
 }
Ejemplo n.º 5
0
 public static WorkStation GetWorkStation(this WorkstationController station) => Map.Get.WorkStations.FirstOrDefault(x => x.GameObject == station.gameObject);