Class MySessionComponentSafeZones
  
  
  
  
    Inheritance
    System.Object
    
    MySessionComponentSafeZones
   
  
  
  Assembly: Sandbox.Game.dll
  Syntax
  
    [StaticEventOwner]
[MySessionComponentDescriptor]
public class MySessionComponentSafeZones : MySessionComponentBase, IMyUserInputComponent
   
  Constructors
  
  
  
  
  MySessionComponentSafeZones()
  
  
  Declaration
  
    public MySessionComponentSafeZones()
   
  Fields
  
  
  
  AllowedActions
  
  
  Declaration
  
    public static MySafeZoneAction AllowedActions
   
  Field Value
  
    
      
        | Type | Description | 
    
    
      
        | VRage.Game.ObjectBuilders.Components.MySafeZoneAction |  | 
    
  
  Properties
  
  
  
  
  IsRequiredByGame
  
  
  Declaration
  
    public override bool IsRequiredByGame { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  Overrides
  
  
  
  
  SafeZones
  
  
  Declaration
  
    public static ListReader<MySafeZone> SafeZones { get; }
   
  Property Value
  
  Methods
  
  
  
  
  AddSafeZone(MySafeZone)
  
  
  Declaration
  
    public static void AddSafeZone(MySafeZone safeZone)
   
  Parameters
  
  
  
  
  
  
  
  Declaration
  
    public static bool CanPerformAction(MySafeZoneAction action, ulong user = 0UL)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | VRage.Game.ObjectBuilders.Components.MySafeZoneAction | action |  | 
      
        | System.UInt64 | user |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  CrateSafeZone(MatrixD, MySafeZoneShape, MySafeZoneAccess, Int64[], Int64[], Single, Boolean, Boolean, Vector3, String, Int64, String)
  
  
  Declaration
  
    public static MyEntity CrateSafeZone(MatrixD transform, MySafeZoneShape safeZoneShape, MySafeZoneAccess zoneAccess, long[] players, long[] factions, float startRadius, bool enable, bool isVisible = true, Vector3 color = null, string visualTexture = "", long safeZoneBlockId = 0L, string name = null)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | MatrixD | transform |  | 
      
        | MySafeZoneShape | safeZoneShape |  | 
      
        | MySafeZoneAccess | zoneAccess |  | 
      
        | System.Int64[] | players |  | 
      
        | System.Int64[] | factions |  | 
      
        | System.Single | startRadius |  | 
      
        | System.Boolean | enable |  | 
      
        | System.Boolean | isVisible |  | 
      
        | Vector3 | color |  | 
      
        | System.String | visualTexture |  | 
      
        | System.Int64 | safeZoneBlockId |  | 
      
        | System.String | name |  | 
    
  
  Returns
  
  
  
  
  CreateSafeZone_Implementation(Vector3D)
  
  
  Declaration
  
    [Event(null, 325)]
[Reliable]
[Server]
public static void CreateSafeZone_Implementation(Vector3D position)
   
  Parameters
  
  
  
  
  CreateSafeZone_ImplementationPlayer(Int64, Single, Boolean, UInt64)
  
  
  Declaration
  
    public static long CreateSafeZone_ImplementationPlayer(long safeZoneBlockId, float startRadius, bool activate, ulong playerSteamId)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int64 | safeZoneBlockId |  | 
      
        | System.Single | startRadius |  | 
      
        | System.Boolean | activate |  | 
      
        | System.UInt64 | playerSteamId |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Int64 |  | 
    
  
  
  
  
  DeleteSafeZone_Implementation(Int64)
  
  
  Declaration
  
    [Event(null, 483)]
[Reliable]
[Server]
public static void DeleteSafeZone_Implementation(long entityId)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int64 | entityId |  | 
    
  
  
  
  
  DeleteSafeZone_ImplementationPlayer(Int64, Int64, UInt64)
  
  
  Declaration
  
    public static void DeleteSafeZone_ImplementationPlayer(long safeZoneBlockId, long safeZoneId, ulong steamId)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int64 | safeZoneBlockId |  | 
      
        | System.Int64 | safeZoneId |  | 
      
        | System.UInt64 | steamId |  | 
    
  
  
  
  
  GetBelongingSafezones(Int64, ICollection<MySafeZone>)
  
  
  Declaration
  
    public static void GetBelongingSafezones(long entity, ICollection<MySafeZone> where)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int64 | entity |  | 
      
        | System.Collections.Generic.ICollection<MySafeZone> | where |  | 
    
  
  
  
  
  GetObjectBuilder()
  
  
  Declaration
  
    public override MyObjectBuilder_SessionComponent GetObjectBuilder()
   
  Returns
  
  Overrides
  
  
  
  
  GetSafeZonesInAABB(BoundingBoxD, List<MySafeZone>)
  
  
  Declaration
  
    public static List<MySafeZone> GetSafeZonesInAABB(BoundingBoxD worldAabb, List<MySafeZone> buffer = null)
   
  Parameters
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Collections.Generic.List<MySafeZone> |  | 
    
  
  
  
  
  Init(MyObjectBuilder_SessionComponent)
  
  
  Declaration
  
    public override void Init(MyObjectBuilder_SessionComponent sessionComponent)
   
  Parameters
  
  Overrides
  
  
  
  
  IsActionAllowed(MyCubeGrid, Vector3I, Vector3I, MySafeZoneAction, Int64)
  
  
  Declaration
  
    public static bool IsActionAllowed(MyCubeGrid grid, Vector3I cubeMin, Vector3I cubeMax, MySafeZoneAction AllowedActions, long attackerId)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | MyCubeGrid | grid |  | 
      
        | Vector3I | cubeMin |  | 
      
        | Vector3I | cubeMax |  | 
      
        | VRage.Game.ObjectBuilders.Components.MySafeZoneAction | AllowedActions |  | 
      
        | System.Int64 | attackerId |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IsActionAllowed(MyEntity, MySafeZoneAction, Int64, UInt64)
  Checks if action is allowed.
Declaration
  
    public static bool IsActionAllowed(MyEntity entity, MySafeZoneAction action, long sourceEntityId = 0L, ulong user = 0UL)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | MyEntity | entity | Entity that would have applied action | 
      
        | VRage.Game.ObjectBuilders.Components.MySafeZoneAction | action | What king of action | 
      
        | System.Int64 | sourceEntityId | Who is performing action | 
      
        | System.UInt64 | user | What player triggered action | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IsActionAllowed(BoundingBoxD, MySafeZoneAction, Int64, UInt64)
  
  
  Declaration
  
    public static bool IsActionAllowed(BoundingBoxD aabb, MySafeZoneAction action, long sourceEntityId = 0L, ulong user = 0UL)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | BoundingBoxD | aabb |  | 
      
        | VRage.Game.ObjectBuilders.Components.MySafeZoneAction | action |  | 
      
        | System.Int64 | sourceEntityId |  | 
      
        | System.UInt64 | user |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IsActionAllowed(BoundingSphere, MySafeZoneAction, Int64, UInt64)
  
  
  Declaration
  
    public static bool IsActionAllowed(BoundingSphere boundingSphere, MySafeZoneAction action, long sourceEntityId = 0L, ulong user = 0UL)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | BoundingSphere | boundingSphere |  | 
      
        | VRage.Game.ObjectBuilders.Components.MySafeZoneAction | action |  | 
      
        | System.Int64 | sourceEntityId |  | 
      
        | System.UInt64 | user |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IsActionAllowed(Vector3D, MySafeZoneAction, Int64, UInt64)
  
  
  Declaration
  
    public static bool IsActionAllowed(Vector3D point, MySafeZoneAction action, long sourceEntityId = 0L, ulong user = 0UL)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | Vector3D | point |  | 
      
        | VRage.Game.ObjectBuilders.Components.MySafeZoneAction | action |  | 
      
        | System.Int64 | sourceEntityId |  | 
      
        | System.UInt64 | user |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IsActionAllowedFullyInside(MyCubeGrid, MySafeZoneAction, Int64)
  
  
  Declaration
  
    public static bool IsActionAllowedFullyInside(MyCubeGrid grid, MySafeZoneAction AllowedActions, long sourceEntityId)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | MyCubeGrid | grid |  | 
      
        | VRage.Game.ObjectBuilders.Components.MySafeZoneAction | AllowedActions |  | 
      
        | System.Int64 | sourceEntityId |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IsInSafezone(Int64, MySafeZone)
  
  
  Declaration
  
    public static bool IsInSafezone(long entityId, MySafeZone safeZone)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int64 | entityId |  | 
      
        | MySafeZone | safeZone |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IsInSafezone(Int64, List<MySafeZone>)
  
  
  Declaration
  
    public static bool IsInSafezone(long entityId, List<MySafeZone> safeZones)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int64 | entityId |  | 
      
        | System.Collections.Generic.List<MySafeZone> | safeZones |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IsPlayerValid(UInt64, Int64, out MyIdentity, out MyCubeBlock)
  Validates player and beacon associated with beacon id.
Declaration
  
    public static bool IsPlayerValid(ulong steamId, long safeZoneBlockId, out MyIdentity playerIdentity, out MyCubeBlock beaconBlock)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.UInt64 | steamId | Player id | 
      
        | System.Int64 | safeZoneBlockId | Beacon entity id to check aginst | 
      
        | Sandbox.Game.World.MyIdentity | playerIdentity | Returns player identity id | 
      
        | MyCubeBlock | beaconBlock | Returns block | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IsRecentlyAddedOrRemoved(MyEntity)
  
  
  Declaration
  
    public static bool IsRecentlyAddedOrRemoved(MyEntity obj)
   
  Parameters
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IsSafeZoneColliding(Int64, MatrixD, MySafeZoneShape, Single, Vector3)
  
  
  Declaration
  
    public static bool IsSafeZoneColliding(long safeZoneId, MatrixD safeZoneWorld, MySafeZoneShape shape, float newRadius = 0F, Vector3 newSize = null)
   
  Parameters
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  LoadData()
  
  
  Declaration
  
    public override void LoadData()
   
  Overrides
  
  
  
  
  RemoveSafeZone(MySafeZone)
  
  
  Declaration
  
    public static void RemoveSafeZone(MySafeZone safeZone)
   
  Parameters
  
  
  
  
  RequestCreateSafeZone(Vector3D)
  
  
  Declaration
  
    public static void RequestCreateSafeZone(Vector3D position)
   
  Parameters
  
  
  
  
  RequestDeleteSafeZone(Int64)
  
  
  Declaration
  
    public static void RequestDeleteSafeZone(long entityId)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int64 | entityId |  | 
    
  
  
  
  
  RequestUpdateGlobalSafeZone()
  
  
  Declaration
  
    public static void RequestUpdateGlobalSafeZone()
   
  
  
  
  RequestUpdateSafeZone(MyObjectBuilder_SafeZone)
  
  
  Declaration
  
    public static void RequestUpdateSafeZone(MyObjectBuilder_SafeZone ob)
   
  Parameters
  
  
  
  
  RequestUpdateSafeZone_Player(Int64, MyObjectBuilder_SafeZone)
  Updates safe zone of a beacon with new settings set inside of the object builder
Declaration
  
    public static void RequestUpdateSafeZone_Player(long safeZoneBlockId, MyObjectBuilder_SafeZone ob)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int64 | safeZoneBlockId | Beacon for which to update safe zone | 
      
        | MyObjectBuilder_SafeZone | ob | Object builder containing new safe zone settings. | 
    
  
  
  
  
  RequestUpdateSafeZonePlayer(Int64, MyObjectBuilder_SafeZone)
  
  
  Declaration
  
    public static void RequestUpdateSafeZonePlayer(long safeZoneBlockId, MyObjectBuilder_SafeZone ob)
   
  Parameters
  
  
  
  
  RequestUpdateSafeZoneRadius_Player(Int64, Int64, Single)
  
  
  Declaration
  
    public static void RequestUpdateSafeZoneRadius_Player(long safezoneBlockId, long safezoneId, float newRadius)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int64 | safezoneBlockId |  | 
      
        | System.Int64 | safezoneId |  | 
      
        | System.Single | newRadius |  | 
    
  
  
  
  
  UnloadData()
  
  
  Declaration
  
    protected override void UnloadData()
   
  Overrides
  
  
  
  
  UpdateAfterSimulation()
  
  
  Declaration
  
    public override void UpdateAfterSimulation()
   
  Overrides
  
  
  
  
  UpdateGlobalSafeZone_Implementation(MySafeZoneAction)
  
  
  Declaration
  
    [Event(null, 732)]
[Reliable]
[Server]
[Broadcast]
public static void UpdateGlobalSafeZone_Implementation(MySafeZoneAction allowedActions)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | VRage.Game.ObjectBuilders.Components.MySafeZoneAction | allowedActions |  | 
    
  
  
  
  
  UpdateSafeZone(MyObjectBuilder_SafeZone, Boolean)
  Updates save zone with data from object builder. Use only on server
Declaration
  
    public static void UpdateSafeZone(MyObjectBuilder_SafeZone ob, bool sync = false)
   
  Parameters
  
  
  
  
  UpdateSafeZone_Implementation(MyObjectBuilder_SafeZone)
  
  
  Declaration
  
    [Event(null, 527)]
[Reliable]
[Server]
[Broadcast]
public static void UpdateSafeZone_Implementation(MyObjectBuilder_SafeZone ob)
   
  Parameters
  
  
  
  
  UpdateSafeZone_ImplementationPlayer(Int64, MyObjectBuilder_SafeZone)
  
  
  Declaration
  
    [Event(null, 588)]
[Reliable]
[Server]
[Broadcast]
public static void UpdateSafeZone_ImplementationPlayer(long safezoneBlockId, MyObjectBuilder_SafeZone ob)
   
  Parameters
  
  
  
  
  UpdateSafeZonePlayer_Implementation(Int64, MyObjectBuilder_SafeZone)
  
  
  Declaration
  
    [Event(null, 534)]
[Reliable]
[Server]
[Broadcast]
public static void UpdateSafeZonePlayer_Implementation(long safeZoneBlockId, MyObjectBuilder_SafeZone ob)
   
  Parameters
  
  
  
  
  UpdateSafeZoneRadius_ImplementationPlayer(Int64, Int64, Single)
  
  
  Declaration
  
    [Event(null, 621)]
[Reliable]
[Server]
[Broadcast]
public static void UpdateSafeZoneRadius_ImplementationPlayer(long safezoneBlockId, long safezoneId, float radius)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int64 | safezoneBlockId |  | 
      
        | System.Int64 | safezoneId |  | 
      
        | System.Single | radius |  | 
    
  
  Events
  
  
  
  OnAddSafeZone
  
  
  Declaration
  
    public static event EventHandler OnAddSafeZone
   
  Event Type
  
    
      
        | Type | Description | 
    
    
      
        | System.EventHandler |  | 
    
  
  
  
  OnRemoveSafeZone
  
  
  Declaration
  
    public static event EventHandler OnRemoveSafeZone
   
  Event Type
  
    
      
        | Type | Description | 
    
    
      
        | System.EventHandler |  | 
    
  
  
  
  OnSafeZoneUpdated
  
  
  Declaration
  
    public static event Action<MySafeZone> OnSafeZoneUpdated
   
  Event Type