Example #1
0
        public static PyObject GetUserCacheData(int user, string name)
        {
            if (LoadUserCacheFor(user, name) == false)
            {
                return(null);
            }

            PyTuple cache = userCacheData[user][name];

            if (cache == null)
            {
                return(null);
            }

            CacheInfo data = new CacheInfo();

            data.objectID  = new PyString(name);
            data.cacheTime = cache.Items[1].As <PyLongLong>().Value;
            data.nodeID    = cache.Items[2].As <PyIntegerVar>().Value;
            data.version   = cache.Items[3].As <PyIntegerVar>().Value; // This is a CRC of the buffer

            return(data.Encode());
        }
Example #2
0
        public static PyObject GetCacheData(string name)
        {
            if (LoadCacheFor(name) == false)
            {
                Log.Error("Cache", "Cannot load cache data for cache " + name);
                return(null);
            }

            PyTuple cache = cacheData[name];

            if (cache == null)
            {
                return(null);
            }

            CacheInfo data = new CacheInfo();

            data.objectID  = new PyString(name);
            data.cacheTime = cache.Items[1].As <PyLongLong>().Value;
            data.nodeID    = cache.Items[2].As <PyIntegerVar>().Value;
            data.version   = cache.Items[3].As <PyIntegerVar>().Value; // This is a CRC of the buffer

            return(data.Encode());
        }
Example #3
0
        public static PyObject GetUserCacheData(int user, string name)
        {
            if (LoadUserCacheFor(user, name) == false)
            {
                return null;
            }

            PyTuple cache = userCacheData[user][name];

            if (cache == null)
            {
                return null;
            }

            CacheInfo data = new CacheInfo();
            data.objectID = new PyString(name);
            data.cacheTime = cache.Items[1].As<PyLongLong>().Value;
            data.nodeID = cache.Items[2].As<PyIntegerVar>().Value;
            data.version = cache.Items[3].As<PyIntegerVar>().Value; // This is a CRC of the buffer

            return data.Encode();
        }
Example #4
0
        public static PyObject GetCacheData(string name)
        {
            if (LoadCacheFor(name) == false)
            {
                WindowLog.Error("Cache", "Cannot load cache data for cache " + name);
                return null;
            }

            PyTuple cache = cacheData[name];

            if (cache == null)
            {
                return null;
            }

            CacheInfo data = new CacheInfo();
            data.objectID = new PyString(name);
            data.cacheTime = cache.Items[1].As<PyLongLong>().Value;
            data.nodeID = cache.Items[2].As<PyIntegerVar>().Value;
            data.version = cache.Items[3].As<PyIntegerVar>().Value; // This is a CRC of the buffer

            return data.Encode();
        }