public async Task Handle(Session session, Entity entity, ActorRequest message) { if (message.AMessage is AFrameMessage aFrameMessage) { // 客户端发送不需要设置Frame消息的id,在这里统一设置,防止客户端被破解发个假的id过来 aFrameMessage.Id = entity.Id; Unit unit = entity as Unit; MatchRoomComponent roomComponent = Game.Scene.GetComponent <MatchRoomComponent>(); MatchRoom matchroom = roomComponent.Get(unit.RoomID); if (matchroom != null) { matchroom.Add(aFrameMessage); } //Game.Scene.GetComponent<ServerFrameComponent>().Add(aFrameMessage); ActorResponse response = new ActorResponse { RpcId = message.RpcId }; session.Reply(response); return; } await Game.Scene.GetComponent <ActorMessageDispatherComponent>().Handle(session, entity, message); }