Демка с чатом работает

This commit is contained in:
2025-03-13 08:43:48 +03:00
parent 22cf8ede0a
commit 6d9607081c
11 changed files with 112 additions and 15 deletions
+5 -4
View File
@@ -283,8 +283,8 @@ namespace {classSymbol.ContainingNamespace.ToDisplayString()}
{{
BindAction = (instance, context, representationProducer, index) =>
{{
var module = representationProducer.Produce(context.OwnerId);
var ownerId = context.OwnerId;
var module = representationProducer.Produce(ownerId);
{string.Join("\r\n", singleEventBinder)}
}}
}}";
@@ -471,14 +471,15 @@ namespace {classSymbol.ContainingNamespace.ToDisplayString()}
var requestIndex = parameters.FindIndex(i => i.Name == "RequestContext");
if (requestIndex != -1)
{
callFilter = $"\n\r\t\t\tif(context.OwnerId == p{requestIndex}.OwnerId) return;";
callFilter = $"\n\r\t\t\tif(ownerId == p{requestIndex}.OwnerId) return;";
}
var eventBinderCode =
$@" (instance as {baseType.ToDisplayString()}).{eventSymbol.Name} += ({parametersDeclaration}) =>
{{
Console.WriteLine($""Try to send to {{ownerId}} with hash code {{context.GetHashCode()}}"");
{callFilter}
Console.WriteLine(""Sending event..."");
{callFilter}
var request = new DefaultCallRequest
{{
CommandId = {index}, ObjectId = new ComplexObjectIdentifier(index, context.HostId), Parameters = new object[] {{ {transferParameters} }}