示例#1
0
        private void OnKongregateAPILoaded(string userInfo)
        {
            Log.Info("[Kongregate] API Loaded");
            Kongregate.APILoaded            = true;
            Kongregate.IsWaitingForPurchase = false;
            string[] array = userInfo.Split(new char[]
            {
                '|'
            });
            int    num           = int.Parse(array[0]);
            string username      = array[1];
            string gameAuthToken = array[2];

            if (num == 0)
            {
                Kongregate.SetIsGuest(true);
            }
            else
            {
                Kongregate.SetUserId(array[0]);
                Kongregate.SetUsername(username);
                Kongregate.SetIsGuest(false);
                Kongregate.m_GameAuthToken = gameAuthToken;
            }
            App.ConnectToKongregate();
        }
示例#2
0
 public static void SubmitStat(string statistic, int value, bool force = false)
 {
     if (((App.CurrentPlattform == Plattform.Kongregate && App.State.ShouldSubmitScore) || (App.CurrentPlattform == Plattform.Kongregate && force)) && (force || !App.State.PossibleCheater))
     {
         Kongregate.CallAPIFunction(string.Format("kongregate.stats.submit('{0}', {1})", statistic, value));
     }
 }
示例#3
0
 public static void PurchaseItem(string item)
 {
     if (Kongregate.IsGuest)
     {
         Kongregate.ShowSignIn();
     }
     else
     {
         Kongregate.IsWaitingForPurchase      = true;
         App.State.PremiumBoni.ItemToPurchase = item;
         Log.Info("[Kongregate] Attempting purchase of " + item);
         Kongregate.CallAPIFunction(string.Format("purchaseItem('{0}')", item));
     }
 }
示例#4
0
 private void OnLogin(string userInfo)
 {
     string[] array = userInfo.Split(new char[]
     {
         '|'
     });
     Kongregate.SetUserId(array[0]);
     Kongregate.SetUsername(array[1]);
     Kongregate.SetIsGuest(false);
     Kongregate.m_GameAuthToken = array[2];
     if (App.State == null)
     {
         App.Init();
     }
     App.ConnectToKongregate();
 }
示例#5
0
 private void OnPurchaseResult(object returnValue)
 {
     Kongregate.CheckBoughtItems();
 }
示例#6
0
 private static void CallAPIFunction(string functionCall)
 {
     Kongregate.CallAPIFunction(functionCall, null);
 }
示例#7
0
 public static void ShowIncentivizedAd()
 {
     Kongregate.CallAPIFunction("showIncentivizedAd()");
 }
示例#8
0
 public static void InitAdEventListener()
 {
     Kongregate.CallAPIFunction("initAdEventListener()");
 }
示例#9
0
 public static void GetUserItems2()
 {
     Kongregate.CallAPIFunction("getUserItems2()");
 }
示例#10
0
 public static void ShowSignIn()
 {
     Kongregate.CallAPIFunction("if(kongregate.services.isGuest()) kongregate.services.showSignInBox()");
 }
示例#11
0
 public static void CheckBoughtItems()
 {
     Kongregate.CallAPIFunction("getUserItems()");
 }