diff --git a/comp_rpc.go b/comp_rpc.go index 04cca62..3afd2af 100644 --- a/comp_rpc.go +++ b/comp_rpc.go @@ -84,3 +84,8 @@ func (c *ComponentBehavior) OneWayCliRPC(method string, args ...any) error { func (c *ComponentBehavior) OneWayCliRPCToEntity(entityId uid.Id, method string, args ...any) error { return rpcutil.ProxyEntity(c, c.GetEntity().GetId()).OneWayCliRPCToEntity(entityId, method, args...) } + +// OneWayCliRPCToGroups 向包含实体的所有分组发送单向RPC +func (c *ComponentBehavior) OneWayCliRPCToGroups(method string, args ...any) error { + return rpcutil.ProxyEntity(c, c.GetEntity().GetId()).OneWayCliRPCToGroups(method, args...) +} diff --git a/entity_rpc.go b/entity_rpc.go index 395a59f..82b863b 100644 --- a/entity_rpc.go +++ b/entity_rpc.go @@ -84,3 +84,8 @@ func (e *EntityBehavior) OneWayCliRPC(method string, args ...any) error { func (e *EntityBehavior) OneWayCliRPCToEntity(entityId uid.Id, method string, args ...any) error { return rpcutil.ProxyEntity(e, e.GetId()).OneWayCliRPCToEntity(entityId, method, args...) } + +// OneWayCliRPCToGroups 向包含实体的所有分组发送单向RPC +func (e *EntityBehavior) OneWayCliRPCToGroups(method string, args ...any) error { + return rpcutil.ProxyEntity(e, e.GetId()).OneWayCliRPCToGroups(method, args...) +}