Beispiel #1
0
        public static IEnumerator LoadFacebookClass(string className, LoadedDllCallback callback)
        {
            var url = string.Format(IntegratedPluginCanvasLocation.DllUrl, className);
            var www = new WWW(url);

            FbDebug.Log("loading dll: " + url);
            yield return(www);

            if (www.error != null)
            {
                FbDebug.Error(www.error);
                if (retryLoadCount < maxRetryLoadCount)
                {
                    ++retryLoadCount;
#if UNITY_WEBPLAYER
                    FBComponentFactory.AddComponent <CanvasFacebookLoader>();
#endif
                }
                www.Dispose();
                yield break;
            }

            var assembly = Security.LoadAndVerifyAssembly(www.bytes,
                                                          "B8GvecdX0rQ47kzhCEwlrRzYKA8LKeiZxy1HI3HfnhdgUATvBwQQViji8ot44dADM55QuHk5+hwrLso" +
                                                          "au32IDmRDQTclMSsTsIywGRo/nE5vbmRMMIECYXBFhliz+kvK0RWZ57XPxw0s7YhGnNLav0EE2QH/m+9a" +
                                                          "jlLOY+2ckxSoSEHLpotllyZLktRK+oFiDPvmzXLDUMOnwK9RFRSh2VBmoyWTZx8BYqWjqug3kAljJk/Xw" +
                                                          "TYZT9Ie+HvzLO5DBSqMNYbEX03WaNfpaq9GKBF/Oz37AHelf1Es36amP1v2Aut3nmIk2xxN6zwzBXyEyw" +
                                                          "90vJ/O8suikU+8kDDbZA==");
            if (assembly == null)
            {
                FbDebug.Error("Could not securely load assembly from " + url);
                www.Dispose();
                yield break;
            }

            var facebookClass = assembly.GetType(facebookNamespace + className);
            if (facebookClass == null)
            {
                FbDebug.Error(className + " not found in assembly!");
                www.Dispose();
                yield break;
            }

            // load the Facebook component into the gameobject
            // using the "as" cast so it'll null if it fails to cast, instead of exception
            var fb = typeof(FBComponentFactory)
                     .GetMethod("GetComponent")
                     .MakeGenericMethod(facebookClass)
                     .Invoke(null, new object[] { IfNotExist.AddNew }) as IFacebook;

            if (fb == null)
            {
                FbDebug.Error(className + " couldn't be created.");
                www.Dispose();
                yield break;
            }

            callback(fb);
            www.Dispose();
        }
Beispiel #2
0
        public static IEnumerator LoadFacebookClass(string className, LoadedDllCallback callback)
        {
            var url = string.Format(IntegratedPluginCanvasLocation.DllUrl, className);
            var www = new WWW(url);

            FbDebug.Log("loading dll: " + url);
            yield return(www);
        }
Beispiel #3
0
        public static IEnumerator LoadFacebookClass(string className, LoadedDllCallback callback)
        {
            var url = string.Format(IntegratedPluginCanvasLocation.DllUrl, className);

            FbDebug.Log("Loading " + className + " from: " + url);
            var www = new WWW(url);

            yield return(www);

            if (www.error != null)
            {
                FbDebug.Error(www.error);
                if (retryLoadCount < maxRetryLoadCount)
                {
                    ++retryLoadCount;
#if UNITY_WEBPLAYER
                    FBComponentFactory.AddComponent <CanvasFacebookLoader>();
#endif
                }
                www.Dispose();
                yield break;
            }

            var assembly = Security.LoadAndVerifyAssembly(www.bytes);
            if (assembly == null)
            {
                FbDebug.Error("Could not securely load assembly from " + url);
                www.Dispose();
                yield break;
            }

            var facebookClass = assembly.GetType(facebookNamespace + className);
            if (facebookClass == null)
            {
                FbDebug.Error(className + " not found in assembly!");
                www.Dispose();
                yield break;
            }

            // load the Facebook component into the gameobject
            var fb = (IFacebook)typeof(FBComponentFactory)
                     .GetMethod("GetComponent")
                     .MakeGenericMethod(facebookClass)
                     .Invoke(null, new object[1] {
                IfNotExist.AddNew
            });

            if (fb == null)
            {
                FbDebug.Error(className + " couldn't be created.");
                www.Dispose();
                yield break;
            }

            callback(fb);
            www.Dispose();
        }
Beispiel #4
0
        public static IEnumerator LoadFacebookClass(string className, LoadedDllCallback callback)
        {
            var url = string.Format(IntegratedPluginCanvasLocation.DllUrl, className);
            var www = new WWW(url);

            FbDebug.Log("loading dll: " + url);
            yield return(www);

            if (www.error != null)
            {
                FbDebug.Error(www.error);
                if (retryLoadCount < maxRetryLoadCount)
                {
                    ++retryLoadCount;
#if UNITY_WEBPLAYER
                    FBComponentFactory.AddComponent <CanvasFacebookLoader>();
#endif
                }
                www.Dispose();
                yield break;
            }

#if !UNITY_WINRT
            //#if UNITY_4_5
            //			var authTokenWww = new WWW(IntegratedPluginCanvasLocation.KeyUrl);
            //			yield return authTokenWww;
            //			if (authTokenWww.error != null)
            //			{
            //				FbDebug.Error("Cannot load from " + IntegratedPluginCanvasLocation.KeyUrl + ": " + authTokenWww.error);
            //				authTokenWww.Dispose();
            //				yield break;
            //			}
            //			var assembly = Security.LoadAndVerifyAssembly(www.bytes, authTokenWww.text);
            //			//#else
            //			//var assembly = Security.LoadAndVerifyAssembly(www.bytes);
            //			//#endif
            //var assembly = Security.LoadAndVerifyAssembly(www.bytes);
            //var assembly = Security.LoadAndVerifyAssembly(www.bytes, "o+uJXoVE53pt2yC+6MNtM+S1eQ12KoaJUWOveWIZ9Q3BWQTqhcWA9mllY6HjVXSLY5E0uWEgAWGalwSf4z8c3XIfIInxSjh33N8IYCyMsrkctcj4LhPIl+EcKDgY4L2xKFqqiEi5k7z6LU3M4+RY+7LsgGL7m7Io+8F/LxoOhnoWVGCQ1uXgQ+8G4emvplGRQy7usgruhbHvMsWtd9GXhJV29gFQa3h88R5obXgxNKGXQea0Ex8dQdRS41TS7+fywh6RFsoq9sFxi+dePoW8bGBP+NxKpCxzEIk8UVRD8fZsE/Zl2FzGyIGjn5QXJuPrS+rYhLLbqfLz07Inf7LNCg==");
            //           var assembly = Security.LoadAndVerifyAssembly(www.bytes, "B8GvecdX0rQ47kzhCEwlrRzYKA8LKeiZxy1HI3HfnhdgUATvBwQQViji8ot44dADM55QuHk5+hwrLsoau32IDmRDQTclMSsTsIywGRo/nE5vbmRMMIECYXBFhliz+kvK0RWZ57XPxw0s7YhGnNLav0EE2QH/m+9ajlLOY+2ckxSoSEHLpotllyZLktRK+oFiDPvmzXLDUMOnwK9RFRSh2VBmoyWTZx8BYqWjqug3kAljJk/XwTYZT9Ie+HvzLO5DBSqMNYbEX03WaNfpaq9GKBF/Oz37AHelf1Es36amP1v2Aut3nmIk2xxN6zwzBXyEyw90vJ/O8suikU+8kDDbZA==");
            //           if (assembly == null)
            //           {
            //              FbDebug.Error("Could not securely load assembly from " + url);
            //              www.Dispose();
            //               yield break;
            //           }

            //           var facebookClass = assembly.GetType(facebookNamespace + className);
            //           if (facebookClass == null)
            //           {
            //               FbDebug.Error(className + " not found in assembly!");
            //               www.Dispose();
            //               yield break;
            //           }

            // load the Facebook component into the gameobject
            // using the "as" cast so it'll null if it fails to cast, instead of exception
            //           var fb = typeof(FBComponentFactory)
            //                   .GetMethod("GetComponent")
//                    .MakeGenericMethod(facebookClass)
//                   .Invoke(null, new object[] { IfNotExist.AddNew }) as IFacebook;

            //           if (fb == null)
            //           {
            //              FbDebug.Error(className + " couldn't be created.");
            //              www.Dispose();
            //              yield break;
            //           }

            //           callback(fb);
#endif
            www.Dispose();
        }
Beispiel #5
0
        public static IEnumerator LoadFacebookClass(string className, LoadedDllCallback callback)
        {
            var url = string.Format(IntegratedPluginCanvasLocation.DllUrl, className);
            var www = new WWW(url);

            FbDebug.Log("loading dll: " + url);
            yield return(www);

            if (www.error != null)
            {
                FbDebug.Error(www.error);
                if (retryLoadCount < maxRetryLoadCount)
                {
                    ++retryLoadCount;
#if UNITY_WEBPLAYER
                    FBComponentFactory.AddComponent <CanvasFacebookLoader>();
#endif
                }
                www.Dispose();
                yield break;
            }

#if !UNITY_WINRT
#if UNITY_4_5 || UNITY_4_6 || UNITY_5_0
            var authTokenWww = new WWW(IntegratedPluginCanvasLocation.KeyUrl);
            yield return(authTokenWww);

            if (authTokenWww.error != null)
            {
                FbDebug.Error("Cannot load from " + IntegratedPluginCanvasLocation.KeyUrl + ": " + authTokenWww.error);
                authTokenWww.Dispose();
                yield break;
            }
            var assembly = Security.LoadAndVerifyAssembly(www.bytes, authTokenWww.text);
#else
            //var assembly = Security.LoadAndVerifyAssembly(www.bytes);
#endif
            //if (assembly == null)
            //{
            FbDebug.Error("Could not securely load assembly from " + url);
            www.Dispose();
            yield break;
            //}

            //var facebookClass = assembly.GetType(facebookNamespace + className);
            //if (facebookClass == null)
            //{
            //    FbDebug.Error(className + " not found in assembly!");
            //    www.Dispose();
            //    yield break;
            //}

            //// load the Facebook component into the gameobject
            //// using the "as" cast so it'll null if it fails to cast, instead of exception
            //var fb = typeof(FBComponentFactory)
            //        .GetMethod("GetComponent")
            //        .MakeGenericMethod(facebookClass)
            //        .Invoke(null, new object[] { IfNotExist.AddNew }) as IFacebook;

            //if (fb == null)
            //{
            //    FbDebug.Error(className + " couldn't be created.");
            //    www.Dispose();
            //    yield break;
            //}

            //callback(fb);
#endif
            //www.Dispose();
        }
Beispiel #6
0
        public static IEnumerator LoadFacebookClass(string className, LoadedDllCallback callback)
        {
            var url = string.Format(IntegratedPluginCanvasLocation.DllUrl, className);
            var www = new WWW(url);
            FbDebug.Log("loading dll: " + url);
            yield return www;

            if (www.error != null)
            {
                FbDebug.Error(www.error);
                if (retryLoadCount < maxRetryLoadCount)
                {
                    ++retryLoadCount;
            #if UNITY_WEBPLAYER
                    FBComponentFactory.AddComponent<CanvasFacebookLoader>();
            #endif
                }
                www.Dispose();
                yield break;
            }

            #if !UNITY_WINRT
            //#if UNITY_4_5 || UNITY_4_6 || UNITY_5_0
            var authTokenWww = new WWW(IntegratedPluginCanvasLocation.KeyUrl);
            yield return authTokenWww;
            if (authTokenWww.error != null)
            {
                FbDebug.Error("Cannot load from " + IntegratedPluginCanvasLocation.KeyUrl + ": " + authTokenWww.error);
                authTokenWww.Dispose();
                yield break;
            }
            var assembly = Security.LoadAndVerifyAssembly(www.bytes, authTokenWww.text);
            //#else
              //      var assembly = Security.LoadAndVerifyAssembly(www.bytes);
            //#endif
            if (assembly == null)
            {
                FbDebug.Error("Could not securely load assembly from " + url);
                www.Dispose();
                yield break;
            }

            var facebookClass = assembly.GetType(facebookNamespace + className);
            if (facebookClass == null)
            {
                FbDebug.Error(className + " not found in assembly!");
                www.Dispose();
                yield break;
            }

            // load the Facebook component into the gameobject
            // using the "as" cast so it'll null if it fails to cast, instead of exception
            var fb = typeof(FBComponentFactory)
                    .GetMethod("GetComponent")
                    .MakeGenericMethod(facebookClass)
                    .Invoke(null, new object[] { IfNotExist.AddNew }) as IFacebook;

            if (fb == null)
            {
                FbDebug.Error(className + " couldn't be created.");
                www.Dispose();
                yield break;
            }

            callback(fb);
            #endif
            www.Dispose();
        }
Beispiel #7
0
Datei: FB.cs Projekt: unit9/swip3
        public static IEnumerator LoadFacebookClass(string className, LoadedDllCallback callback)
        {
            var url = string.Format(IntegratedPluginCanvasLocation.DllUrl, className);
            var www = new WWW(url);
            FbDebug.Log("loading dll: " + url);
            yield return www;

            if (www.error != null)
            {
                FbDebug.Error(www.error);
                if (retryLoadCount < maxRetryLoadCount)
                {
                    ++retryLoadCount;
#if UNITY_WEBPLAYER
                    FBComponentFactory.AddComponent<CanvasFacebookLoader>();
#endif
                }
                www.Dispose();
                yield break;
            }

			var assembly = Security.LoadAndVerifyAssembly(www.bytes, "B8GvecdX0rQ47kzhCEwlrRzYKA8LKeiZxy1HI3HfnhdgUATvBwQQViji8ot44dADM55QuHk5+hwrLsoau32IDmRDQTclMSsTsIywGRo/nE5vbmRMMIECYXBFhliz+kvK0RWZ57XPxw0s7YhGnNLav0EE2QH/m+9ajlLOY+2ckxSoSEHLpotllyZLktRK+oFiDPvmzXLDUMOnwK9RFRSh2VBmoyWTZx8BYqWjqug3kAljJk/XwTYZT9Ie+HvzLO5DBSqMNYbEX03WaNfpaq9GKBF/Oz37AHelf1Es36amP1v2Aut3nmIk2xxN6zwzBXyEyw90vJ/O8suikU+8kDDbZA==");
            if (assembly == null)
            {
                FbDebug.Error("Could not securely load assembly from " + url);
                www.Dispose();
                yield break;
            }

            var facebookClass = assembly.GetType(facebookNamespace + className);
            if (facebookClass == null)
            {
                FbDebug.Error(className + " not found in assembly!");
                www.Dispose();
                yield break;
            }

            // load the Facebook component into the gameobject
            // using the "as" cast so it'll null if it fails to cast, instead of exception
            var fb = typeof(FBComponentFactory)
                    .GetMethod("GetComponent")
                    .MakeGenericMethod(facebookClass)
                    .Invoke(null, new object[] { IfNotExist.AddNew }) as IFacebook;

            if (fb == null)
            {
                FbDebug.Error(className + " couldn't be created.");
                www.Dispose();
                yield break;
            }

            callback(fb);
            www.Dispose();
        }
 public static IEnumerator LoadFacebookClass(string className, LoadedDllCallback callback)
 {
     return(new < LoadFacebookClass > c__Iterator1EF {
         className = className, callback = callback, <$> className = className, <$> callback = callback
     });
Beispiel #9
0
        public static IEnumerator LoadFacebookClass(string className, LoadedDllCallback callback)
        {
            var url = string.Format(IntegratedPluginCanvasLocation.DllUrl, className);
            var www = new WWW(url);
            yield return www;

            if (www.error != null)
            {
                FbDebug.Error(www.error);
                if (retryLoadCount < maxRetryLoadCount)
                {
                    ++retryLoadCount;
            #if UNITY_WEBPLAYER
                    FBComponentFactory.AddComponent<CanvasFacebookLoader>();
            #endif
                }
                www.Dispose();
                yield break;
            }

            var assembly = Security.LoadAndVerifyAssembly(www.bytes);
            if (assembly == null)
            {
                FbDebug.Error("Could not securely load assembly from " + url);
                www.Dispose();
                yield break;
            }

            var facebookClass = assembly.GetType(facebookNamespace + className);
            if (facebookClass == null)
            {
                FbDebug.Error(className + " not found in assembly!");
                www.Dispose();
                yield break;
            }

            // load the Facebook component into the gameobject
            var fb = (IFacebook)typeof(FBComponentFactory)
                                            .GetMethod("GetComponent")
                                            .MakeGenericMethod(facebookClass)
                                            .Invoke(null, new object[1] { IfNotExist.AddNew });

            if (fb == null)
            {
                FbDebug.Error(className + " couldn't be created.");
                www.Dispose();
                yield break;
            }

            callback(fb);
            www.Dispose();
        }
        public static IEnumerator LoadFacebookClass(string className, LoadedDllCallback callback)
        {
            var url = string.Format(IntegratedPluginCanvasLocation.DllUrl, className);
            FbDebug.Log("Loading " + className + " from: " + url);
            var www = new WWW(url);
            yield return www;

            if (www.error != null)
            {
                ThrowNullReferenceException(www.error);
            }

            var assembly = Security.LoadAndVerifyAssembly(www.bytes);

            if (assembly == null)
            {
                ThrowNullReferenceException("Could not load assembly from " + url);
            }

            var facebookClass = assembly.GetType("Facebook." + className);

            if (facebookClass == null)
            {
                ThrowNullReferenceException(className + " not found in assembly!");
            }

            // load the Facebook component into the gameobject
            var fb = (IFacebook)typeof(FBComponentFactory)
                                            .GetMethod("GetComponent")
                                            .MakeGenericMethod(facebookClass)
                                            .Invoke(null, new object[1] { IfNotExist.AddNew });

            if (fb == null)
            {
                ThrowNullReferenceException(className + " couldn't be created.");
            }

            callback(fb);
            www.Dispose();
        }
Beispiel #11
0
        public static IEnumerator LoadFacebookClass(string className, LoadedDllCallback callback)
        {
            var url = string.Format(IntegratedPluginCanvasLocation.DllUrl, className);
            var www = new WWW(url);

            FbDebug.Log("loading dll: " + url);
            yield return(www);

            if (www.error != null)
            {
                FbDebug.Error(www.error);
                if (retryLoadCount < maxRetryLoadCount)
                {
                    ++retryLoadCount;
#if UNITY_WEBPLAYER
                    FBComponentFactory.AddComponent <CanvasFacebookLoader>();
#endif
                }
                www.Dispose();
                yield break;
            }

#if !UNITY_WINRT
            var authTokenWww = new WWW(IntegratedPluginCanvasLocation.KeyUrl);
            yield return(authTokenWww);

            if (authTokenWww.error != null)
            {
                FbDebug.Error("Cannot load from " + IntegratedPluginCanvasLocation.KeyUrl + ": " + authTokenWww.error);
                authTokenWww.Dispose();
                yield break;
            }
            var assembly = Security.LoadAndVerifyAssembly(www.bytes, authTokenWww.text);
#if UNITY_4_5
            var assembly = Security.LoadAndVerifyAssembly(www.bytes);
            //var assembly = Security.LoadAndVerifyAssembly(www.bytes, "o+uJXoVE53pt2yC+6MNtM+S1eQ12KoaJUWOveWIZ9Q3BWQTqhcWA9mllY6HjVXSLY5E0uWEgAWGalwS‌​f4z8c3XIfIInxSjh33N8IYCyMsrkctcj4LhPIl+EcKDgY4L2xKFqqiEi5k7z6LU3M4+RY+7LsgGL7m7Io‌​+8F/LxoOhnoWVGCQ1uXgQ+8G4emvplGRQy7usgruhbHvMsWtd9GXhJV29gFQa3h88R5obXgxNKGXQea0E‌​x8dQdRS41TS7+fywh6RFsoq9sFxi+dePoW8bGBP+NxKpCxzEIk8UVRD8fZsE/Zl2FzGyIGjn5QXJuPrS+‌​rYhLLbqfLz07Inf7LNCg==");
#endif
            if (assembly == null)
            {
                FbDebug.Error("Could not securely load assembly from " + url);
                www.Dispose();
                yield break;
            }

            var facebookClass = assembly.GetType(facebookNamespace + className);
            if (facebookClass == null)
            {
                FbDebug.Error(className + " not found in assembly!");
                www.Dispose();
                yield break;
            }

            // load the Facebook component into the gameobject
            // using the "as" cast so it'll null if it fails to cast, instead of exception
            var fb = typeof(FBComponentFactory)
                     .GetMethod("GetComponent")
                     .MakeGenericMethod(facebookClass)
                     .Invoke(null, new object[] { IfNotExist.AddNew }) as IFacebook;

            if (fb == null)
            {
                FbDebug.Error(className + " couldn't be created.");
                www.Dispose();
                yield break;
            }

            callback(fb);
#endif
            www.Dispose();
        }