Exemplo n.º 1
0
    public void ChangeTutorialstoryClear(eStoryState _state)
    {
        //AESKeyAndIV keyIv = SaveSystem.LoadAESKeyAndIV();

        TutorialStoryClear[(int)_state] =
            AESSecurity.Encrypt_ToBytes_Aes <bool>(true, keyIV.Key, keyIV.IV);
    }
Exemplo n.º 2
0
    public void ChangeStageBossTime(eStageKind _kind)
    {
        //AESKeyAndIV keyIV = SaveSystem.LoadAESKeyAndIV();

        UserStageBossTime[(int)_kind] = AESSecurity.Encrypt_ToBytes_Aes <string>(
            DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), keyIV.Key, keyIV.IV);
    }
Exemplo n.º 3
0
    public void UserBuildingLevel_LevelUp(eBuildingKind _Kind)
    {
        //AESKeyAndIV keyIV = SaveSystem.LoadAESKeyAndIV();

        int currentLevel = AESSecurity.DecryptIntFromBytes_Aes(UserBuildingLevel[(int)_Kind], keyIV.Key, keyIV.IV);

        UserBuildingLevel[(int)_Kind] = AESSecurity.Encrypt_ToBytes_Aes <int>(currentLevel + 1, keyIV.Key, keyIV.IV);
    }
Exemplo n.º 4
0
    public void ChangeUserGold(int _inputGold)
    {
        //AESKeyAndIV keyIV = SaveSystem.LoadAESKeyAndIV();

        int currentGold = GetUserGold();

        UserGold = AESSecurity.Encrypt_ToBytes_Aes <int>(currentGold + _inputGold, keyIV.Key, keyIV.IV);
        GoodsSceneInstance.Instance.RenewalUI_Gold();
    }
Exemplo n.º 5
0
    public User()
    {
        using (Aes aesAlg = Aes.Create())
        {
            keyIV = SaveSystem.LoadAESKeyAndIV();

            if (SaveSystem.LoadAESKeyAndIV() != null)
            {
                aesAlg.Key = keyIV.Key;
                aesAlg.IV  = keyIV.IV;
            }
            else if (SaveSystem.LoadAESKeyAndIV() == null)
            {
                keyIV = new AESKeyAndIV(aesAlg.Key, aesAlg.IV);
                SaveSystem.SaveAESKeyAndIV(aesAlg.Key, aesAlg.IV);
            }

            // User Info
            //UserGold = 1000;
            //UserJam = 10;
            //TutorialStoyClear = new bool[(int)eStoryState.END];
            //for (int i = 0; i < (int)eStoryState.END; i++)
            //{
            //    TutorialStoyClear[i] = false;
            //}
            UserGold           = AESSecurity.Encrypt_ToBytes_Aes <int>(1000, aesAlg.Key, aesAlg.IV);
            UserJam            = AESSecurity.Encrypt_ToBytes_Aes <int>(10, aesAlg.Key, aesAlg.IV);
            TutorialStoryClear = new List <byte[]>();
            for (int i = 0; i < (int)eStoryState.END; i++)
            {
                TutorialStoryClear.Add(AESSecurity.Encrypt_ToBytes_Aes <bool>(false, aesAlg.Key, aesAlg.IV));
            }

            // Hero Info

            /*
             * UserAbilityLevel = new int[(int)eHeroAbilityKind.END];
             * for (int i = 0; i < (int)eHeroAbilityKind.END; i++)
             * {
             *  UserAbilityLevel[i] = 1;
             * }
             *
             * UserSkillLevel = new int[(int)eHeroAbilityKind.END];
             * for (int i = 0; i < (int)eHeroSkillKind.END; i++)
             * {
             *  UserSkillLevel[i] = 1;
             * }
             *
             * UserBuildingLevel = new int[(int)eHeroAbilityKind.END];
             * for (int i = 0; i < (int)eBuildingKind.END; i++)
             * {
             *  UserBuildingLevel[i] = 1;
             * }
             *
             * UserIsUnlockSkill = new bool[(int)eHeroSkillKind.END];
             * for (int i = 0; i < (int)eHeroSkillKind.END; i++)
             * {
             *  // 임시로 스매시 스킬 언락
             *  if (i == 0)
             *  {
             *      UserIsUnlockSkill[i] = true;
             *  }
             *  else
             *  {
             *      UserIsUnlockSkill[i] = false;
             *  }
             * }
             */
            UserAbilityLevel = new List <byte[]>();
            for (int i = 0; i < (int)eHeroAbilityKind.END; i++)
            {
                UserAbilityLevel.Add(AESSecurity.Encrypt_ToBytes_Aes <int>(1, aesAlg.Key, aesAlg.IV));
            }
            UserSkillLevel = new List <byte[]>();
            for (int i = 0; i < (int)eHeroSkillKind.END; i++)
            {
                UserSkillLevel.Add(AESSecurity.Encrypt_ToBytes_Aes <int>(1, aesAlg.Key, aesAlg.IV));
            }
            UserBuildingLevel = new List <byte[]>();
            for (int i = 0; i < (int)eBuildingKind.END; i++)
            {
                UserBuildingLevel.Add(AESSecurity.Encrypt_ToBytes_Aes <int>(1, aesAlg.Key, aesAlg.IV));
            }
            UserIsUnlockSkill = new List <byte[]>();
            for (int i = 0; i < (int)eHeroSkillKind.END; i++)
            {
                if (i == 0)
                {
                    UserIsUnlockSkill.Add(AESSecurity.Encrypt_ToBytes_Aes <bool>(true, aesAlg.Key, aesAlg.IV));
                }
                UserIsUnlockSkill.Add(AESSecurity.Encrypt_ToBytes_Aes <bool>(false, aesAlg.Key, aesAlg.IV));
            }

            // Stage Info

            /*
             * UserIsStageOpen = new bool[(int)eStageKind.END];
             * {
             *  for (int i = 0; i < (int)eStageKind.END; i++)
             *  {
             *      if (i == 0)
             *      {
             *          UserIsStageOpen[i] = true;  // Stage1은 처음부터 열려있다.
             *      }
             *      else if (i == 1)
             *      {
             *          UserIsStageOpen[i] = false;  // 임시로 열어둠
             *      }
             *      else
             *      {
             *          UserIsStageOpen[i] = false;
             *      }
             *  }
             * }
             *
             * UserStageBossShow = new bool[(int)eStageKind.END];
             * for (int i = 0; i < (int)eStageKind.END; i++)
             * {
             *  //UserStageBossShow[i] = false;
             *  if (i == 0)
             *  {
             *      UserStageBossShow[i] = false;    // 임의로 열어놓음
             *  }
             *  else
             *  {
             *      UserStageBossShow[i] = false;
             *  }
             * }
             *
             * UserStageBossClear = new bool[(int)eStageKind.END];
             * for (int i = 0; i < (int)eStageKind.END; i++)
             * {
             *  UserStageBossClear[i] = false;
             * }
             *
             * UserStageBossTime = new string[(int)eStageKind.END];
             * for (int i = 0; i < (int)eStageKind.END; i++)
             * {
             *  // 현재 시간 - 1Day 으로 저장
             *  UserStageBossTime[i] = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd HH:mm:ss");
             * }
             */

            UserIsStageOpen = new List <byte[]>();
            for (int i = 0; i < (int)eStageKind.END; i++)
            {
                if (i == 0)
                {
                    UserIsStageOpen.Add(AESSecurity.Encrypt_ToBytes_Aes <bool>(true, aesAlg.Key, aesAlg.IV));
                }
                else
                {
                    UserIsStageOpen.Add(AESSecurity.Encrypt_ToBytes_Aes <bool>(false, aesAlg.Key, aesAlg.IV));
                }
            }
            UserStageBossShow = new List <byte[]>();
            for (int i = 0; i < (int)eStageKind.END; i++)
            {
                UserStageBossShow.Add(AESSecurity.Encrypt_ToBytes_Aes <bool>(false, aesAlg.Key, aesAlg.IV));
            }
            UserStageBossClear = new List <byte[]>();
            for (int i = 0; i < (int)eStageKind.END; i++)
            {
                UserStageBossClear.Add(AESSecurity.Encrypt_ToBytes_Aes <bool>(false, aesAlg.Key, aesAlg.IV));
            }
            UserStageBossTime = new List <byte[]>();
            for (int i = 0; i < (int)eStageKind.END; i++)
            {
                UserStageBossTime.Add(AESSecurity.Encrypt_ToBytes_Aes <string>(
                                          DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd HH:mm:ss"), aesAlg.Key, aesAlg.IV));
            }

            // Option Info
            BGMVolume = 1.0f;
            BGMMute   = false;
            SFxVolume = 1.0f;
            SFxMute   = false;
        }
    }
Exemplo n.º 6
0
    public void ChangeUserStageBossClear(eStageKind _kind)
    {
        //AESKeyAndIV keyIV = SaveSystem.LoadAESKeyAndIV();

        UserStageBossClear[(int)_kind] = AESSecurity.Encrypt_ToBytes_Aes <bool>(true, keyIV.Key, keyIV.IV);
    }
Exemplo n.º 7
0
    public void ChangeUserIsStageOpen(eStageKind _Kind)
    {
        //AESKeyAndIV keyIV = SaveSystem.LoadAESKeyAndIV();

        UserIsStageOpen[(int)_Kind] = AESSecurity.Encrypt_ToBytes_Aes <bool>(true, keyIV.Key, keyIV.IV);
    }
Exemplo n.º 8
0
    public void ChangeUserIsUnlockSkill(eHeroSkillKind _Kind)
    {
        //AESKeyAndIV keyIV = SaveSystem.LoadAESKeyAndIV();

        UserIsUnlockSkill[(int)_Kind] = AESSecurity.Encrypt_ToBytes_Aes <bool>(true, keyIV.Key, keyIV.IV);
    }