Ejemplo n.º 1
0
        public async Task <EventState> GetEventSate(String eventName, bool bypassCache = true)
        {
            //Added for debugging a null pointer exception coming from the GWApiNET project
            EntryCollection <EventEntry> x;

            try
            {
                x = await GwApi.GetEventsAsync(_bs.WorldID, -1, _es.WatchedEvents.First(a => a.Value == eventName).Key, bypassCache);
            }
            catch (Exception ex)
            {
                throw;
            }
            return(x.First(a => a.EventId == _es.WatchedEvents.First(n => n.Value == eventName).Key).State);
        }
Ejemplo n.º 2
0
        public async Task <EntryDictionary <Guid, EventNameEntry> > GetEventNamesAsync(int mapID)
        {
            EntryCollection <EventEntry> x = await GwApi.GetEventsAsync(_bs.WorldID, mapID, null);

            EntryDictionary <Guid, EventNameEntry> y = await GwApi.GetEventNamesAsync();

            HashSet <Guid> z = new HashSet <Guid>();

            foreach (EventEntry p in x)
            {
                z.Add(p.EventId);
            }

            EntryDictionary <Guid, EventNameEntry> ret = new EntryDictionary <Guid, EventNameEntry>();

            y.Where(j => z.Contains(j.Value.Id)).ToList().ForEach(k => ret.Add(k.Key, k.Value));
            return(ret);
        }
Ejemplo n.º 3
0
        public async Task <EntryCollection <EventEntry> > GetEventDetailsAsync()
        {
            EntryCollection <EventEntry> eventDetails = await GwApi.GetEventsAsync(_bs.WorldID, -1, null);

            return(eventDetails);
        }
Ejemplo n.º 4
0
        public async Task <EventState> GetEventSate(Guid eventId, bool bypassCache = true)
        {
            EntryCollection <EventEntry> x = await GwApi.GetEventsAsync(_bs.WorldID, -1, eventId, bypassCache);

            return(x.First(a => a.EventId == eventId).State);
        }