예제 #1
0
        public string Post(AddDaemon daemon)
        {
            Mail    mail   = new Mail();
            int     userId = daemon.UserId;
            Daemons ToAdd  = new Daemons();

            ToAdd.UserId      = daemon.UserId;
            ToAdd.Description = daemon.Description;
            ToAdd.Name        = daemon.Name;
            try
            {
                this.database.Daemons.Add(ToAdd);
                this.database.SaveChanges();

                //Make Settings
                File.Delete(@"C:\Settings\DaemonSettings.txt");
                string path = @"C:\Settings\DaemonSettings.txt";


                Daemons d = this.database.Daemons.Where(u => u.Name == daemon.Name && u.Description == daemon.Description).First();
                using (StreamWriter sw = File.CreateText(path))
                {
                    sw.WriteLine(d.Id);
                }
                //SendMail
                mail.SendMail("Daemon Installer", "Install Daemon Backuper and add Settings to C:/Settings", daemon.DaemonTo);

                return("Daemon Added");
            }
            catch
            {
                return("OOPS, error on our side...");
            }
        }
예제 #2
0
        public bool Patch(int daemonId)
        {
            Daemons dbRecord = this.FindById(daemonId);

            dbRecord.Verified = true;
            this.database.SaveChanges();
            return(true);
        }
예제 #3
0
        public bool Delete(int id)
        {
            Daemons del = this.FindById(id);

            this.database.Daemons.Remove(del);

            this.database.SaveChanges();
            return(true);
        }
예제 #4
0
        public void SpawnDaemons()
        {
            for (int i = Daemons.Count; i <= 250; i++)
            {
                var daemon = new DaemonZombieEvent();

                daemon.MoveToWorld(GetRandomLocation(), Map.ZombieLand);
                daemon.Home = daemon.Location;
                Daemons.Add(daemon);
                daemon.ZombieSerial = Uid;
            }
        }
        public void Email(int DaemonId)
        {
            Daemons daemon = this.database.Daemons.Where(d => d.Id == DaemonId).First <Daemons>();

            if (daemon.SendEmail)
            {
                daemon.SendEmail = false;
            }
            else
            {
                daemon.SendEmail = true;
            }
            this.database.SaveChanges();
        }
예제 #6
0
        public void HandleMobDeath(BaseCreature mob, ZombieAvatar avatar)
        {
            if (mob is ZombieZEvent)
            {
                _ZombiesLoc1.Remove(mob);
                _ZombiesLoc2.Remove(mob);
                _ZombiesLoc3.Remove(mob);
                _ZombiesLoc4.Remove(mob);
            }
            else if (mob is DaemonZombieEvent)
            {
                Daemons.Remove(mob);
            }
            else if (mob is TreeFellow)
            {
                TreeFellows.Remove(mob);
            }
            else if (mob is ZombieSpider)
            {
                ZombieSpiders.Remove(mob);
            }
            else if (mob is FeyWarrior)
            {
                FeyWarriors.Remove(mob);
            }
            else if (mob is Vitriol)
            {
                FeyWarriors.Remove(mob);
            }
            else if (mob is Bird)
            {
                FeyWarriors.Remove(mob);
            }
            else if (mob is HorrifyingTentacle)
            {
                HorrifyingTentacles.Remove(mob);
            }
            else if (mob is GoreFiendZombieEvent)
            {
                GoreFiends.Remove(mob);
            }

            if (avatar.Owner != null)
            {
                PlayerZombieProfile profile = ZombieEvent.EnsureProfile(avatar.Owner);
                profile.AddKill(mob);
            }
        }
예제 #7
0
        public bool GetRequests(string username)
        {
            var query = from d in this.database.Daemons
                        join u in this.database.Users
                        on d.UserId equals u.Id
                        where u.Username == username && d.Verified == false && d.Installed == true
                        select d;

            List <Daemons> List = query.ToList <Daemons>();

            try
            {
                Daemons a = List[0];
                return(true);
            }
            catch
            {
                return(false);
            }
        }
예제 #8
0
        public void RespawnEvent()
        {
            foreach (Mobile zombie in _ZombiesLoc1.ToList())
            {
                if (zombie != null)
                {
                    zombie.Delete();
                }
                _ZombiesLoc1.Remove(zombie);
            }
            _ZombiesLoc1.Clear();
            _ZombiesLoc1.TrimExcess();

            foreach (Mobile zombie in _ZombiesLoc2.ToList())
            {
                if (zombie != null)
                {
                    zombie.Delete();
                }
                _ZombiesLoc2.Remove(zombie);
            }
            _ZombiesLoc2.Clear();
            _ZombiesLoc2.TrimExcess();

            foreach (Mobile zombie in _ZombiesLoc3.ToList())
            {
                if (zombie != null)
                {
                    zombie.Delete();
                }
                _ZombiesLoc3.Remove(zombie);
            }
            _ZombiesLoc3.Clear();
            _ZombiesLoc3.TrimExcess();

            foreach (Mobile zombie in _ZombiesLoc4.ToList())
            {
                if (zombie != null)
                {
                    zombie.Delete();
                }
                _ZombiesLoc4.Remove(zombie);
            }
            _ZombiesLoc4.Clear();
            _ZombiesLoc4.TrimExcess();

            foreach (Mobile daemon in Daemons.ToList())
            {
                if (daemon != null)
                {
                    daemon.Delete();
                }
                Daemons.Remove(daemon);
            }
            Daemons.Clear();
            Daemons.TrimExcess();

            foreach (Mobile bird in Birds.ToList())
            {
                if (bird != null)
                {
                    bird.Delete();
                }
                Birds.Remove(bird);
            }
            Birds.Clear();
            Birds.TrimExcess();

            foreach (Mobile dk in GoreFiends.ToList())
            {
                if (dk != null)
                {
                    dk.Delete();
                }
                GoreFiends.Remove(dk);
            }
            GoreFiends.Clear();
            GoreFiends.TrimExcess();

            foreach (Mobile fey in FeyWarriors.ToList())
            {
                if (fey != null)
                {
                    fey.Delete();
                }
                FeyWarriors.Remove(fey);
            }
            FeyWarriors.Clear();
            FeyWarriors.TrimExcess();

            foreach (Mobile tentacle in HorrifyingTentacles.ToList())
            {
                if (tentacle != null)
                {
                    tentacle.Delete();
                }
                HorrifyingTentacles.Remove(tentacle);
            }
            HorrifyingTentacles.Clear();
            HorrifyingTentacles.TrimExcess();

            foreach (Mobile tf in TreeFellows.ToList())
            {
                if (tf != null)
                {
                    tf.Delete();
                }
                TreeFellows.Remove(tf);
            }
            TreeFellows.Clear();
            TreeFellows.TrimExcess();

            foreach (Mobile vitriol in Vitriols.ToList())
            {
                if (vitriol != null)
                {
                    vitriol.Delete();
                }
                Vitriols.Remove(vitriol);
            }
            Vitriols.Clear();
            Vitriols.TrimExcess();

            foreach (Mobile spider in ZombieSpiders.ToList())
            {
                if (spider != null)
                {
                    spider.Delete();
                }
                ZombieSpiders.Remove(spider);
            }

            ZombieSpiders.Clear();
            ZombieSpiders.TrimExcess();

            SpawnZombies();
            SpawnDaemons();
            SpawnBirds();
            SpawnFey();
            SpawnSpider();
            SpawnTentacles();
            SpawnTreeFellow();
            SpawnVitriol();
            SpawnGoreFiends();
        }