예제 #1
0
        public string RemoveWormhole(LostSolarSystem wormhole)
        {
            var message = "Ooops. Wormhole and publisher not found.";

            LostSolarSystem forRemove = null;

            foreach (var value in List.Values)
            {
                if (value.Name == wormhole.Name && value.Publisher == wormhole.Publisher)
                {
                    forRemove = value;
                }
            }

            if (forRemove != null)
            {
                var url = string.Format(DeleteWormholeAddress, LostAndFoundOfficeServer, "delete", forRemove.Publisher, forRemove.Name);

                message = new WebClient().DownloadString(url);

                List.Remove(forRemove.Name);
            }

            return(message);
        }
예제 #2
0
        public string PublishWormhole(LostSolarSystem wormhole)
        {
            var url = string.Format(AddWormholeAddress, LostAndFoundOfficeServer, "add", wormhole.Publisher, wormhole.Name, wormhole.Reward);

            var message = new WebClient().DownloadString(url);

            List.Add(wormhole.Name, wormhole);

            return(message);
        }