Start on File Transfer Packets & Handler Implementation
This commit is contained in:
@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
14
MIT Packets/Configuration/ClientConfigPacket.cs
Normal file
14
MIT Packets/Configuration/ClientConfigPacket.cs
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
19
MIT Packets/Enums/ClientStatus.cs
Normal file
19
MIT Packets/Enums/ClientStatus.cs
Normal 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
|
||||
}
|
||||
}
|
||||
@ -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>
|
||||
@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
14
MIT Packets/Transfer/EndFileTransferPacket.cs
Normal file
14
MIT Packets/Transfer/EndFileTransferPacket.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
18
MIT Packets/Transfer/SendFileChunkPacket.cs
Normal file
18
MIT Packets/Transfer/SendFileChunkPacket.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
15
MIT Packets/Transfer/StartFileTransferPacket.cs
Normal file
15
MIT Packets/Transfer/StartFileTransferPacket.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user