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(); }
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)); } }
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)); } }
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(); }
private void OnPurchaseResult(object returnValue) { Kongregate.CheckBoughtItems(); }
private static void CallAPIFunction(string functionCall) { Kongregate.CallAPIFunction(functionCall, null); }
public static void ShowIncentivizedAd() { Kongregate.CallAPIFunction("showIncentivizedAd()"); }
public static void InitAdEventListener() { Kongregate.CallAPIFunction("initAdEventListener()"); }
public static void GetUserItems2() { Kongregate.CallAPIFunction("getUserItems2()"); }
public static void ShowSignIn() { Kongregate.CallAPIFunction("if(kongregate.services.isGuest()) kongregate.services.showSignInBox()"); }
public static void CheckBoughtItems() { Kongregate.CallAPIFunction("getUserItems()"); }