Example #1
0
        public async Task Get(long id)
        {
            Header h = await nntp.Headers(id);

            if (h != null && h.headers.ContainsKey("X-XML"))
            {
                try
                {
                    Spot spot = new Spot(h);
                    if (spot.segments != null)
                    {
                        OnSpot?.Invoke(this, spot);
                    }
                }
                catch (XmlException)
                {
                    //  Console.WriteLine("Could not parse spot: " + e + "\n\n" + h.headers["X-XML"]);
                }
                catch (Exception e)
                {
                    Console.WriteLine($"Exception thrown while parsing spot: {id}, {e}");
                }
            }
            else
            { /*    Console.WriteLine($"{id} not a spotnet spot");*/
            }
        }
Example #2
0
 void SpotPlayer()
 {
     print("spotted");
     OnSpot?.Invoke();
     active = false;
 }