示例#1
0
    public static Shop_BuyProductProto GetProto(byte[] buffer, bool isChild = false)
    {
        Shop_BuyProductProto proto = new Shop_BuyProductProto();

        MMO_MemoryStream ms = null;

        if (!isChild)
        {
            ms = GameEntry.Socket.SocketSendMS;
        }
        else
        {
            ms = GameEntry.Pool.DequeueClassObject <MMO_MemoryStream>();
        }
        ms.SetLength(0);
        ms.Write(buffer, 0, buffer.Length);
        ms.Position = 0;

        proto.ProductId = ms.ReadInt();

        if (isChild)
        {
            GameEntry.Pool.EnqueueClassObject(ms);
        }
        return(proto);
    }
    public static Shop_BuyProductProto GetProto(byte[] buffer)
    {
        Shop_BuyProductProto proto = new Shop_BuyProductProto();

        using (MMO_MemoryStream ms = new MMO_MemoryStream(buffer))
        {
            proto.ProductId = ms.ReadInt();
        }
        return(proto);
    }
示例#3
0
    public static Shop_BuyProductProto GetProto(MMO_MemoryStream ms, byte[] buffer)
    {
        Shop_BuyProductProto proto = new Shop_BuyProductProto();

        ms.SetLength(0);
        ms.Write(buffer, 0, buffer.Length);
        ms.Position = 0;

        proto.ProductId = ms.ReadInt();

        return(proto);
    }
示例#4
0
    public static Shop_BuyProductProto GetProto(byte[] buffer)
    {
        Shop_BuyProductProto proto = new Shop_BuyProductProto();
        MMO_MemoryStream     ms    = GameEntry.Socket.SocketReceiveMS;

        ms.SetLength(0);
        ms.Write(buffer, 0, buffer.Length);
        ms.Position = 0;

        proto.ProductId = ms.ReadInt();

        return(proto);
    }