From 25502b3d5c315f3331ca296180476b6d9a1e5a50 Mon Sep 17 00:00:00 2001 From: pangdogs Date: Tue, 20 Aug 2024 15:14:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comp_rpc.go | 5 +++++ entity_rpc.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/comp_rpc.go b/comp_rpc.go index 04cca62b..3afd2af8 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 395a59fa..82b863b8 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...) +}