Beispiel #1
0
 public void record(LocalIOManager persist)
 {
     if (persist != null)
     {
         mType = DataType.CRASH_TYPE;
         persist.AppendToLocalFileSystem(this, NO_ENCRYPT);
     }
 }
 public void save(LocalIOManager persist, HttpDataNoElement[] data)
 {
     if (data != null)
     {
         httpNo         = data;
         mType          = DataType.HTTP_COMPLETE;
         KindOfRelevant = Relevant.AccountRelevant;
         persist.WriteToLocalFileSystem(this, AES_ENCRYPT);
     }
 }
    public static void load(LocalIOManager persist, out Dictionary <int, int> HttpDataNo)
    {
        HttpDataNo = new Dictionary <int, int>();

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

        if (db != null)
        {
            foreach (HttpDataNoElement element in db.httpNo)
            {
                HttpDataNo.Add(element.act, element.no);
            }
        }
    }
Beispiel #4
0
    /// <summary>
    /// Initialize this instance.
    /// We must follow special sequnce.
    /// 仅且仅初始化一次
    /// </summary>
    public static void Initialize(EngineCfg cfg)
    {
        ConsoleEx.DebugLog("Core Engine is initializing ....", ConsoleEx.YELLOW);
        //Initial sequnce
        DevFSM  = DeviceFSM.Instance;
        GameFSM = GamePlayFSM.Instance;
        EngCfg  = cfg;

        if (GameFSM.InitOK == Consts.FAILURE)
        {
            //Have one NetMQContext ONLY. This will be used to created ALL sockets within the process.
            ZeroMQ = NetMQContext.Create();

            //DataPersisteManager should be initialize first. and tell the non-account path
            DPM = LocalIOManager.getInstance(DeviceInfo.PersistRootPath);
            //Unity UI Basically Manager
            EntityMgr = new EntityManager();
            //Timer should run.
            TimerEng = new TimerMaster();
            //Sound manager.
            SoundEng = SoundEngine.GetSingleton();
            //EventCenter must initialize later than Network Engine
            NetEng = new NetworkEngine();
            //EventCenter also must initialize later than Aysnc Engine
            AsyncEng = AsyncTask.Current;
            //Coroutine
            Coroutine = CoroutineProvider.Instance();

            EVC    = new EventCenter(NetEng.httpEngine, NetEng.SockEngine, EntityMgr);
            ResEng = new Loader();

            Data = new DataCore();

            //register some vars.
            CoreParam();
        }
        else
        {
            //TODO: 此分支是初始化一次OK后,注销之后进入的分支情况
        }

        RegisterInterface();
        ConsoleEx.DebugLog("Core Engine is initialized ....", ConsoleEx.YELLOW);
        GameFSM.OnInitOk();
    }
 public HttpData_Completeness(LocalIOManager persist)
 {
     persistManager = persist;
     HttpData_No.load(persistManager, out HttpDataNo);
 }