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); }
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); }
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); }