コード例 #1
0
 public override void OnDespawnServer(DespawnInfo info)
 {
     base.OnDespawnServer(info);
     dirSprites.SetToBodyLayer();
     alienScreechPlayed      = false;
     registerObject.Passable = true;
 }
コード例 #2
0
 public void OnDespawnServer(DespawnInfo info)
 {
     if (ItemStorage != null)
     {
         RemoveSelf(ItemStorage);
     }
 }
コード例 #3
0
 /// <summary>
 /// cleaning up for reuse
 /// </summary>
 public void OnDespawnServer(DespawnInfo info)
 {
     centComm.OnStatusDisplayUpdate.RemoveListener(OnTextBroadcastReceived);
     channel        = StatusDisplayChannel.Command;
     textField.text = string.Empty;
     this.TryStopCoroutine(ref blinkHandle);
 }
コード例 #4
0
 public void OnDespawnServer(DespawnInfo info)
 {
     if (virtualContainer != null)
     {
         Despawn.ServerSingle(virtualContainer.gameObject);
     }
 }
コード例 #5
0
 public override void OnDespawnServer(DespawnInfo info)
 {
     base.OnDespawnServer(info);
     mobSprite.SetToBodyLayer();
     deathSoundPlayed        = false;
     registerObject.Passable = true;
 }
コード例 #6
0
 public void OnDespawnServer(DespawnInfo info)
 {
     foreach (DisposalVirtualContainer container in receivedContainers)
     {
         Despawn.ServerSingle(container.gameObject);
     }
 }
コード例 #7
0
ファイル: APC.cs プロジェクト: Jibbajabbafic/unitystation
 public void OnDespawnServer(DespawnInfo info)
 {
     for (int i = ConnectedDevices.Count - 1; i >= 0; i--)
     {
         ConnectedDevices[i].RemoveFromAPC();
     }
 }
コード例 #8
0
ファイル: RegisterTile.cs プロジェクト: fomalsd/unitystation
    public virtual void OnDespawnServer(DespawnInfo info)
    {
        //cancel all relationships
        if (sameMatrixRelationships != null)
        {
            for (int i = sameMatrixRelationships.Count - 1; i >= 0; i--)
            {
                var relationship = sameMatrixRelationships[i];
                Logger.LogTraceFormat("Cancelling spatial relationship {0} because {1} is despawning.",
                                      Category.SpatialRelationship, relationship, this);
                SpatialRelationship.ServerEnd(relationship);
            }
        }

        if (crossMatrixRelationships != null)
        {
            for (int i = crossMatrixRelationships.Count - 1; i >= 0; i--)
            {
                var relationship = crossMatrixRelationships[i];
                Logger.LogTraceFormat("Cancelling spatial relationship {0} because {1} is despawning.",
                                      Category.SpatialRelationship, relationship, this);
                SpatialRelationship.ServerEnd(relationship);
            }
        }

        OnDespawnedServer.Invoke();
    }
コード例 #9
0
 public void OnDespawnServer(DespawnInfo info)
 {
     if (Controller == null)
     {
         return;
     }
     Controller.RemoveSlave(device);
 }
コード例 #10
0
ファイル: Artifact.cs プロジェクト: unitystation/unitystation
 public void OnDespawnServer(DespawnInfo info)
 {
     // remove it from global artifacts registry
     if (ServerSpawnedArtifacts.Contains(this))
     {
         ServerSpawnedArtifacts.Remove(this);
     }
 }
コード例 #11
0
ファイル: Drawer.cs プロジェクト: spacerecycler/unitystation
	/// <summary>
	/// If the object is about to despawn, eject its contents (unless already open)
	/// so they are not stranded at HiddenPos.
	/// </summary>
	/// <param name="despawnInfo"></param>
	public void OnDespawnServer(DespawnInfo despawnInfo)
	{
		if (drawerState == DrawerState.Open) return;

		EjectItems(true);
		EjectPlayers(true);
		Despawn.ServerSingle(tray);
	}
コード例 #12
0
 public void OnDespawnServer(DespawnInfo info)
 {
     PanelInputCurrentPorts.Clear();
     PanelOutputCurrentPorts.Clear();
     DictionaryCurrentPorts.Clear();
     Connections.Clear();
     Cables.Clear();
 }
コード例 #13
0
 public void OnDespawnServer(DespawnInfo info)
 {
     // Set grenade to locked state by default
     UpdateSprite(LOCKED_SPRITE);
     // Reset grenade timer
     timerRunning = false;
     hasExploded  = false;
 }
コード例 #14
0
        public void OnDespawnServer(DespawnInfo info)
        {
            UpdateManager.Remove(CallbackType.PERIODIC_UPDATE, ServerPeriodicUpdate);

            mobAi.health.applyDamageEvent -= OnDamageReceived;
            mobAi.PettedEvent             -= OnPetted;
            mobExplore.FoodEatenEvent     -= OnFoodEaten;
        }
コード例 #15
0
ファイル: Pickupable.cs プロジェクト: ynot01/unitystation
 public void OnDespawnServer(DespawnInfo info)
 {
     //remove ourselves from inventory if we aren't already removed
     if (itemSlot != null)
     {
         Inventory.ServerDespawn(itemSlot);
     }
 }
コード例 #16
0
    /// <summary>
    /// Despawn the object server side and sync the despawn to all clients. Despawning removes an
    /// object from the game, but may not necessarilly destroy it completely - it may end up back in the
    /// object pool to be later reused.
    /// </summary>
    /// <param name="info"></param>
    /// <param name="skipInventoryDespawn">If the indicated object is in inventory, it will
    /// be despawned via the inventory API instead. Set this to true to bypass this. This is only
    /// intended to be set to true for particular internal use cases in the lifecycle system, so should
    /// almost always be left at the default</param>
    /// <returns></returns>
    private static DespawnResult Server(DespawnInfo info, bool skipInventoryDespawn = false)
    {
        if (info == null)
        {
            Logger.LogError("Cannot despawn - info is null", Category.ItemSpawn);
            return(DespawnResult.Fail(info));
        }

        if (!skipInventoryDespawn)
        {
            var pu = info.GameObject.GetComponent <Pickupable>();
            if (pu != null && pu.ItemSlot != null)
            {
                if (Inventory.ServerDespawn(pu.ItemSlot))
                {
                    return(DespawnResult.Single(info));
                }
                else
                {
                    return(DespawnResult.Fail(info));
                }
            }
        }

        //even if it has a pool prefab tracker, will still destroy it if it has no object behavior
        var poolPrefabTracker = info.GameObject.GetComponent <PoolPrefabTracker>();
        var transform         = info.GameObject.GetComponent <IPushable>();
        var Electrical        = info.GameObject.GetComponent <ElectricalOIinheritance>();

        if (Electrical != null)
        {
            if (!Electrical.InData.DestroyAuthorised)
            {
                Electrical.DestroyThisPlease();
                return(DespawnResult.Single(info));
            }
        }

        _ServerFireDespawnHooks(DespawnResult.Single(info));
        if (transform != null)
        {
            transform.VisibleState = false;
        }

        if (poolPrefabTracker != null)
        {
            //pooled
            Spawn._AddToPool(info.GameObject);
        }
        else
        {
            //not pooled
            NetworkServer.Destroy(info.GameObject);
        }


        return(DespawnResult.Single(info));
    }
コード例 #17
0
 public void OnDespawnServer(DespawnInfo info)
 {
     // make sure we despawn what we are holding
     foreach (var heldItem in serverHeldItems)
     {
         _ = Despawn.ServerSingle(heldItem.gameObject);
     }
     serverHeldItems.Clear();
 }
コード例 #18
0
 /// <summary>
 /// is the function to denote that it will be pooled or destroyed immediately after this function is finished, Used for cleaning up anything that needs to be cleaned up before this happens
 /// </summary>
 public void OnDespawnServer(DespawnInfo info)
 {
     if (!InData.DestroyQueueing || !InData.DestroyAuthorised)
     {
         Logger.Log("REEEEEEEEEEEEEE Wait your turn to destroy, Electrical thread is busy!!", Category.Electrical);
         DestroyThisPlease();
         var yy = InData.ConnectionReaction[PowerTypeCategory.Transformer];
     }
 }
コード例 #19
0
        /// <summary>
        /// If the drawer is about to despawn, despawn the tray too, so it is not stranded at HiddenPos.
        /// </summary>
        public void OnDespawnServer(DespawnInfo despawnInfo)
        {
            if (drawerState == DrawerState.Open)
            {
                return;
            }

            _ = Despawn.ServerSingle(tray);
        }
コード例 #20
0
 public void OnDespawnServer(DespawnInfo info)
 {
     //make sure we despawn what we are holding
     foreach (var heldItem in serverHeldItems)
     {
         Despawn.ServerSingle(heldItem.gameObject);
     }
     serverHeldItems = Enumerable.Empty <ObjectBehaviour>();
 }
コード例 #21
0
ファイル: Despawn.cs プロジェクト: ewy0/unitystation
    /// <summary>
    /// Despawn the object server side and sync the despawn to all clients. Should only be
    /// called on networked objects (i.e. ones which have NetworkIdentity component). Despawning removes an
    /// object from the game, but may not necessarilly destroy it completely - it may end up back in the
    /// object pool to be later reused.
    /// </summary>
    /// <param name="info"></param>
    /// <param name="skipInventoryDespawn">If the indicated object is in inventory, it will
    /// be despawned via the inventory API instead. Set this to true to bypass this. This is only
    /// intended to be set to true for particular internal use cases in the lifecycle system, so should
    /// almost always be left at the default</param>
    /// <returns></returns>
    private static async Task <DespawnResult> Server(DespawnInfo info, bool skipInventoryDespawn = false)
    {
        if (info == null)
        {
            Logger.LogError("Cannot despawn - info is null", Category.ItemSpawn);
            return(DespawnResult.Fail(info));
        }

        if (!skipInventoryDespawn)
        {
            var pu = info.GameObject.GetComponent <Pickupable>();
            if (pu != null && pu.ItemSlot != null)
            {
                if (Inventory.ServerDespawn(pu.ItemSlot))
                {
                    return(DespawnResult.Single(info));
                }
                else
                {
                    return(DespawnResult.Fail(info));
                }
            }
        }

        var Electrical = info.GameObject.GetComponent <ElectricalOIinheritance>();

        //TODO: What's the purpose of this?
        if (Electrical != null)
        {
            if (!Electrical.InData.DestroyAuthorised)
            {
                Electrical.DestroyThisPlease();
                return(DespawnResult.Single(info));
            }
        }

        _ServerFireDespawnHooks(DespawnResult.Single(info));

        var cnt = info.GameObject.GetComponent <CustomNetTransform>();

        if (cnt != null)
        {
            cnt.DisappearFromWorldServer();
        }

        await Task.Delay(10);

        if (Spawn._ObjectPool.TryDespawnToPool(info.GameObject, false))
        {
            return(DespawnResult.Single(info));
        }
        else
        {
            return(DespawnResult.Fail(info));
        }
    }
コード例 #22
0
ファイル: Integrity.cs プロジェクト: Ruzihm/unitystation
    public void OnDespawnServer(DespawnInfo info)
    {
        OnServerDespawnEvent?.Invoke();
        var cnt = GetComponent <CustomNetTransform>();

        if (cnt != null)
        {
            cnt.DisappearFromWorldServer();
        }
    }
コード例 #23
0
        public void OnDespawnServer(DespawnInfo info)
        {
            if (currentProduction != null)
            {
                StopCoroutine(currentProduction);
                currentProduction = null;
            }

            materialStorageLink.usedStorage.DropAllMaterials();
        }
コード例 #24
0
 public void UpDespawn(DespawnInfo info)
 {
     if (UpdateRequestDictionary.ContainsKey(ElectricalUpdateTypeCategory.GoingOffStage))
     {
         foreach (ElectricalModuleTypeCategory Module in UpdateRequestDictionary[ElectricalUpdateTypeCategory.GoingOffStage])
         {
             UpdateDelegateDictionary[Module].OnDespawnServer(info);
         }
     }
 }
コード例 #25
0
 public void OnDespawnServer(DespawnInfo info)
 {
     //if this is a player's inventory, make them no longer an observer of all slots
     if (GetComponent <PlayerScript>() != null)
     {
         ServerRemoveObserverPlayer(gameObject);
     }
     //reclaim the space in the slot pool.
     ItemSlot.Free(this);
 }
コード例 #26
0
 public void UpDespawn(DespawnInfo info)
 {
     if (UpdateRequestDictionary.TryGetValue(ElectricalUpdateTypeCategory.GoingOffStage, out HashSet <ElectricalModuleTypeCategory> updateRequest))
     {
         foreach (ElectricalModuleTypeCategory Module in updateRequest)
         {
             UpdateDelegateDictionary[Module].OnDespawnServer(info);
         }
     }
 }
コード例 #27
0
        public void OnDespawnServer(DespawnInfo info)
        {
            if (CustomNetworkManager.Instance._isServer)
            {
                UpdateManager.Remove(CallbackType.UPDATE, UpdateMe);
            }

            mobAi.health.applyDamageEvent -= OnDamageReceived;
            mobAi.PettedEvent             -= OnPetted;
            mobExplore.FoodEatenEvent     -= OnFoodEaten;
        }
コード例 #28
0
ファイル: SeedExtractor.cs プロジェクト: ktndrnl/unitystation
        public void OnDespawnServer(DespawnInfo info)
        {
            Vector3 spawnPos = gameObject.RegisterTile().WorldPositionServer;

            foreach (var packet in seedPackets)
            {
                CustomNetTransform netTransform = packet.GetComponent <CustomNetTransform>();
                netTransform.AppearAtPosition(spawnPos);
                netTransform.AppearAtPositionServer(spawnPos);
            }
        }
コード例 #29
0
 public void OnDespawnServer(DespawnInfo info)
 {
     materialStorage.DropAllMaterials();
     foreach (var linkedMat in linkedStorages)
     {
         if (linkedMat == null)                 //they were destroyed at some point, irrelevant to us
         {
             continue;
         }
         linkedMat.DisconnectFromSilo();
     }
 }
コード例 #30
0
ファイル: Despawn.cs プロジェクト: ewy0/unitystation
    /// <summary>
    /// Despawn the object locally, on this client only. Should ONLY be called on non-networked objects
    /// (i.e. ones which don't have NetworkIdentity component). Despawning removes an
    /// object from the game, but may not necessarilly destroy it completely - it may end up back in the
    /// object pool to be later reused.
    /// </summary>
    /// <param name="info"></param>
    /// <returns></returns>
    public static DespawnResult Client(DespawnInfo info)
    {
        if (info == null)
        {
            Logger.LogError("Cannot despawn - info is null", Category.ItemSpawn);
            return(DespawnResult.Fail(info));
        }

        if (Spawn._ObjectPool.TryDespawnToPool(info.GameObject, true))
        {
            return(DespawnResult.Single(info));
        }
        else
        {
            return(DespawnResult.Fail(info));
        }
    }