SDT0651: RPC Non Void Return Type

Property Value
Rule ID SDT0651
Title RPC Non Void Return Type
Category Network
Severity Warning

Cause

A method decorated with [RPC] specifies a return type other than void.

Rule Description

Remote Procedure Calls are fired asynchronously into the network pipe. Because network broadcasts are one-way execution triggers, returning a value from an RPC is impossible. The engine silently ignores return values on broadcast anyway.

How to Fix Violations

Change the method return type to void.

Violation:

[RPC(PacketBroadcast.Client)]
public bool RPC_ExplodeBarrel() 
{ 
    return true; 
}

Fix:

[RPC(PacketBroadcast.Client)]
public void RPC_ExplodeBarrel() 
{ 
    // Implementation
}

When to Suppress Warnings

Info

You may suppress this warning if the method is bound to local UI wrappers that explicitly depend on a fluent API return type, though refactoring to a standard asynchronous fire-and-forget pattern is heavily encouraged.