Start on File Transfer Packets & Handler Implementation

This commit is contained in:
2021-12-15 15:18:47 +10:00
parent e5b64f600c
commit 5b6fd24af4
18 changed files with 849 additions and 17 deletions

View File

@ -1,4 +1,5 @@
using System;
using Articulate_Network.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -6,9 +7,15 @@ using System.Threading.Tasks;
namespace MIT_Packets
{
public class AnnouncePacket
public class AnnouncePacket : Packet
{
public int Type { get; set; }
public bool RequestConfig { get; set; }
public string MacAddress { get; set; }
public static void Register()
{
}
}
}

View File

@ -0,0 +1,14 @@
using Articulate_Network.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MIT_Packets.Configuration
{
public class ClientConfigPacket : Packet
{
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MIT_Packets.Enums
{
public enum ClientStatus
{
Waiting,
Downloading_Image,
Applying_Image,
Installing_Drivers,
Joining,
Completed,
Idle
}
}

View File

@ -44,8 +44,14 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AnnouncePacket.cs" />
<Compile Include="Configuration\ClientConfigPacket.cs" />
<Compile Include="Enums\ClientStatus.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestPacket.cs" />
<Compile Include="Transfer\EndFileTransferPacket.cs" />
<Compile Include="Transfer\SendFileChunkPacket.cs" />
<Compile Include="Transfer\StartFileTransferPacket.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,5 +1,6 @@
using Articulate_Network.Attributes;
using Articulate_Network.Interfaces;
using Articulate_Network.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
@ -8,14 +9,10 @@ using System.Threading.Tasks;
namespace MIT_Packets
{
public class TestPacket : IPacket
public class TestPacket : Packet
{
public int TestOne { get; set; }
public bool TestTwo { get; set; }
public string TestThree { get; set; }
public static void Register()
{
}
}
}

View File

@ -0,0 +1,14 @@
using Articulate_Network.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MIT_Packets.Transfer
{
public class EndFileTransferPacket : Packet
{
public bool Completed { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using Articulate_Network.Attributes;
using Articulate_Network.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MIT_Packets.Transfer
{
public class SendFileChunkPacket : Packet
{
[PacketIgnore]
public int TransferID { get; set; }
public int ChunkSize { get; set; }
public byte[] Chunk { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using Articulate_Network.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MIT_Packets.Transfer
{
public class StartFileTransferPacket : Packet
{
public string FileName { get; set; }
public long ExpectedSize { get; set; }
}
}