예제 #1
0
파일: Cache.cs 프로젝트: Tratos/EVESharp
        public static PyObject GetCache(string name)
        {
            if (LoadCacheFor(name) == false)
            {
                return(null);
            }

            PyTuple info = cacheData[name];

            PyCachedObject obj = new PyCachedObject();

            obj.nodeID     = info.Items[2].As <PyIntegerVar>().Value;
            obj.objectID   = new PyString(name);
            obj.shared     = 0;
            obj.compressed = 0;
            obj.cache      = info.Items[0].As <PyBuffer>();
            obj.timestamp  = info.Items[1].As <PyLongLong>().Value;
            obj.version    = info.Items[3].As <PyIntegerVar>().Value;

            return(obj.Encode());
        }
예제 #2
0
파일: Cache.cs 프로젝트: Tratos/EVESharp
        public static PyObject GetUserCache(int user, string name)
        {
            if (LoadUserCacheFor(user, name) == false)
            {
                return(null);
            }

            // We can assume this will not throw any exception as we've just checked if it exists
            PyTuple info = userCacheData[user][name];

            PyCachedObject obj = new PyCachedObject();

            obj.nodeID     = info.Items[2].As <PyIntegerVar>().Value;
            obj.objectID   = new PyString(name);
            obj.shared     = 0;
            obj.compressed = 0;
            obj.cache      = info.Items[0].As <PyBuffer>();
            obj.timestamp  = info.Items[1].As <PyLongLong>().Value;
            obj.version    = info.Items[3].As <PyIntegerVar>().Value;

            return(obj.Encode());
        }