Example #1
0
        public static void loadOdinData(string name)
        {
            DBG.blogWarning("Starting loding data");
            if (DevTool.DisableSaving)
            {
                OdinPlus.m_instance.isLoaded = true;
                return;
            }
            #region Serial
            string file = Path.Combine(Application.persistentDataPath, (name + ".odinplus"));
            if (!File.Exists(@file))
            {
                OdinPlus.m_instance.isLoaded = true;
                Credits = 100;
                DBG.blogWarning("Profile not exists:" + name);
                return;
            }

            FileStream fileStream = new FileStream(@file, FileMode.Open, FileAccess.Read);
            //BinaryFormatter formatter = new BinaryFormatter();
            //Data = (DataTable)formatter.Deserialize(fileStream);
            BinaryReader binaryReader = new BinaryReader(fileStream);
            var          str          = binaryReader.ReadString();
            Data = JsonConvert.DeserializeObject <DataTable>(str);
            fileStream.Close();
            #endregion Serial

            #region Load
            Credits = Data.Credits;
            QuestManager.instance.Load();
            LocationManager.BlackList = Data.BlackList;
            LocationManager.RemoveBlackList();
            #endregion Load

            OdinPlus.m_instance.isLoaded = true;
            DBG.blogWarning("OdinDataLoaded:" + name);
        }
 private void Awake()
 {
     instance      = this;
     Plugin.RegRPC = (Action)Delegate.Combine(Plugin.RegRPC, (Action)initRPC);
 }
Example #3
0
 private static void Postfix()
 {
     RegRPC();
     LocationManager.RequestServerFop();
 }