파일 암호화
This commit is contained in:
parent
c82a57dad0
commit
fdbac82f26
|
|
@ -320,7 +320,11 @@ public partial class DBManager : MonoBehaviour
|
|||
this.saveData = new SaveData();
|
||||
saveData.Initialize();
|
||||
|
||||
SaveData loadData = ES3.Load<SaveData>(SAVE_KEY, defaultValue: null);
|
||||
SaveData loadData = ES3.Load<SaveData>(SAVE_KEY, defaultValue: null, new ES3Settings()
|
||||
{
|
||||
encryptionType = ES3.EncryptionType.AES, // AES 또는 XOR 사용 가능
|
||||
encryptionPassword = "MyStrongPassword123" // 원하는 암호
|
||||
});
|
||||
|
||||
if (loadData != null)
|
||||
{
|
||||
|
|
@ -353,7 +357,11 @@ public partial class DBManager : MonoBehaviour
|
|||
{
|
||||
if (CompleteDataLoad)
|
||||
{
|
||||
ES3.Save(SAVE_KEY, this.saveData);
|
||||
ES3.Save(SAVE_KEY, this.saveData, new ES3Settings()
|
||||
{
|
||||
encryptionType = ES3.EncryptionType.AES, // AES 또는 XOR 사용 가능
|
||||
encryptionPassword = "MyStrongPassword123" // 원하는 암호
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -361,7 +369,11 @@ public partial class DBManager : MonoBehaviour
|
|||
{
|
||||
if (CompleteDataLoad)
|
||||
{
|
||||
return ES3.KeyExists(SAVE_KEY);
|
||||
return ES3.KeyExists(SAVE_KEY, new ES3Settings()
|
||||
{
|
||||
encryptionType = ES3.EncryptionType.AES,
|
||||
encryptionPassword = "MyStrongPassword123" // 원하는 암호
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -163,7 +163,11 @@ public class TimerManager : MonoBehaviour
|
|||
if (info != null)
|
||||
{
|
||||
info.saveTimeData = InternetTime.Ins.Time;
|
||||
ES3.Save<SimpleTimerInfo>(sb.ToString(), info, "TimerData.json");
|
||||
ES3.Save<SimpleTimerInfo>(sb.ToString(), info, "TimerData.json", new ES3Settings()
|
||||
{
|
||||
encryptionType = ES3.EncryptionType.AES, // AES 또는 XOR 사용 가능
|
||||
encryptionPassword = "MyStrongPassword123" // 원하는 암호
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -179,17 +183,29 @@ public class TimerManager : MonoBehaviour
|
|||
if (info != null)
|
||||
{
|
||||
info.saveTimeData = InternetTime.Ins.Time;
|
||||
ES3.Save<HierarchyTimerInfo>(sb.ToString(), info, "TimerData.json");
|
||||
ES3.Save<HierarchyTimerInfo>(sb.ToString(), info, "TimerData.json", new ES3Settings()
|
||||
{
|
||||
encryptionType = ES3.EncryptionType.AES, // AES 또는 XOR 사용 가능
|
||||
encryptionPassword = "MyStrongPassword123" // 원하는 암호
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadAllTimerInfo()
|
||||
{
|
||||
if (ES3.KeyExists("TimerData.json"))
|
||||
if (ES3.KeyExists("TimerData.json", new ES3Settings()
|
||||
{
|
||||
encryptionType = ES3.EncryptionType.AES,
|
||||
encryptionPassword = "MyStrongPassword123" // 원하는 암호
|
||||
}))
|
||||
{
|
||||
TimerInfo info = new TimerInfo();
|
||||
info = ES3.Load<TimerInfo>("TimerData.json");
|
||||
info = ES3.Load<TimerInfo>("TimerData.json", new ES3Settings()
|
||||
{
|
||||
encryptionType = ES3.EncryptionType.AES, // AES 또는 XOR 사용 가능
|
||||
encryptionPassword = "MyStrongPassword123" // 원하는 암호
|
||||
});
|
||||
|
||||
timerInfoDictionary.Add(info.OwnerName, info);
|
||||
}
|
||||
|
|
@ -203,7 +219,11 @@ public class TimerManager : MonoBehaviour
|
|||
if (ES3.KeyExists(sb.ToString(), "TimerData.json"))
|
||||
{
|
||||
SimpleTimerInfo info = new SimpleTimerInfo(ownerName);
|
||||
info = ES3.Load<SimpleTimerInfo>(sb.ToString(), "TimerData.json");
|
||||
info = ES3.Load<SimpleTimerInfo>(sb.ToString(), "TimerData.json", new ES3Settings()
|
||||
{
|
||||
encryptionType = ES3.EncryptionType.AES, // AES 또는 XOR 사용 가능
|
||||
encryptionPassword = "MyStrongPassword123" // 원하는 암호
|
||||
});
|
||||
|
||||
info.ResetEvent();
|
||||
|
||||
|
|
@ -227,7 +247,11 @@ public class TimerManager : MonoBehaviour
|
|||
if (ES3.KeyExists(sb.ToString(), "TimerData.json"))
|
||||
{
|
||||
HierarchyTimerInfo info = new HierarchyTimerInfo(ownerName);
|
||||
info = ES3.Load<HierarchyTimerInfo>(sb.ToString(), "TimerData.json");
|
||||
info = ES3.Load<HierarchyTimerInfo>(sb.ToString(), "TimerData.json", new ES3Settings()
|
||||
{
|
||||
encryptionType = ES3.EncryptionType.AES, // AES 또는 XOR 사용 가능
|
||||
encryptionPassword = "MyStrongPassword123" // 원하는 암호
|
||||
});
|
||||
|
||||
info.ResetEvent();
|
||||
|
||||
|
|
@ -559,39 +583,35 @@ public class TimerManager : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
private const string TIME_KEY = "SavedTime";
|
||||
public void SaveTime()
|
||||
{
|
||||
sb.Clear();
|
||||
sb.Append(Application.persistentDataPath).Append("/Time.json");
|
||||
string fileName = Path.Combine(sb.ToString());
|
||||
|
||||
if (File.Exists(fileName))
|
||||
// 인터넷 시간을 저장
|
||||
ES3.Save<DateTime>(TIME_KEY, InternetTime.Ins.Time, new ES3Settings()
|
||||
{
|
||||
File.Delete(fileName);
|
||||
}
|
||||
|
||||
string jsonFile = JsonConvert.SerializeObject(InternetTime.Ins.Time);
|
||||
|
||||
File.WriteAllText(fileName, jsonFile);
|
||||
encryptionType = ES3.EncryptionType.AES,
|
||||
encryptionPassword = "MyStrongPassword123" // 원하는 암호
|
||||
});
|
||||
}
|
||||
|
||||
public DateTime LoadTime()
|
||||
{
|
||||
sb.Clear();
|
||||
sb.Append(Application.persistentDataPath).Append("/Time.json");
|
||||
string fileName = Path.Combine(sb.ToString());
|
||||
|
||||
if (File.Exists(fileName) == false)
|
||||
if (!ES3.KeyExists(TIME_KEY, new ES3Settings()
|
||||
{
|
||||
encryptionType = ES3.EncryptionType.AES,
|
||||
encryptionPassword = "MyStrongPassword123" // 원하는 암호
|
||||
}))
|
||||
{
|
||||
SaveTime();
|
||||
loadTime = InternetTime.Ins.Time;
|
||||
|
||||
return loadTime;
|
||||
}
|
||||
|
||||
string jsonFile = File.ReadAllText(fileName);
|
||||
loadTime = JsonConvert.DeserializeObject<DateTime>(jsonFile);
|
||||
|
||||
loadTime = ES3.Load<DateTime>(TIME_KEY, InternetTime.Ins.Time, new ES3Settings()
|
||||
{
|
||||
encryptionType = ES3.EncryptionType.AES,
|
||||
encryptionPassword = "MyStrongPassword123" // 원하는 암호
|
||||
});
|
||||
return loadTime;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -389,9 +389,8 @@ public partial class GamePanel : MonoBehaviour
|
|||
|
||||
void Set_Mission()
|
||||
{
|
||||
// 테스트 : 미션 100%
|
||||
//if (DSUtil.RandomTrue(0.1f + GameManager.DB.MissionAddRate))
|
||||
if (true)
|
||||
if (DSUtil.RandomTrue(0.1f + GameManager.DB.MissionAddRate))
|
||||
//if (true) // 테스트 : 미션 100%
|
||||
{
|
||||
GameManager.DB.Set_Mission(false);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue