diff --git a/Client.cs b/Client.cs new file mode 100644 index 0000000..9c0f576 --- /dev/null +++ b/Client.cs @@ -0,0 +1,47 @@ +using Articulate_Network.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading.Tasks; + +namespace Articulate_Network +{ + public class Client + { + List managers = new List(); + + TcpClient tcp; + + public Client() + { + tcp = new TcpClient(); + } + + public async Task Connect(string ip, int port) + { + return await Task.Run(() => + { + try + { + tcp.Connect(ip, port); + + return tcp; + } + catch (Exception e) + { + Console.WriteLine(e.Message); + return tcp; + } + } + ); + } + + public async Task SendPacket(IPacket packet) + { + return false; + } + } +} diff --git a/Interfaces/IManager.cs b/Interfaces/IManager.cs new file mode 100644 index 0000000..eaadacd --- /dev/null +++ b/Interfaces/IManager.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Articulate_Network.Interfaces +{ + interface IManager + { + void Initialize(); + } +} diff --git a/Interfaces/IPacket.cs b/Interfaces/IPacket.cs new file mode 100644 index 0000000..9931a22 --- /dev/null +++ b/Interfaces/IPacket.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Articulate_Network.Interfaces +{ + public interface IPacket + { + + } +} diff --git a/Managers/PacketManager.cs b/Managers/PacketManager.cs new file mode 100644 index 0000000..1bae597 --- /dev/null +++ b/Managers/PacketManager.cs @@ -0,0 +1,20 @@ +using Articulate_Network.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace Articulate_Network.Managers +{ + public class PacketManager : IManager + { + List packets = new List(); + + public void Initialize() + { + Console.WriteLine(Assembly.GetEntryAssembly()); + } + } +} diff --git a/Server.cs b/Server.cs new file mode 100644 index 0000000..3fc8c33 --- /dev/null +++ b/Server.cs @@ -0,0 +1,46 @@ +using Articulate_Network.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading.Tasks; + +namespace Articulate_Network +{ + public class Server + { + List managers = new List(); + + TcpListener tcp; + + public async Task Start(string ip, int port) + { + tcp = new TcpListener(IPAddress.Parse(ip), port); + + bool connected = await Task.Run(() => + { + try + { + tcp.Start(); + + return true; + } + catch (Exception e) + { + Console.WriteLine(e.Message); + return false; + } + } + ); + + return false; + } + + public async Task SendPacket(IPacket packet) + { + return false; + } + } +}