Skip to content

Commit

Permalink
updated YooAsset and installed LoggingSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
michael811125 committed Aug 27, 2023
1 parent df3e9bb commit 6b2a7b4
Show file tree
Hide file tree
Showing 101 changed files with 1,588 additions and 411 deletions.
Binary file modified Assets/HotfixCollector/AOTDlls/UniTask.dll.bytes
Binary file not shown.
Binary file modified Assets/HotfixCollector/AOTDlls/mscorlib.dll.bytes
Binary file not shown.
Binary file not shown.
106 changes: 106 additions & 0 deletions Assets/HybridCLRData/Generated/AOTGenericReferences.cs

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions Assets/LoggerSetting.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0db32b67c3968d44c892c0d4cff28f39, type: 3}
m_Name: LoggerSetting
m_EditorClassIdentifier:
logMainActive: 1
loggerConfigs:
- loggerName: OxGFrame.GSIFrame.Logger
logActive: 1
- loggerName: OxGFrame.MediaFrame.Logger
logActive: 1
- loggerName: OxGFrame.AssetLoader.Logger
logActive: 1
- loggerName: OxGFrame.AgencyCenter.Logger
logActive: 1
- loggerName: OxGFrame.CoreFrame.Logger
logActive: 1
- loggerName: OxGFrame.NetFrame.Logger
logActive: 1
- loggerName: OxGFrame.Hotfixer.Logger
logActive: 1
resetLoggers: 0
8 changes: 8 additions & 0 deletions Assets/LoggerSetting.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static class Http
public delegate void ResponseHandle(string response);

/// <summary>
/// Synchronous C# and Xml = Acax
/// Callback C# and Xml = Acax
/// </summary>
/// <param name="url"></param>
/// <param name="method"></param>
Expand All @@ -25,7 +25,7 @@ public static void Acax(string url, string method, string[,] headers, object[,]
}

/// <summary>
/// Asynchronous C# and Xml = Acax
/// Asynchronous with Callback C# and Xml = Acax
/// </summary>
/// <param name="url"></param>
/// <param name="method"></param>
Expand Down
17 changes: 14 additions & 3 deletions Assets/OxGFrame/AgencyCenter/Scripts/Runtime/Common/CenterBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using OxGKit.LoggingSystem;
using System.Collections.Generic;
using UnityEngine;

namespace OxGFrame.AgencyCenter
Expand Down Expand Up @@ -47,6 +48,11 @@ public static void Delete(int id)
GetInstance().Remove(id);
}

public static void DeleteAll()
{
GetInstance().RemoveAll();
}

public static UClass Find<UClass>() where UClass : TClass
{
return GetInstance().Get<UClass>();
Expand Down Expand Up @@ -105,7 +111,7 @@ public void Register(int id, TClass @class)
{
if (this.HasInCache(id))
{
Debug.Log(string.Format("<color=#FF0000>Repeat registration. Id: {0}, Reg: {1}</color>", id, @class.GetType().Name));
Logging.Print<Logger>(string.Format("<color=#FF0000>Repeat registration. Id: {0}, Reg: {1}</color>", id, @class.GetType().Name));
return;
}

Expand All @@ -128,11 +134,16 @@ public void Remove(int id)
}
}

public void RemoveAll()
{
if (this._cache.Count > 0) this._cache.Clear();
}

protected TClass GetFromCache(int id)
{
if (!this.HasInCache(id))
{
Debug.Log(string.Format("<color=#FF0000>Cannot found. Id: {0}</color>", id));
Logging.Print<Logger>(string.Format("<color=#FF0000>Cannot found. Id: {0}</color>", id));
return default;
}

Expand Down
7 changes: 7 additions & 0 deletions Assets/OxGFrame/AgencyCenter/Scripts/Runtime/Logger.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using OxGKit.LoggingSystem;

namespace OxGFrame.AgencyCenter
{
[LoggerName("OxGFrame.AgencyCenter.Logger")]
public class Logger : Logging { }
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"rootNamespace": "",
"references": [
"GUID:f51ebe6a0ceec4240a699833d6309b23",
"GUID:e34a5702dd353724aa315fb8011f08c3"
"GUID:e34a5702dd353724aa315fb8011f08c3",
"GUID:981f0bbbcbf62b74c9821862b0cd0202"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal static BundleCryptogramUtilityWindow GetInstance()
[SerializeField]
public string sourceFolder;

private CryptogramSetting _settings;
private CryptogramSetting _setting;

internal static string PROJECT_PATH;
internal static string KEY_SAVER;
Expand All @@ -52,22 +52,22 @@ public static void ShowWindow()

private void OnEnable()
{
this._settings = EditorTool.LoadSettingData<CryptogramSetting>();
this._setting = EditorTool.LoadSettingData<CryptogramSetting>();
this._LoadSettingsData();
this.sourceFolder = EditorStorage.GetData(KEY_SAVER, $"sourceFolder", Path.Combine($"{Application.dataPath}/", AssetBundleBuilderHelper.GetDefaultBuildOutputRoot()));
this.cryptogramType = (CryptogramType)Convert.ToInt32(EditorStorage.GetData(KEY_SAVER, "cryptogramType", "0"));
}

private void _LoadSettingsData()
{
this.randomSeed = this._settings.randomSeed;
this.dummySize = this._settings.dummySize;
this.xorKey = this._settings.xorKey;
this.hXorKey = this._settings.hXorKey;
this.tXorKey = this._settings.tXorKey;
this.jXorKey = this._settings.jXorKey;
this.aesKey = this._settings.aesKey;
this.aesIv = this._settings.aesIv;
this.randomSeed = this._setting.randomSeed;
this.dummySize = this._setting.dummySize;
this.xorKey = this._setting.xorKey;
this.hXorKey = this._setting.hXorKey;
this.tXorKey = this._setting.tXorKey;
this.jXorKey = this._setting.jXorKey;
this.aesKey = this._setting.aesKey;
this.aesIv = this._setting.aesIv;
}

private void OnDisable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal static CryptogramSettingWindow GetInstance()
[SerializeField]
public CryptogramType cryptogramType;

private CryptogramSetting _settings;
private CryptogramSetting _setting;
private bool _isDirty = false;

internal static string PROJECT_PATH;
Expand All @@ -48,7 +48,7 @@ public static void ShowWindow()
private void OnEnable()
{
this._isDirty = false;
this._settings = EditorTool.LoadSettingData<CryptogramSetting>();
this._setting = EditorTool.LoadSettingData<CryptogramSetting>();
this._LoadSettingsData();
this.cryptogramType = (CryptogramType)Convert.ToInt32(EditorStorage.GetData(KEY_SAVER, "cryptogramType", "0"));
}
Expand All @@ -74,14 +74,14 @@ private void OnGUI()

private void _LoadSettingsData()
{
this.randomSeed = this._settings.randomSeed;
this.dummySize = this._settings.dummySize;
this.xorKey = this._settings.xorKey;
this.hXorKey = this._settings.hXorKey;
this.tXorKey = this._settings.tXorKey;
this.jXorKey = this._settings.jXorKey;
this.aesKey = this._settings.aesKey;
this.aesIv = this._settings.aesIv;
this.randomSeed = this._setting.randomSeed;
this.dummySize = this._setting.dummySize;
this.xorKey = this._setting.xorKey;
this.hXorKey = this._setting.hXorKey;
this.tXorKey = this._setting.tXorKey;
this.jXorKey = this._setting.jXorKey;
this.aesKey = this._setting.aesKey;
this.aesIv = this._setting.aesIv;
}

private void _CryptogramType(CryptogramType cryptogramType)
Expand Down Expand Up @@ -259,31 +259,31 @@ private void _SaveData(CryptogramType cryptogramType, bool isShowDialog = false)
switch (cryptogramType)
{
case CryptogramType.OFFSET:
this._settings.randomSeed = this.randomSeed;
this._settings.dummySize = this.dummySize;
this._setting.randomSeed = this.randomSeed;
this._setting.dummySize = this.dummySize;

this._isDirty = false;
EditorUtility.SetDirty(this._settings);
EditorUtility.SetDirty(this._setting);
AssetDatabase.SaveAssets();

if (isShowDialog) EditorUtility.DisplayDialog("Crytogram Message", "Saved [OFFSET] Setting.", "OK");
break;
case CryptogramType.XOR:
this._settings.xorKey = (byte)this.xorKey;
this._setting.xorKey = (byte)this.xorKey;

this._isDirty = false;
EditorUtility.SetDirty(this._settings);
EditorUtility.SetDirty(this._setting);
AssetDatabase.SaveAssets();

if (isShowDialog) EditorUtility.DisplayDialog("Crytogram Message", "Saved [XOR] Setting.", "OK");
break;
case CryptogramType.HT2XOR:
this._settings.hXorKey = (byte)this.hXorKey;
this._settings.tXorKey = (byte)this.tXorKey;
this._settings.jXorKey = (byte)this.jXorKey;
this._setting.hXorKey = (byte)this.hXorKey;
this._setting.tXorKey = (byte)this.tXorKey;
this._setting.jXorKey = (byte)this.jXorKey;

this._isDirty = false;
EditorUtility.SetDirty(this._settings);
EditorUtility.SetDirty(this._setting);
AssetDatabase.SaveAssets();

if (isShowDialog) EditorUtility.DisplayDialog("Crytogram Message", "Saved [Head-Tail 2 XOR] Setting.", "OK");
Expand All @@ -295,11 +295,11 @@ private void _SaveData(CryptogramType cryptogramType, bool isShowDialog = false)
break;
}

this._settings.aesKey = this.aesKey;
this._settings.aesIv = this.aesIv;
this._setting.aesKey = this.aesKey;
this._setting.aesIv = this.aesIv;

this._isDirty = false;
EditorUtility.SetDirty(this._settings);
EditorUtility.SetDirty(this._setting);
AssetDatabase.SaveAssets();

if (isShowDialog) EditorUtility.DisplayDialog("Crytogram Message", "Saved [AES] Setting.", "OK");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ namespace OxGFrame.AssetLoader.Editor
{
public static class CryptogramSettingSetup
{
public static CryptogramSetting cryptogramSettings;
public static CryptogramSetting cryptogramSetting;

public static CryptogramSetting GetCryptogramSettings()
public static CryptogramSetting GetCryptogramSetting()
{
if (cryptogramSettings == null) cryptogramSettings = EditorTool.LoadSettingData<CryptogramSetting>();
return cryptogramSettings;
if (cryptogramSetting == null) cryptogramSetting = EditorTool.LoadSettingData<CryptogramSetting>();
return cryptogramSetting;
}
}

public class OffSetEncryption : IEncryptionServices
{
public EncryptResult Encrypt(EncryptFileInfo fileInfo)
{
var cryptogramSettings = CryptogramSettingSetup.GetCryptogramSettings();
var cryptogramSettings = CryptogramSettingSetup.GetCryptogramSetting();

string filePath = fileInfo.FilePath;

Expand Down Expand Up @@ -51,7 +51,7 @@ public class XorEncryption : IEncryptionServices
{
public EncryptResult Encrypt(EncryptFileInfo fileInfo)
{
var cryptogramSettings = CryptogramSettingSetup.GetCryptogramSettings();
var cryptogramSettings = CryptogramSettingSetup.GetCryptogramSetting();

string filePath = fileInfo.FilePath;

Expand Down Expand Up @@ -81,7 +81,7 @@ public class HT2XorEncryption : IEncryptionServices
{
public EncryptResult Encrypt(EncryptFileInfo fileInfo)
{
var cryptogramSettings = CryptogramSettingSetup.GetCryptogramSettings();
var cryptogramSettings = CryptogramSettingSetup.GetCryptogramSetting();

string filePath = fileInfo.FilePath;

Expand Down Expand Up @@ -113,7 +113,7 @@ public class AesEncryption : IEncryptionServices
{
public EncryptResult Encrypt(EncryptFileInfo fileInfo)
{
var cryptogramSettings = CryptogramSettingSetup.GetCryptogramSettings();
var cryptogramSettings = CryptogramSettingSetup.GetCryptogramSetting();

string filePath = fileInfo.FilePath;

Expand Down
Loading

0 comments on commit 6b2a7b4

Please sign in to comment.