diff --git a/PolyChat.sln b/PolyChat.sln
new file mode 100644
index 0000000..4a3e4d9
--- /dev/null
+++ b/PolyChat.sln
@@ -0,0 +1,51 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31624.102
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PolyChat", "PolyChat\PolyChat.csproj", "{23ACF793-F4C9-48C2-893C-7BD4A601EF40}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM = Debug|ARM
+ Debug|ARM64 = Debug|ARM64
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|ARM = Release|ARM
+ Release|ARM64 = Release|ARM64
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Debug|ARM.ActiveCfg = Debug|ARM
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Debug|ARM.Build.0 = Debug|ARM
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Debug|ARM.Deploy.0 = Debug|ARM
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Debug|ARM64.Build.0 = Debug|ARM64
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Debug|ARM64.Deploy.0 = Debug|ARM64
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Debug|x64.ActiveCfg = Debug|x64
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Debug|x64.Build.0 = Debug|x64
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Debug|x64.Deploy.0 = Debug|x64
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Debug|x86.ActiveCfg = Debug|x86
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Debug|x86.Build.0 = Debug|x86
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Debug|x86.Deploy.0 = Debug|x86
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Release|ARM.ActiveCfg = Release|ARM
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Release|ARM.Build.0 = Release|ARM
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Release|ARM.Deploy.0 = Release|ARM
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Release|ARM64.ActiveCfg = Release|ARM64
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Release|ARM64.Build.0 = Release|ARM64
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Release|ARM64.Deploy.0 = Release|ARM64
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Release|x64.ActiveCfg = Release|x64
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Release|x64.Build.0 = Release|x64
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Release|x64.Deploy.0 = Release|x64
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Release|x86.ActiveCfg = Release|x86
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Release|x86.Build.0 = Release|x86
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}.Release|x86.Deploy.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {58B9261A-B53D-4C9F-B1C5-D3855184F5B1}
+ EndGlobalSection
+EndGlobal
diff --git a/PolyChat/App.xaml b/PolyChat/App.xaml
new file mode 100644
index 0000000..923cba6
--- /dev/null
+++ b/PolyChat/App.xaml
@@ -0,0 +1,6 @@
+
+
diff --git a/PolyChat/App.xaml.cs b/PolyChat/App.xaml.cs
new file mode 100644
index 0000000..66a761b
--- /dev/null
+++ b/PolyChat/App.xaml.cs
@@ -0,0 +1,100 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.ApplicationModel;
+using Windows.ApplicationModel.Activation;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+namespace PolyChat
+{
+ ///
+ /// Provides application-specific behavior to supplement the default Application class.
+ ///
+ sealed partial class App : Application
+ {
+ ///
+ /// Initializes the singleton application object. This is the first line of authored code
+ /// executed, and as such is the logical equivalent of main() or WinMain().
+ ///
+ public App()
+ {
+ this.InitializeComponent();
+ this.Suspending += OnSuspending;
+ }
+
+ ///
+ /// Invoked when the application is launched normally by the end user. Other entry points
+ /// will be used such as when the application is launched to open a specific file.
+ ///
+ /// Details about the launch request and process.
+ protected override void OnLaunched(LaunchActivatedEventArgs e)
+ {
+ Frame rootFrame = Window.Current.Content as Frame;
+
+ // Do not repeat app initialization when the Window already has content,
+ // just ensure that the window is active
+ if (rootFrame == null)
+ {
+ // Create a Frame to act as the navigation context and navigate to the first page
+ rootFrame = new Frame();
+
+ rootFrame.NavigationFailed += OnNavigationFailed;
+
+ if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
+ {
+ //TODO: Load state from previously suspended application
+ }
+
+ // Place the frame in the current Window
+ Window.Current.Content = rootFrame;
+ }
+
+ if (e.PrelaunchActivated == false)
+ {
+ if (rootFrame.Content == null)
+ {
+ // When the navigation stack isn't restored navigate to the first page,
+ // configuring the new page by passing required information as a navigation
+ // parameter
+ rootFrame.Navigate(typeof(MainPage), e.Arguments);
+ }
+ // Ensure the current window is active
+ Window.Current.Activate();
+ }
+ }
+
+ ///
+ /// Invoked when Navigation to a certain page fails
+ ///
+ /// The Frame which failed navigation
+ /// Details about the navigation failure
+ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
+ {
+ throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
+ }
+
+ ///
+ /// Invoked when application execution is being suspended. Application state is saved
+ /// without knowing whether the application will be terminated or resumed with the contents
+ /// of memory still intact.
+ ///
+ /// The source of the suspend request.
+ /// Details about the suspend request.
+ private void OnSuspending(object sender, SuspendingEventArgs e)
+ {
+ var deferral = e.SuspendingOperation.GetDeferral();
+ //TODO: Save application state and stop any background activity
+ deferral.Complete();
+ }
+ }
+}
diff --git a/PolyChat/Assets/LockScreenLogo.scale-200.png b/PolyChat/Assets/LockScreenLogo.scale-200.png
new file mode 100644
index 0000000..735f57a
Binary files /dev/null and b/PolyChat/Assets/LockScreenLogo.scale-200.png differ
diff --git a/PolyChat/Assets/SplashScreen.scale-200.png b/PolyChat/Assets/SplashScreen.scale-200.png
new file mode 100644
index 0000000..023e7f1
Binary files /dev/null and b/PolyChat/Assets/SplashScreen.scale-200.png differ
diff --git a/PolyChat/Assets/Square150x150Logo.scale-200.png b/PolyChat/Assets/Square150x150Logo.scale-200.png
new file mode 100644
index 0000000..af49fec
Binary files /dev/null and b/PolyChat/Assets/Square150x150Logo.scale-200.png differ
diff --git a/PolyChat/Assets/Square44x44Logo.scale-200.png b/PolyChat/Assets/Square44x44Logo.scale-200.png
new file mode 100644
index 0000000..ce342a2
Binary files /dev/null and b/PolyChat/Assets/Square44x44Logo.scale-200.png differ
diff --git a/PolyChat/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/PolyChat/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
new file mode 100644
index 0000000..f6c02ce
Binary files /dev/null and b/PolyChat/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ
diff --git a/PolyChat/Assets/StoreLogo.png b/PolyChat/Assets/StoreLogo.png
new file mode 100644
index 0000000..7385b56
Binary files /dev/null and b/PolyChat/Assets/StoreLogo.png differ
diff --git a/PolyChat/Assets/Wide310x150Logo.scale-200.png b/PolyChat/Assets/Wide310x150Logo.scale-200.png
new file mode 100644
index 0000000..288995b
Binary files /dev/null and b/PolyChat/Assets/Wide310x150Logo.scale-200.png differ
diff --git a/PolyChat/Controller.cs b/PolyChat/Controller.cs
new file mode 100644
index 0000000..850c213
--- /dev/null
+++ b/PolyChat/Controller.cs
@@ -0,0 +1,104 @@
+using System;
+using System.Net;
+using EngineIOSharp.Common.Enum;
+using PolyChat.Models;
+using PolyChat.Models.Exceptions;
+using SocketIOSharp.Client;
+using SocketIOSharp.Common;
+using SocketIOSharp.Common.Packet;
+using SocketIOSharp.Server.Client;
+
+namespace PolyChat
+{
+ public class Controller
+ {
+ public static IPAddress ip;
+ private MainPage UIController;
+
+ private ClientHandler clientHandler;
+ public Controller(MainPage uiController)
+ {
+ UIController = uiController;
+ clientHandler = new ClientHandler();
+ Socket s = new Socket(this);
+ }
+
+ public void Connect(string ip)
+ {
+ clientHandler.connectNewClient(ip);
+ }
+
+ public void sendMessage(String ip, String name, String msg)
+ {
+ clientHandler.getClient(ip).sendMessage(SendCode.Message, name, msg, DateTime.Now);
+ }
+
+ ///
+ /// prints out ip. on server side automatticaly finds 10.... ip (which is the correct one)
+ ///
+ /// users ip
+ private String getIP()
+ {
+ while (true)
+ {
+ string input = Console.ReadLine();
+ if (input.Equals("server"))
+ {
+ Console.WriteLine("starting as server...");
+ for (short i = 0; i < GetIPs().Length; i++)
+ {
+ if (GetIPs()[i].ToString().Substring(0, 3).Equals("10."))
+ {
+ Controller.ip = GetIPs()[i];
+ Console.WriteLine(GetIPs()[i]);
+ //get ip as byte array
+ byte[] ba = System.Text.Encoding.ASCII.GetBytes(GetIPs()[i].ToString());
+ foreach (var item in ba)
+ {
+ Console.Write(item.ToString() + ",");
+ }
+ break;
+ }
+ }
+ Socket s = new Socket(this);
+ }
+ else if (input.Equals("client"))
+ {
+ ClientHandler cl = new ClientHandler();
+ Console.WriteLine("Enter IP:");
+ cl.connectNewClient(Console.ReadLine());
+ }
+ }
+ }
+
+ static void InitEventHandlers(SocketIOClient client)
+ {
+ client.On(SocketIOEvent.CONNECTION, () =>
+ {
+ Console.WriteLine("Connected!");
+ client.Emit("Message", "This is a Message Body!");
+ });
+
+ client.On(SocketIOEvent.DISCONNECT, () =>
+ {
+ Console.WriteLine();
+ Console.WriteLine("Disconnected!");
+ });
+ }
+
+
+
+ public void OnMessageCallback(SocketIOSocket socket, SocketIOAckEvent message)
+ {
+ Console.WriteLine($"Message received from {socket.GetHashCode()}:{message.Data[0]}");
+ }
+
+ static IPAddress[] GetIPs()
+ {
+ IPHostEntry ipEntry = Dns.GetHostEntry(Dns.GetHostName());
+ IPAddress[] addr = ipEntry.AddressList;
+ return addr;
+ }
+
+ }
+}
diff --git a/PolyChat/MainPage.xaml b/PolyChat/MainPage.xaml
new file mode 100644
index 0000000..8439a3e
--- /dev/null
+++ b/PolyChat/MainPage.xaml
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PolyChat/MainPage.xaml.cs b/PolyChat/MainPage.xaml.cs
new file mode 100644
index 0000000..b0b8e00
--- /dev/null
+++ b/PolyChat/MainPage.xaml.cs
@@ -0,0 +1,88 @@
+using PolyChat.Models;
+using PolyChat.Views;
+using System;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Threading.Tasks;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
+
+namespace PolyChat
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class MainPage : Page
+ {
+ private Controller Controller;
+ private ObservableCollection Partners;
+ private ChatPartner selectedPartner;
+ public MainPage()
+ {
+ this.InitializeComponent();
+ Controller = new Controller(this);
+
+ Partners = new ObservableCollection();
+ }
+
+ public void OnChatPartnerSelected(object sender, RoutedEventArgs e)
+ {
+ string code = ((RadioButton)sender).Tag.ToString();
+ selectedPartner = Partners.First(p => p.Code == code);
+ listViewMessages.ItemsSource = selectedPartner.Messages;
+ selectedPartnerName.Text = selectedPartner.Name;
+ }
+
+ public void OnSendMessage(object sender = null, RoutedEventArgs e = null)
+ {
+ selectedPartner.AddMessage(new ChatMessage(
+ inputSend.Text,
+ DateTime.Now.ToString(),
+ false
+ ));
+ Controller.sendMessage(selectedPartner.Code, inputUsername.Text, inputSend.Text);
+ // clear input
+ inputSend.Text = "";
+ }
+
+ public async void OnOpenNewChatDialog(object sender = null, RoutedEventArgs e = null)
+ {
+ NewChatDialog dialog = new NewChatDialog();
+ var result = await dialog.ShowAsync();
+ if (result == ContentDialogResult.Primary)
+ {
+ string ip = dialog.getText();
+ Controller.Connect(ip);
+ Partners.Add(new ChatPartner(
+ "NO NAME",
+ ip
+ ));
+ }
+ }
+
+ public void OnIncomingMessage(MSG message)
+ {
+ ChatPartner sendingPartner = Partners.First(p => p.Code == message.ip.ToString());
+ sendingPartner.AddMessage(new ChatMessage(
+ message.msg,
+ message.timestamp.ToString(),
+ true
+ ));
+ }
+
+ private void OnDeleteChat(object sender = null, RoutedEventArgs e = null)
+ {
+ Partners.Remove(selectedPartner);
+ }
+
+ private void OnKeyDown(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
+ {
+ if (e.Key == Windows.System.VirtualKey.Enter)
+ {
+ OnSendMessage();
+ }
+ }
+ }
+}
diff --git a/PolyChat/Models/ChatMessage.cs b/PolyChat/Models/ChatMessage.cs
new file mode 100644
index 0000000..b429318
--- /dev/null
+++ b/PolyChat/Models/ChatMessage.cs
@@ -0,0 +1,23 @@
+namespace PolyChat.Models
+{
+ public class ChatMessage
+ {
+ public string Text;
+ public string Date;
+ public bool Foreign;
+
+ public ChatMessage(string text, string date, bool foreign)
+ {
+ Text = text;
+ Date = date;
+ Foreign = foreign;
+ }
+
+ override
+ public string ToString()
+ {
+ string prefix = Foreign ? "Other" : "Me";
+ return $"{prefix}: Text";
+ }
+ }
+}
\ No newline at end of file
diff --git a/PolyChat/Models/ChatPartner.cs b/PolyChat/Models/ChatPartner.cs
new file mode 100644
index 0000000..020433d
--- /dev/null
+++ b/PolyChat/Models/ChatPartner.cs
@@ -0,0 +1,28 @@
+using SocketIOSharp.Server.Client;
+using System.Collections.ObjectModel;
+
+namespace PolyChat.Models
+{
+ public class ChatPartner
+ {
+ public string Name;
+ public string Code;
+ public ObservableCollection Messages;
+ private SocketIOSocket socketIOSocket;
+
+ public ChatPartner(string name, string code, ObservableCollection messages = null)
+ {
+ Name = name;
+ Code = code;
+ if (messages == null) Messages = new ObservableCollection();
+ else Messages = messages;
+ }
+
+ public SocketIOSocket SocketIOSocket { get => socketIOSocket; set => socketIOSocket = value; }
+
+ public void AddMessage(ChatMessage message)
+ {
+ Messages.Add(message);
+ }
+ }
+}
\ No newline at end of file
diff --git a/PolyChat/Models/Client.cs b/PolyChat/Models/Client.cs
new file mode 100644
index 0000000..0b2967e
--- /dev/null
+++ b/PolyChat/Models/Client.cs
@@ -0,0 +1,110 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SocketIOSharp.Common;
+using SocketIOSharp.Server;
+using SocketIOSharp.Client;
+using SocketIOSharp.Server.Client;
+using EngineIOSharp.Common.Enum;
+using Json.Net;
+using System.Net;
+using SocketIOSharp.Client;
+using SocketIOSharp.Common;
+using SocketIOSharp.Common.Packet;
+using System;
+using System.Net;
+using EngineIOSharp.Common.Enum;
+using System.Threading;
+
+namespace PolyChat.Models
+{
+ class Client
+ {
+ private SocketIOClient connection;
+ public Boolean isConnected = false;
+ private List msgStack = new List();
+ private Boolean active = true;
+ private String ip;
+
+ public Client(SocketIOClient connection, String ip)
+ {
+ this.ip = ip;
+ this.connection = connection;
+ InitEventHandlers(this, connection);
+ }
+
+ ///
+ /// converts String message into json file and sends it to the server.
+ ///
+ ///
+ /// gets called by gui if someone wants to send Message
+ ///
+ /// Sender of Message
+ /// the accual text the user wants to send
+ /// current time
+ public void sendMessage(SendCode code, String sender, String chatMessage, DateTime timestamp)
+ {
+ new Thread(() =>
+ {
+ //create msg
+ MSG msg = new MSG(sender, Controller.ip, chatMessage, timestamp);
+
+ //convert msg
+ String petJson = JsonNet.Serialize(msg);
+
+ //send msg
+ connection.Emit(code.ToString(), petJson);
+ }).Start();
+ }
+
+ /*
+ private void recieveMessage(String msg)
+ {
+ // deserialize json string
+ MSG pet = JsonNet.Deserialize(msg);
+
+ //TODO: send message to GUI
+ }
+ */
+
+ ///
+ /// handles all events of client server communiation
+ ///
+ /// self
+ ///
+ private static void InitEventHandlers(Client client, SocketIOClient connection)
+ {
+ connection.On(SendCode.Message.ToString(), (Data) =>
+ {
+ MSG pet = JsonNet.Deserialize(BitConverter.ToString(Data[0].ToObject()));
+ //TODO: send message to GUI
+ });
+ connection.On(SendCode.Command.ToString(), (Data) =>
+ {
+ Console.WriteLine("Command recieved!" + Data[0]);
+ });
+ connection.On(SendCode.test1.ToString(), (Data) =>
+ {
+ Console.WriteLine("test1 recieved!" + Data[0]);
+ });
+ connection.On(SendCode.test2.ToString(), (Data) =>
+ {
+ Console.WriteLine("test2 recieved!" + Data[0]);
+ });
+
+ connection.On(SocketIOEvent.CONNECTION, () =>
+ {
+ Console.WriteLine("Connected!");
+ client.isConnected = true;
+ });
+ }
+
+ public String getIP()
+ {
+ return this.ip;
+ }
+ }
+
+}
diff --git a/PolyChat/Models/ClientHandler.cs b/PolyChat/Models/ClientHandler.cs
new file mode 100644
index 0000000..b2d079b
--- /dev/null
+++ b/PolyChat/Models/ClientHandler.cs
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SocketIOSharp.Common;
+using SocketIOSharp.Server;
+using SocketIOSharp.Client;
+using SocketIOSharp.Server.Client;
+using EngineIOSharp.Common.Enum;
+using Json.Net;
+
+namespace PolyChat.Models
+{
+ class ClientHandler
+ {
+ public List clients = new List();
+ public ClientHandler()
+ {
+ }
+
+ ///
+ /// connects new clients and saves them in list
+ ///
+ /// ip adress of parter
+ public void connectNewClient(String clientCode)
+ {
+ //Todo: convert code into ip
+
+ SocketIOClient connection = new SocketIOClient(new SocketIOClientOption(EngineIOScheme.http, clientCode, 8050));
+ connection.Connect();
+ clients.Add(new Client(connection, clientCode));
+ }
+
+ ///
+ /// returns client that fits to ip adress
+ ///
+ ///
+ ///
+ public Client getClient(String ip)
+ {
+ foreach (Client cl in clients)
+ {
+ if (cl.getIP().Equals(ip))
+ {
+ return cl;
+ }
+ }
+ return null;
+ }
+ }
+
+}
diff --git a/PolyChat/Models/Exceptions/ConnectionFailedException.cs b/PolyChat/Models/Exceptions/ConnectionFailedException.cs
new file mode 100644
index 0000000..390b5f3
--- /dev/null
+++ b/PolyChat/Models/Exceptions/ConnectionFailedException.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PolyChat.Models.Exceptions
+{
+ public class ConnectionFailedException : Exception
+ {
+
+ }
+}
diff --git a/PolyChat/Models/MSG.cs b/PolyChat/Models/MSG.cs
new file mode 100644
index 0000000..ac75306
--- /dev/null
+++ b/PolyChat/Models/MSG.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PolyChat.Models
+{
+ ///
+ /// dumy class for json converter
+ ///
+ public class MSG
+ {
+ public String sender = "unknown";
+ public DateTime timestamp = new DateTime(2000, 01, 01);
+ public String msg = "empty";
+ public IPAddress ip = new IPAddress(new byte[] { 49,48,46,49,46,50,49,49,46,50,54 });
+
+
+ public MSG(String sender, IPAddress ip, String msg, DateTime timestamp)
+ {
+ this.sender = sender;
+ this.ip = ip;
+ this.timestamp = timestamp;
+ this.msg = msg;
+ }
+ }
+}
diff --git a/PolyChat/Models/SendCode.cs b/PolyChat/Models/SendCode.cs
new file mode 100644
index 0000000..0fd4f78
--- /dev/null
+++ b/PolyChat/Models/SendCode.cs
@@ -0,0 +1,10 @@
+namespace PolyChat.Models
+{
+ enum SendCode
+ {
+ Message,
+ Command,
+ test1,
+ test2
+ }
+}
\ No newline at end of file
diff --git a/PolyChat/Models/Socket.cs b/PolyChat/Models/Socket.cs
new file mode 100644
index 0000000..8dcec3c
--- /dev/null
+++ b/PolyChat/Models/Socket.cs
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Json.Net;
+using SocketIOSharp.Common;
+using SocketIOSharp.Server;
+using SocketIOSharp.Server.Client;
+
+namespace PolyChat.Models
+{
+ class Socket
+ {
+ private Controller p;
+ private readonly ushort Port;
+ private SocketIOServer Server;
+ private List Sockets = new List();
+
+ ///
+ /// creates server on specified port
+ ///
+ ///
+ public Socket(Controller p, ushort Port = 8050)
+ {
+ this.Port = Port;
+ this.p = p;
+ Server = new SocketIOServer(new SocketIOServerOption(Port));
+ Server.OnConnection((socket) => OnConnect(socket));
+ Server.Start();
+ Console.WriteLine($"Server started, binding to port {Port}, waiting for connection...");
+ }
+
+ private void OnConnect(SocketIOSocket socket)
+ {
+ Console.WriteLine($"{socket.GetHashCode()} connected to the server");
+ Sockets.Add(socket);
+ socket.On(SocketIOEvent.DISCONNECT, () => OnDisconnect(socket));
+ socket.On("Message", (Data) => p.OnMessageCallback(socket, Data));
+ }
+
+ private void OnDisconnect(SocketIOSocket socket)
+ {
+ Sockets.Remove(socket);
+ }
+
+ public bool SendMessage(SocketIOSocket socket)
+ {
+
+ return false;
+ }
+ }
+}
diff --git a/PolyChat/Package.appxmanifest b/PolyChat/Package.appxmanifest
new file mode 100644
index 0000000..d4a461b
--- /dev/null
+++ b/PolyChat/Package.appxmanifest
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+ PolyChat
+ HPL2FE
+ Assets\StoreLogo.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/PolyChat/PolyChat.csproj b/PolyChat/PolyChat.csproj
new file mode 100644
index 0000000..6119e13
--- /dev/null
+++ b/PolyChat/PolyChat.csproj
@@ -0,0 +1,190 @@
+
+
+
+
+ Debug
+ x86
+ {23ACF793-F4C9-48C2-893C-7BD4A601EF40}
+ AppContainerExe
+ Properties
+ PolyChat
+ PolyChat
+ en-US
+ UAP
+ 10.0.19041.0
+ 10.0.19041.0
+ 14
+ 512
+ {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ true
+ false
+
+
+ true
+ bin\x86\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ x86
+ false
+ prompt
+ true
+
+
+ bin\x86\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ x86
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\ARM\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ ARM
+ false
+ prompt
+ true
+
+
+ bin\ARM\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ ARM
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\ARM64\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ ARM64
+ false
+ prompt
+ true
+ true
+
+
+ bin\ARM64\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ ARM64
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ x64
+ false
+ prompt
+ true
+
+
+ bin\x64\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ x64
+ false
+ prompt
+ true
+ true
+
+
+ PackageReference
+
+
+
+ App.xaml
+
+
+ MainPage.xaml
+
+
+
+
+
+
+
+
+
+
+
+
+ NewChatDialog.xaml
+
+
+
+
+ Designer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+ 1.0.33
+
+
+ 6.2.12
+
+
+ 2.0.3
+
+
+
+ 14.0
+
+
+
+
\ No newline at end of file
diff --git a/PolyChat/Properties/AssemblyInfo.cs b/PolyChat/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..06ec3b3
--- /dev/null
+++ b/PolyChat/Properties/AssemblyInfo.cs
@@ -0,0 +1,29 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("PolyChat")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("BOSCH")]
+[assembly: AssemblyProduct("PolyChat")]
+[assembly: AssemblyCopyright("Copyright © BOSCH 2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: ComVisible(false)]
\ No newline at end of file
diff --git a/PolyChat/Properties/Default.rd.xml b/PolyChat/Properties/Default.rd.xml
new file mode 100644
index 0000000..af00722
--- /dev/null
+++ b/PolyChat/Properties/Default.rd.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/PolyChat/Views/NewChatDialog.xaml b/PolyChat/Views/NewChatDialog.xaml
new file mode 100644
index 0000000..6470c43
--- /dev/null
+++ b/PolyChat/Views/NewChatDialog.xaml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
diff --git a/PolyChat/Views/NewChatDialog.xaml.cs b/PolyChat/Views/NewChatDialog.xaml.cs
new file mode 100644
index 0000000..56a0489
--- /dev/null
+++ b/PolyChat/Views/NewChatDialog.xaml.cs
@@ -0,0 +1,35 @@
+using PolyChat.Models;
+using System;
+using System.Collections.ObjectModel;
+using System.Linq;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
+
+namespace PolyChat.Views
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class NewChatDialog : ContentDialog
+ {
+ public NewChatDialog()
+ {
+ this.InitializeComponent();
+ }
+
+ public string getText()
+ {
+ return inputIP.Text;
+ }
+
+ public void OnConnect(ContentDialog sender, ContentDialogButtonClickEventArgs args)
+ {
+ }
+
+ public void OnClose(ContentDialog sender, ContentDialogButtonClickEventArgs args)
+ {
+ }
+ }
+}