using System.Web;
using ActorCore;
using Server.Core;

namespace NetWorkMessage
{
    [Message(MessageOpcode.NetInnerMessage)]
    public class NetInnerMessage : MessageObject,IMessage
    {
        public static NetInnerMessage Create()
        {
            return ReferencePool.Fetch<NetInnerMessage>();
        }

        protected override void VDispose()
        {
            this.MessageObject = null;
        }
        
        public ActorId ActorId;
        public MessageObject MessageObject;
    }

    [Message(MessageOpcode.NetInnerRequest)]
    [ResponseType(typeof(NetInnerResponse))]
    public class NetInnerRequest : MessageObject, IRequest
    {
        public static NetInnerRequest Create()
        {
            return ReferencePool.Fetch<NetInnerRequest>();
        }

        protected override void VDispose()
        {
            this.RpcId = 0;
            this.MessageObject = null;
        }

        public uint RpcId { get; set; }
        public ActorId FromActorId;
        public ActorId ActorId;
        public IRequest MessageObject;
    }

    [Message(MessageOpcode.NetInnerResponse)]
    public class NetInnerResponse : MessageObject, IResponse
    {
        protected override void VDispose()
        {
            this.Message = null;
            this.MessageObject = null;
        }

        public int Error { get; set; }
        public string Message { get; set; }
        public uint RpcId { get; set; }

        public IResponse MessageObject;
    }
}