feat(sdk): migrate to EventBus 2.0
Replace the legacy EventBase runtime with generated multi-bus bindings and explicit scheduling. Migrate app, data, network, demo, and mod consumers; add generated network-event registration and owner-scoped mod content overrides.
This commit is contained in:
@@ -23,7 +23,7 @@ internal static class ShrinkNetworkSemanticScanner
|
||||
private const string MessageInterfaceName = "ShrinkNetwork.IShrinkNetworkMessage";
|
||||
private const string RequestInterfaceName = "ShrinkNetwork.IShrinkNetworkRequest";
|
||||
private const string ResponseBaseName = "ShrinkNetwork.ShrinkRpcResponseBase";
|
||||
private const string HasResultAttributeName = "ShrinkEventBus.HasResultAttribute";
|
||||
private const string ResultEventInterfaceName = "ShrinkEventBus.IShrinkResultEvent`1";
|
||||
private const string NetworkEventAttributeName = "ShrinkNetwork.Integration.EventBus.ShrinkNetworkEventAttribute";
|
||||
private const string DeltaEventInterfaceName = "ShrinkNetwork.Integration.EventBus.IShrinkNetworkDeltaEvent";
|
||||
|
||||
@@ -136,7 +136,7 @@ internal static class ShrinkNetworkSemanticScanner
|
||||
Opcode = opcode,
|
||||
Route = route.Trim(),
|
||||
SourcePath = GetSourceName(type),
|
||||
HasResult = HasAttribute(type, HasResultAttributeName),
|
||||
HasResult = ImplementsOpenGeneric(type, ResultEventInterfaceName),
|
||||
IsNetworkEvent = HasAttribute(type, NetworkEventAttributeName),
|
||||
IsDeltaEvent = Implements(type, DeltaEventInterfaceName),
|
||||
SyncGroup = GetConstructorString(stateSync, 0),
|
||||
@@ -314,6 +314,14 @@ internal static class ShrinkNetworkSemanticScanner
|
||||
return type.GetInterfaces().Any(item => string.Equals(item.FullName, interfaceFullName, StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
private static bool ImplementsOpenGeneric(Type type, string interfaceFullName)
|
||||
{
|
||||
return type.GetInterfaces().Any(item =>
|
||||
item.IsGenericType &&
|
||||
string.Equals(item.GetGenericTypeDefinition().FullName, interfaceFullName,
|
||||
StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
private static bool Inherits(Type type, string baseTypeFullName)
|
||||
{
|
||||
for (var current = type.BaseType; current != null; current = current.BaseType)
|
||||
|
||||
Reference in New Issue
Block a user