DarkEmu_GameServer.spez_obj.DeSpawnMe C# (CSharp) Method

DeSpawnMe() public method

public DeSpawnMe ( ) : void
return void
        public void DeSpawnMe()
        {
            try
            {
                byte[] buff = Packet.ObjectDeSpawn(this.UniqueID);
                lock (Systems.clients)
                {
                    for (int i = 0; i < Systems.clients.Count; i++)
                    {
                        try
                        {
                            if (Spawned(Systems.clients[i].Character.Information.UniqueID))
                            {
                                Systems.clients[i].client.Send(buff);

                                //end buff
                                if (Formule.GetSurroundRange(new Global.vektor(Systems.clients[i].Character.Information.UniqueID, Systems.clients[i].Character.Position.packetX, Systems.clients[i].Character.Position.packetZ, Systems.clients[i].Character.Position.packetY, Systems.clients[i].Character.Position.xSec, Systems.clients[i].Character.Position.ySec), new Global.vektor(0, (float)this.x, (float)this.z, (float)this.y, this.xSec, this.ySec), this.Radius))
                                {
                                    if (Systems.clients[i].Character.Action.Buff.InfiniteBuffs.ContainsKey(this.Name))
                                    {
                                        Systems.clients[i].SkillBuffEnd(Systems.clients[i].Character.Action.Buff.InfiniteBuffs[this.Name]);
                                    }
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine("spez_obj::DeSpawnMe error on index {1}/{2}: {0}", ex, i, Systems.clients.Count);
                            Systems.Debugger.Write(ex);
                        }
                    }
                }

                Spawn.Clear();
            }
            catch (Exception ex)
            {
                Console.WriteLine("spez_obj::DeSpawnMe error {0}", ex);
                Systems.Debugger.Write(ex);
            }
        }