コード例 #1
0
ファイル: CachingWrap.cs プロジェクト: xophiix/CsToLua
    static int Authorize(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 4)
        {
            string arg0 = LuaScriptMgr.GetLuaString(L, 1);
            string arg1 = LuaScriptMgr.GetLuaString(L, 2);
            long   arg2 = (long)LuaScriptMgr.GetNumber(L, 3);
            string arg3 = LuaScriptMgr.GetLuaString(L, 4);
            bool   o    = Caching.Authorize(arg0, arg1, arg2, arg3);
            LuaScriptMgr.Push(L, o);
            return(1);
        }
        else if (count == 5)
        {
            string arg0 = LuaScriptMgr.GetLuaString(L, 1);
            string arg1 = LuaScriptMgr.GetLuaString(L, 2);
            long   arg2 = (long)LuaScriptMgr.GetNumber(L, 3);
            int    arg3 = (int)LuaScriptMgr.GetNumber(L, 4);
            string arg4 = LuaScriptMgr.GetLuaString(L, 5);
            bool   o    = Caching.Authorize(arg0, arg1, arg2, arg3, arg4);
            LuaScriptMgr.Push(L, o);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: Caching.Authorize");
        }

        return(0);
    }
コード例 #2
0
        public static bool CachingAuthorize(string name, string domain,
                                            long size, int expiration, string singature)
        {
            var isCacheAuthorized = Caching.Authorize(name, domain, size, expiration, singature);

            if (!isCacheAuthorized)
            {
                Debug.LogWarningFormat("Caching.Authorize Failed. name:{0}, domain:{1}, absoluteURL:{2}",
                                       name, domain, Application.absoluteURL);
            }
            else
            {
                Debug.LogFormat("Caching.Authorize Succeeded. name:{0}, domain:{1}", name, domain);
            }
            return(isCacheAuthorized);
        }
コード例 #3
0
 public static bool Authorize(string name, string domain, long size, int expiration, string signature)
 {
     return(Caching.Authorize(name, domain, size, expiration, signature));
 }