feat(cordis): 接入上下文组合与模组事务热替换

This commit is contained in:
2026-08-16 23:20:40 +08:00
commit ad256f109b
676 changed files with 52168 additions and 0 deletions
@@ -0,0 +1,31 @@
#nullable enable
using ShrinkEventBus;
namespace ShrinkNetwork.Integration
{
public readonly struct ShrinkNetworkEventRequestOutcome
{
public ShrinkNetworkEventRequestOutcome(int errorCode, string errorMessage, EventResult result, bool isCanceled)
{
ErrorCode = errorCode;
ErrorMessage = errorMessage ?? string.Empty;
Result = result;
IsCanceled = isCanceled;
}
public int ErrorCode { get; }
public string ErrorMessage { get; }
public EventResult Result { get; }
public bool IsCanceled { get; }
public bool IsSuccess => ErrorCode == 0;
internal static ShrinkNetworkEventRequestOutcome FromResponse(ShrinkNetworkEventResultResponse response)
{
return new ShrinkNetworkEventRequestOutcome(
response?.ErrorCode ?? ShrinkRpcErrorCode.InvalidResponse,
response?.ErrorMessage ?? "Network event request returned an invalid response.",
response?.Result ?? EventResult.DEFAULT,
response?.IsCanceled ?? false);
}
}
}