Esempio n. 1
0
    /// <summary>
    /// Initialize this instance.
    /// We must follow special sequnce.
    /// </summary>
    public static void Initialize()
    {
        //Initial sequnce

        //DataPersisteManager should be initialize first. and tell the non-account path
        Core.DPM = DataPersistManager.getInstance(DeviceInfo.PersistRootPath);
        //Timer should run.
        Core.TimerEng = new TimerMaster();
        //Sound manager.
        Core.SoundEng = SoundEngine.GetSingleton();
        //EventCenter must initialize later than Network Engine
        Core.NetEng = new NetworkEngine();
        //EventCenter also must initialize later than Aysnc Engine
        Core.AsyncEng = AsyncTask.Current;

        Core.EVC = new EventCenter();
        Core.EVC.RegisterToHttpEngine(Core.NetEng.httpEngine);
        Core.EVC.RegisterToSockEngine(Core.NetEng.SockEngine);

        ResEng = new ResourceManager();
        ResEng.RegisterAM(ManagerType.ModelManager, new SplitModelLoader());
        Core.Data = new DataCore();

        //registe some vars.
        HttpRequestFactory.swInfo     = SoftwareInfo.VersionCode;
        HttpRequestFactory.platformId = SoftwareInfo.PlatformId;
    }
    public MovableNoticeManager()
    {
        cached    = new List <NoticeDataConfig>();
        sentTimes = 0;
        curIndex  = 0;

        persist = Core.DPM;
    }
Esempio n. 3
0
 public static DataPersistManager getInstance(string basePath)
 {
     if (dsManager == null)
     {
         dsManager = new DataPersistManager(basePath);
     }
     return(dsManager);
 }
Esempio n. 4
0
 public void record(DataPersistManager persist)
 {
     if (persist != null)
     {
         mType = DataType.CRASH_TYPE;
         persist.AppendToLocalFileSystem(this, NO_ENCRYPT);
     }
 }
 public void save(DataPersistManager persist, HttpDataNoElement[] data)
 {
     if (data != null)
     {
         httpNo = data;
         mType  = DataType.HTTP_COMPLETE;
         persist.WriteToLocalFileSystem(this, AES_ENCRYPT);
     }
 }
Esempio n. 6
0
    void ICore.OnLogin(Object dpm)
    {
        if (dpm != null)
        {
            DataPersistManager dataManager = dpm as DataPersistManager;

            httpDataCom = new HttpData_Completeness(dataManager);
        }
        else
        {
            throw new DragonException("HttpThread OnLogin Param must be DataPersistManager");
        }
    }
    public static void load(DataPersistManager persist, out Dictionary <int, int> HttpDataNo)
    {
        HttpDataNo = new Dictionary <int, int>();

        HttpData_No db = persist.ReadFromLocalFileSystem(DataType.HTTP_COMPLETE, AES_ENCRYPT) as HttpData_No;

        if (db != null)
        {
            foreach (HttpDataNoElement element in db.httpNo)
            {
                HttpDataNo.Add(element.act, element.no);
            }
        }
    }
Esempio n. 8
0
    public AccountConfigManager()
    {
        accInfo = null;
        persist = Core.DPM;

        accInfo = persist.ReadFromLocalFileSystem(DataType.ACCOUNT_CONFIG, AES_ENCRYPT) as AccountConfigData;
        if (accInfo == null)
        {
            accInfo = new AccountConfigData();
            accInfo.DefaultValue();
        }

        accInfo.mType = DataType.ACCOUNT_CONFIG;
    }
    public UserConfigManager()
    {
        userInfo = null;
        persist  = Core.DPM;

        userInfo = persist.ReadFromLocalFileSystem(DataType.USER_CONFIG, AES_ENCRYPT) as UserConfigData;
        if (userInfo == null)
        {
            userInfo = new UserConfigData();
            userInfo.DefaultValue();
        }

        userInfo.mType = DataType.USER_CONFIG;
    }
    void ICore.Reset()
    {
        List <HttpDataNoElement> list = new List <HttpDataNoElement>();

        foreach (int key in HttpDataNo.Keys)
        {
            list.Add(new HttpDataNoElement(HttpDataNo[key], key));
        }

        if (list.Count > 0)
        {
            HttpData_No completness = new HttpData_No();
            completness.save(persistManager, list.ToArray());
        }

        if (HttpDataNo != null)
        {
            HttpDataNo.Clear();
            HttpDataNo = null;
        }

        persistManager = null;
    }
Esempio n. 11
0
 public NewworkObj(DataPersistManager dataPm, DnsEndPoint point)
 {
     dpm = dataPm;
     dep = point;
 }
 public HttpData_Completeness(DataPersistManager persist)
 {
     persistManager = persist;
     HttpData_No.load(persistManager, out HttpDataNo);
 }