Exemple #1
0
        //--------------------------------------------------------------------------------------------------------------------------------------------

        //--------------------------------------------------------------------------------------------------------------------------------------------

        /// <summary>
        /// 战斗协议 ClientBattleAction 直接发往AreaService
        /// </summary>
        /// <param name="action"></param>
        public virtual void SendToArea(TypeCodec route_codec, BinaryMessage action)
        {
            try
            {
                var area  = remote_area_service;
                var enter = enter_game;
                if (area != null && enter != null)
                {
                    using (var output = IOStreamObjectPool.AllocOutputAutoRelease(ConnectServer.ClientCodec.Factory))
                    {
                        output.PutUTF(enter.c2s_roleUUID);
                        output.PutBytes(action.Buffer, action.BufferOffset, action.BufferLength);
                        var to_area = BinaryMessage.FromBuffer(session_battle_action_codec.MessageID, output.Buffer);
                        area.WormholeTransport(to_area);
                    }
                }
            }
            catch (Exception err)
            {
                log.Error(err);
            }
        }