Further fixes to Server to Authority RPC generation
Signed-off-by: puvvadar <puvvadar@amazon.com>
This commit is contained in:
@@ -132,7 +132,7 @@ void {{ PropertyName }}({{ ', '.join(paramDefines) }});
|
||||
#}
|
||||
{% macro DeclareRpcInvocations(Component, Section, HandleOn, ProctectedSection) %}
|
||||
{% call(Property) AutoComponentMacros.ParseRemoteProcedures(Component, Section, HandleOn) %}
|
||||
{% if Property.attrib['IsPublic']|booleanTrue == ProctectedSection %}
|
||||
{% if Property.attrib['IsPublic']|booleanTrue != ProctectedSection %}
|
||||
{{ DeclareRpcInvocation(Property, HandleOn) -}}
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
@@ -386,8 +386,6 @@ namespace {{ Component.attrib['Namespace'] }}
|
||||
{{ DeclareNetworkPropertyAccessors(Component, 'Autonomous', 'Authority', false)|indent(8) -}}
|
||||
{{ DeclareNetworkPropertyAccessors(Component, 'Autonomous', 'Authority', true)|indent(8) -}}
|
||||
{{ DeclareArchetypePropertyGetters(Component)|indent(8) -}}
|
||||
{{ DeclareRpcInvocations(Component, 'Server', 'Authority', false)|indent(8) -}}
|
||||
{{ DeclareRpcInvocations(Component, 'Server', 'Authority', true)|indent(8) -}}
|
||||
{{ DeclareRpcInvocations(Component, 'Client', 'Authority', false)|indent(8) -}}
|
||||
{{ DeclareRpcInvocations(Component, 'Client', 'Authority', true)|indent(8) -}}
|
||||
{{ DeclareRpcInvocations(Component, 'Autonomous', 'Authority', false)|indent(8) -}}
|
||||
|
||||
@@ -318,7 +318,11 @@ void {{ ClassName }}::{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(par
|
||||
constexpr AzNetworking::ReliabilityType isReliable = Multiplayer::ReliabilityType::Unreliable;
|
||||
{% endif %}
|
||||
|
||||
{% if InvokeFrom == 'Server' and HandleOn == 'Authority' %}
|
||||
const Multiplayer::NetComponentId netComponentId = GetNetComponentId();
|
||||
{% else %}
|
||||
const Multiplayer::NetComponentId netComponentId = GetParent().GetNetComponentId();
|
||||
{% endif %}
|
||||
Multiplayer::NetworkEntityRpcMessage rpcMessage(Multiplayer::RpcDeliveryType::{{ InvokeFrom }}To{{ HandleOn }}, GetNetEntityId(), netComponentId, rpcId, isReliable);
|
||||
{% if paramNames|count > 0 %}
|
||||
{{ UpperFirst(Component.attrib['Name']) }}Internal::{{ UpperFirst(Property.attrib['Name']) }}RpcStruct rpcStruct({{ ', '.join(paramNames) }});
|
||||
@@ -1544,8 +1548,8 @@ namespace {{ Component.attrib['Namespace'] }}
|
||||
{{ DefineNetworkPropertyGets(Component, 'Authority', 'Client', true, ComponentBaseName)|indent(4) }}
|
||||
{{ DefineNetworkPropertyGets(Component, 'Autonomous', 'Authority', true, ComponentBaseName)|indent(4) }}
|
||||
{{ DefineArchetypePropertyGets(Component, ClassType, ComponentBaseName)|indent(4) -}}
|
||||
{{ DefineRpcInvocations(Component, ControllerBaseName, 'Server', 'Authority', false)|indent(4) -}}
|
||||
{{ DefineRpcInvocations(Component, ControllerBaseName, 'Server', 'Authority', true)|indent(4) }}
|
||||
{{ DefineRpcInvocations(Component, ComponentBaseName, 'Server', 'Authority', false)|indent(4) -}}
|
||||
{{ DefineRpcInvocations(Component, ComponentBaseName, 'Server', 'Authority', true)|indent(4) }}
|
||||
|
||||
void {{ ComponentBaseName }}::SetOwningConnectionId([[maybe_unused]] AzNetworking::ConnectionId connectionId)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user