initial commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using System.IO;
|
||||
|
||||
namespace Crysome.Common.Network.Packets.Server;
|
||||
|
||||
public class ReadFileRequestPacket : IPacket
|
||||
{
|
||||
public string Path { get; set; }
|
||||
|
||||
public long TransferId { get; set; }
|
||||
|
||||
public ReadFileRequestPacket()
|
||||
{
|
||||
}
|
||||
|
||||
public ReadFileRequestPacket(string path, long transferId = 0L)
|
||||
{
|
||||
Path = path ?? "";
|
||||
TransferId = transferId;
|
||||
}
|
||||
|
||||
public void Write(BinaryWriter w)
|
||||
{
|
||||
w.Write(Path ?? "");
|
||||
w.Write(TransferId);
|
||||
}
|
||||
|
||||
public void Read(BinaryReader r)
|
||||
{
|
||||
Path = r.ReadString();
|
||||
TransferId = ((r.BaseStream.Position < r.BaseStream.Length) ? r.ReadInt64() : 0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user