Esempio n. 1
0
        protected void Initialize()
        {
            Dix = DixInfo.Load();
            try
            {
                GameData = RaqnData.LoadOrCreate <RaqnData>(Dix.Id + ".json", true);
                //GeneralStats = StatContainer.LoadOrDie("General");
            }
            catch (Exception _ex)
            {
                Debug.LogException(_ex);
                Debug.LogError("Could not load DixData. Quitting app! (Exception :" + _ex.Message + ")");
                RealQuit();
            }
            Api = new RaqnApi(Dix.Id, Dix.Secret);
            Api.OnStartSuccess += OnLogin_Success;
            Api.OnStartError   += OnLogin_Error;
            Api.OnLoginSuccess += OnLogin_Success;
            Api.OnLoginError   += OnLogin_Error;
            Api.OnPlaySuccess  += OnPlay_Success;
            Api.OnPlayError    += OnPlay_Error;

            ApiSession = new RaqnApiSession();

            local_login   = RaqnStorage.LoadJson <RaqnLogin>("cache/login.dat", false, Dix.Secret);
            local_license = RaqnStorage.LoadJson <RaqnLicense>("cache/license.dat", false, Dix.Secret);
        }
Esempio n. 2
0
        public static DixInfo Load()
        {
            TextAsset _dixtext = Resources.Load("RAQN/dix") as TextAsset;
            DixInfo   _dix     = null;

            if (_dixtext != null)
            {
                _dix = RaqnSerializer.JsonDeserialize <DixInfo>(_dixtext.text);
            }
            if (_dix == null)
            {
                Debug.Log("Cannot Load DixInfo.json!");
                Raqn.Quit();
            }
            return(_dix);
        }