示例#1
0
        public static async Task <int[]> GetJumps(int src, int dst)
        {
            EnsureInit();


            int[] route = RedisHelper.Get <int[]>(string.Format("esi:jumps:{0}:{1}", src, dst));

            if (route != null)
            {
                return(route);
            }

            EsiResponse <int[]> response = await s_client.Routes.Map(src, dst);

            if (response.StatusCode != HttpStatusCode.OK)
            {
                Console.WriteLine("[Error] Unable to query ESI for a route. Status: {0} Error {1}", response.StatusCode, response.Message);
                return(null);
            }

            RedisHelper.Set <int[]>(string.Format("esi:jumps:{0}:{1}", src, dst), response.Data);

            return(response.Data);
        }
 public void Set()
 {
     RedisHelper.Set <Instructions>(WaitlistRedisKey, this);
 }