public RawBillingPlatformProvider(UnibillConfiguration config, GameObject o)
 {
     #if UNITY_ANDROID
     this.config = config;
     #endif
     this.gameObject = o;
 }
コード例 #2
0
 public UnibillCurrencyEditor(UnibillConfiguration config)
 {
     this.config = config;
     foreach (var currency in config.currencies) {
         this.currencies.Add (new EditableCurrency (currency));
     }
 }
コード例 #3
0
 public RemoteConfigManager(IResourceLoader loader, IStorage storage, ILogger logger, RuntimePlatform platform)
 {
     this.storage = storage;
     logger.prefix = "Unibill.RemoteConfigManager";
     this.XML = loader.openTextFile ("unibillInventory.json").ReadToEnd ();
     Config = new UnibillConfiguration(XML, platform, logger);
     if (Config.UseHostedConfig) {
         string val = storage.GetString (CACHED_CONFIG_PATH, string.Empty);
         if (string.IsNullOrEmpty (val)) {
             logger.Log ("No cached config available. Using bundled");
         } else {
             logger.Log ("Cached config found, attempting to parse");
             try {
                 Config = new UnibillConfiguration(val, platform, logger);
                 if (Config.inventory.Count == 0) {
                     logger.LogError ("No purchasable items in cached config, ignoring.");
                     Config = new UnibillConfiguration (XML, platform, logger);
                 } else {
                     logger.Log (string.Format ("Using cached config with {0} purchasable items", Config.inventory.Count));
                     XML = val;
                 }
             } catch (Exception e) {
                 logger.LogError ("Error parsing inventory: {0}", e.Message);
                 Config = new UnibillConfiguration(XML, platform, logger);
             }
         }
         refreshCachedConfig (Config.HostedConfigUrl, logger);
     } else {
         logger.Log ("Not using cached inventory, using bundled.");
         Config = new UnibillConfiguration(XML, platform, logger);
     }
 }
コード例 #4
0
 public AppleAppStoreBillingService(UnibillConfiguration db, ProductIdRemapper mapper, IStoreKitPlugin storekit)
 {
     this.storekit = storekit;
     this.remapper = mapper;
     storekit.initialise(this);
     products = new HashSet <PurchasableItem>(db.AllPurchasableItems);
 }
コード例 #5
0
 public BillerFactory(IResourceLoader resourceLoader, ILogger logger, IStorage storage, IRawBillingPlatformProvider platformProvider, UnibillConfiguration config) {
     this.loader = resourceLoader;
     this.logger = logger;
     this.storage = storage;
     this.platformProvider = platformProvider;
     this.config = config;
 }
コード例 #6
0
 public SamsungAppsBillingService(UnibillConfiguration config, ProductIdRemapper remapper, IRawSamsungAppsBillingService rawSamsung, ILogger logger)
 {
     this.config = config;
     this.remapper = remapper;
     this.rawSamsung = rawSamsung;
     this.logger = logger;
 }
コード例 #7
0
 public AppleAppStoreBillingService(UnibillConfiguration db, ProductIdRemapper mapper, IStoreKitPlugin storekit)
 {
     this.storekit = storekit;
     this.remapper = mapper;
     storekit.initialise(this);
     products = new HashSet<PurchasableItem>(db.AllPurchasableItems);
 }
コード例 #8
0
    public void OnEnable () {
		items = new List<GUIPurchasable> ();
		toRemove = new List<GUIPurchasable> ();
		InventoryPostProcessor.CreateInventoryIfNecessary ();
		AndroidManifestGenerator.CreateManifestIfNecessary ();
        using (TextReader reader = File.OpenText(InventoryPostProcessor.UNIBILL_JSON_INVENTORY_PATH)) {
            config = new UnibillConfiguration(reader.ReadToEnd(), Application.platform, new Uniject.Impl.UnityLogger());
        }
        for (int t = 0; t < androidBillingPlatforms.Count(); t++) {
            if (androidBillingPlatforms[t] == config.AndroidBillingPlatform.ToString()) {
                androidBillingPlatform = t;
                break;
            }
        }
        foreach (PurchasableItem element in config.inventory) {

            List<IPlatformEditor> editors = new List<IPlatformEditor>();
            editors.Add(new GooglePlayEditor(element));
            editors.Add(new DefaultPlatformEditor(element, BillingPlatform.AmazonAppstore));
            editors.Add(new AppleAppStoreEditor(element));
            editors.Add(new DefaultPlatformEditor(element, BillingPlatform.MacAppStore));
            editors.Add(new DefaultPlatformEditor(element, BillingPlatform.WindowsPhone8));
            editors.Add(new DefaultPlatformEditor(element, BillingPlatform.Windows8_1));
			editors.Add (new DefaultPlatformEditor (element, BillingPlatform.SamsungApps));
            items.Add(new GUIPurchasable(element, editors));
        }

		currencyEditor = new UnibillCurrencyEditor (config);
    }
コード例 #9
0
 public SamsungAppsBillingService(UnibillConfiguration config, ProductIdRemapper remapper, IRawSamsungAppsBillingService rawSamsung, ILogger logger)
 {
     this.config     = config;
     this.remapper   = remapper;
     this.rawSamsung = rawSamsung;
     this.logger     = logger;
 }
コード例 #10
0
 public BillerFactory(IResourceLoader resourceLoader, ILogger logger, IStorage storage, IRawBillingPlatformProvider platformProvider, UnibillConfiguration config)
 {
     this.loader           = resourceLoader;
     this.logger           = logger;
     this.storage          = storage;
     this.platformProvider = platformProvider;
     this.config           = config;
 }
コード例 #11
0
 public AmazonAppStoreBillingService(IRawAmazonAppStoreBillingInterface amazon, ProductIdRemapper remapper, UnibillConfiguration db, TransactionDatabase tDb, ILogger logger) {
     this.remapper = remapper;
     this.db = db;
     this.logger = logger;
     logger.prefix = "UnibillAmazonBillingService";
     this.amazon = amazon;
     this.tDb = tDb;
 }
コード例 #12
0
 public AmazonAppStoreBillingService(IRawAmazonAppStoreBillingInterface amazon, ProductIdRemapper remapper, UnibillConfiguration db, TransactionDatabase tDb, ILogger logger)
 {
     this.remapper = remapper;
     this.db       = db;
     this.logger   = logger;
     logger.prefix = "UnibillAmazonBillingService";
     this.amazon   = amazon;
     this.tDb      = tDb;
 }
コード例 #13
0
 public GooglePlayBillingService (IRawGooglePlayInterface rawInterface,
                                  UnibillConfiguration config,
                                  ProductIdRemapper remapper,
                                  ILogger logger) {
     this.rawInterface = rawInterface;
     this.publicKey = config.GooglePlayPublicKey;
     this.remapper = remapper;
     this.db = config;
     this.logger = logger;
 }
コード例 #14
0
 public WP8BillingService(IWindowsIAP wp8,
                          UnibillConfiguration config,
                          ProductIdRemapper remapper,
                          TransactionDatabase tDb,
                          ILogger logger) {
     this.wp8 = wp8;
     this.db = config;
     this.tDb = tDb;
     this.remapper = remapper;
     this.logger = logger;
 }
コード例 #15
0
 public GooglePlayBillingService(IRawGooglePlayInterface rawInterface,
                                 UnibillConfiguration config,
                                 ProductIdRemapper remapper,
                                 ILogger logger)
 {
     this.rawInterface = rawInterface;
     this.publicKey    = config.GooglePlayPublicKey;
     this.remapper     = remapper;
     this.db           = config;
     this.logger       = logger;
 }
コード例 #16
0
        public Biller (UnibillConfiguration config, TransactionDatabase tDb, IBillingService billingSubsystem, ILogger logger, HelpCentre help, ProductIdRemapper remapper, CurrencyManager currencyManager) {
            this.InventoryDatabase = config;
            this.transactionDatabase = tDb;
            this.billingSubsystem = billingSubsystem;
            this.logger = logger;
            logger.prefix = "UnibillBiller";
            this.help = help;
            this.Errors = new List<UnibillError> ();
            this.remapper = remapper;
			this.currencyManager = currencyManager;
        }
コード例 #17
0
 public BillerFactory(IResourceLoader resourceLoader, Uniject.ILogger logger,
                      IStorage storage, IRawBillingPlatformProvider platformProvider,
                      UnibillConfiguration config, IUtil util, IUnityAnalytics analytics)
 {
     this.loader           = resourceLoader;
     this.logger           = logger;
     this.storage          = storage;
     this.platformProvider = platformProvider;
     this.config           = config;
     this.util             = util;
     this.analytics        = analytics;
 }
コード例 #18
0
 public WP8BillingService(IWindowsIAP wp8,
                          UnibillConfiguration config,
                          ProductIdRemapper remapper,
                          TransactionDatabase tDb,
                          ILogger logger)
 {
     this.wp8      = wp8;
     this.db       = config;
     this.tDb      = tDb;
     this.remapper = remapper;
     this.logger   = logger;
 }
        public RawAmazonAppStoreBillingInterface(UnibillConfiguration config)
        {
            if (config.CurrentPlatform == BillingPlatform.AmazonAppstore && config.AmazonSandboxEnabled)
            {
                string json = ((TextAsset)Resources.Load("amazon.sdktester.json")).text;
                File.WriteAllText("/sdcard/amazon.sdktester.json", json);
            }

            using (var pluginClass = new AndroidJavaClass("com.outlinegames.unibillAmazon.Unibill")) {
                amazon = pluginClass.CallStatic <AndroidJavaObject> ("instance");
            }
        }
コード例 #20
0
        public RawAmazonAppStoreBillingInterface(UnibillConfiguration config)
        {
            #if UNITY_ANDROID
            if (config.CurrentPlatform == BillingPlatform.AmazonAppstore && config.AmazonSandboxEnabled) {
                string json = ((TextAsset)Resources.Load ("amazon.sdktester.json")).text;
                File.WriteAllText ("/sdcard/amazon.sdktester.json", json);
            }

            using (var pluginClass = new AndroidJavaClass("com.outlinegames.unibillAmazon.Unibill" )) {
                amazon = pluginClass.CallStatic<AndroidJavaObject> ("instance");
            }
            #endif
        }
コード例 #21
0
 public GooglePlayBillingService(IRawGooglePlayInterface rawInterface,
                                 UnibillConfiguration config,
                                 ProductIdRemapper remapper,
                                 ILogger logger)
 {
     this.rawInterface = rawInterface;
     this.publicKey    = config.GooglePlayPublicKey;
     this.remapper     = remapper;
     this.db           = config;
     this.logger       = logger;
     #if UNITY_ANDROID
     this.cryptoProvider = PEMKeyLoader.CryptoServiceProviderFromPublicKeyInfo(publicKey);
     #endif
 }
コード例 #22
0
 public AnalyticsReporter(Biller biller, UnibillConfiguration config, IHTTPClient client, IStorage storage, IUtil util, ILevelLoadListener listener)
 {
     this.config = config;
     this.client = client;
     this.util   = util;
     this.userId = getUserId(storage);
     biller.onPurchaseComplete        += onSucceeded;
     biller.onPurchaseCancelled       += (PurchasableItem obj) => onEvent(EventType.purchase_cancelled, obj, null);
     biller.onPurchaseRefunded        += (PurchasableItem obj) => onEvent(EventType.purchase_refunded, obj, null);
     biller.onTransactionRestoreBegin += (bool obj) => restoreInProgress = true;
     biller.onTransactionsRestored    += (bool obj) => restoreInProgress = false;
     listener.registerListener(() => onLevelLoad());
     onEvent(EventType.new_session, null, null);
     this.levelName     = util.loadedLevelName();
     this.levelLoadTime = DateTime.UtcNow;
 }
コード例 #23
0
 public AnalyticsReporter(Biller biller, UnibillConfiguration config, IHTTPClient client, IStorage storage, IUtil util, ILevelLoadListener listener)
 {
     this.config = config;
     this.client = client;
     this.util = util;
     this.userId = getUserId (storage);
     biller.onPurchaseComplete += onSucceeded;
     biller.onPurchaseCancelled += (PurchasableItem obj) => onEvent(EventType.purchase_cancelled, obj, null);
     biller.onPurchaseRefunded += (PurchasableItem obj) => onEvent(EventType.purchase_refunded, obj, null);
     biller.onTransactionRestoreBegin += (bool obj) =>  restoreInProgress = true;
     biller.onTransactionsRestored += (bool obj) => restoreInProgress = false;
     listener.registerListener (() => onLevelLoad ());
     onEvent (EventType.new_session, null, null);
     this.levelName = util.loadedLevelName ();
     this.levelLoadTime = DateTime.UtcNow;
 }
コード例 #24
0
    public static void mergeManifest() {

        if (!Directory.Exists("Assets/Plugins/Android")) {
            AssetDatabase.CreateFolder("Assets/Plugins", "Android");
        }

        if (!File.Exists (AndroidManifestPath)) {
            AssetDatabase.CopyAsset("Assets/Plugins/unibill/static/Manifest.xml", AndroidManifestPath);
            AssetDatabase.ImportAsset(AndroidManifestPath);
        }
        
        UnibillConfiguration config = new UnibillConfiguration(new UnityResourceLoader(), new UnibillXmlParser(new Mono.Xml.SmallXmlParser(), new UnityResourceLoader()), new UnityUtil(), new UnityLogger());
        XDocument doc = XDocument.Load(AndroidManifestPath);
        doc = new AndroidManifestMerger().merge(doc, config.CurrentPlatform, config.AmazonSandboxEnabled);
        doc.Save(AndroidManifestPath);
        AssetDatabase.ImportAsset(AndroidManifestPath);
    }
コード例 #25
0
ファイル: UnityInjector.cs プロジェクト: nhhoang/shooting
    public static IKernel _get () {
        BillingPlatform platform = new UnibillConfiguration(new UnityResourceLoader(), new UnibillXmlParser(new Mono.Xml.SmallXmlParser(), new UnityResourceLoader()), new UnityUtil(), new UnityLogger()).CurrentPlatform;
        NinjectModule module = null;
        switch (platform) {
        case BillingPlatform.AppleAppStore:
		case BillingPlatform.MacAppStore:
            module = new StorekitModule(Application.isEditor);
        break;
        case BillingPlatform.AmazonAppstore:
            module = new AmazonModule(Application.isEditor);
            break;
        case BillingPlatform.GooglePlay:
            module = new GooglePlayModule(Application.isEditor);
            break;
        }
        return new StandardKernel (new UnityNinjectSettings (), new Ninject.Modules.INinjectModule[] {
            new UnityModule (),
            module,
        } );
    }
コード例 #26
0
ファイル: RemoteConfigManager.cs プロジェクト: vcan/CapsUnity
 public RemoteConfigManager(IResourceLoader loader, IStorage storage, ILogger logger, RuntimePlatform platform)
 {
     this.storage  = storage;
     logger.prefix = "Unibill.RemoteConfigManager";
     this.XML      = loader.openTextFile("unibillInventory.json").ReadToEnd();
     Config        = new UnibillConfiguration(XML, platform, logger);
     if (Config.UseHostedConfig)
     {
         string val = storage.GetString(CACHED_CONFIG_PATH, string.Empty);
         if (string.IsNullOrEmpty(val))
         {
             logger.Log("No cached config available. Using bundled");
         }
         else
         {
             logger.Log("Cached config found, attempting to parse");
             try {
                 Config = new UnibillConfiguration(val, platform, logger);
                 if (Config.inventory.Count == 0)
                 {
                     logger.LogError("No purchasable items in cached config, ignoring.");
                     Config = new UnibillConfiguration(XML, platform, logger);
                 }
                 else
                 {
                     logger.Log(string.Format("Using cached config with {0} purchasable items", Config.inventory.Count));
                     XML = val;
                 }
             } catch (Exception e) {
                 logger.LogError("Error parsing inventory: {0}", e.Message);
                 Config = new UnibillConfiguration(XML, platform, logger);
             }
         }
         refreshCachedConfig(Config.HostedConfigUrl, logger);
     }
     else
     {
         logger.Log("Not using cached inventory, using bundled.");
         Config = new UnibillConfiguration(XML, platform, logger);
     }
 }
コード例 #27
0
 public ProductIdRemapper(UnibillConfiguration config)
 {
     this.db = config;
     initialiseForPlatform(config.CurrentPlatform);
 }
コード例 #28
0
 public StorekitMassImportTemplateGenerator(UnibillConfiguration config, IEditorUtil util)
 {
     this.config = config;
     this.util = util;
 }
コード例 #29
0
 public StorekitMassImportTemplateGenerator(UnibillConfiguration config, IEditorUtil util)
 {
     this.config = config;
     this.util   = util;
 }
コード例 #30
0
 public RawBillingPlatformProvider(UnibillConfiguration config) {
     this.config = config;
 }
コード例 #31
0
 public GooglePlayCSVGenerator(IEditorUtil util, UnibillConfiguration config)
 {
     this.util   = util;
     this.config = config;
 }
コード例 #32
0
ファイル: Biller.cs プロジェクト: nhhoang/shooting
 private static UnibillConfiguration getConfig () {
     if (_config == null) {
         _config = new UnibillConfiguration(getResourceLoader(), getParser(), getUtil(), getLogger());
     }
     return _config;
 }
コード例 #33
0
 public AmazonJSONGenerator(UnibillConfiguration config)
 {
     this.config = config;
 }
コード例 #34
0
 public ProductIdRemapper(UnibillConfiguration config)
 {
     this.db = config;
     initialiseForPlatform(config.CurrentPlatform);
 }
コード例 #35
0
ファイル: ProductIdRemapper.cs プロジェクト: nhhoang/shooting
 public ProductIdRemapper (InventoryDatabase db, UnibillXmlParser parser, UnibillConfiguration config) {
     this.db = db;
     this.parser = parser;
     initialiseForPlatform(config.CurrentPlatform);
 }
コード例 #36
0
 public RawBillingPlatformProvider(UnibillConfiguration config)
 {
     this.config = config;
 }
コード例 #37
0
ファイル: CurrencyManager.cs プロジェクト: holagames/FightWar
 public CurrencyManager(UnibillConfiguration config, IStorage storage)
 {
     this.storage = storage;
     this.config  = config;
     Currencies   = config.currencies.Select <VirtualCurrency, string>(x => x.currencyId).ToArray();
 }
コード例 #38
0
 public RawBillingPlatformProvider(UnibillConfiguration config)
 {
     this.config = config;
     this.gameObject = new GameObject ();
 }
コード例 #39
0
 public GooglePlayCSVGenerator(IEditorUtil util, UnibillConfiguration config)
 {
     this.util = util;
     this.config = config;
 }
コード例 #40
0
 public RawBillingPlatformProvider(UnibillConfiguration config)
 {
     this.config     = config;
     this.gameObject = new GameObject();
 }
コード例 #41
0
 public SamsungAppsBillingService(UnibillConfiguration config, IRawSamsungAppsBillingService rawSamsung)
 {
     this.config     = config;
     this.rawSamsung = rawSamsung;
 }