diff --git a/.idea/.idea.MafiaGame/.idea/.gitignore b/.idea/.idea.MafiaGame/.idea/.gitignore
new file mode 100644
index 0000000..5b5903c
--- /dev/null
+++ b/.idea/.idea.MafiaGame/.idea/.gitignore
@@ -0,0 +1,13 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Rider ignored files
+/.idea.MafiaGame.iml
+/modules.xml
+/contentModel.xml
+/projectSettingsUpdater.xml
+# Datasource local storage ignored files
+/../../../../../../../../../../../:\Users\Ilya\Source\Repos\C#\MafiaGame\MafiaGame\.idea\.idea.MafiaGame\.idea/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/MafiaClient/.gitignore b/MafiaClient/.gitignore
new file mode 100644
index 0000000..a0d6a36
--- /dev/null
+++ b/MafiaClient/.gitignore
@@ -0,0 +1,8 @@
+.idea/
+.vscode/
+.vs/
+
+bin/
+obj/
+
+*.user
\ No newline at end of file
diff --git a/MafiaClient/App.axaml b/MafiaClient/App.axaml
new file mode 100644
index 0000000..ec280e2
--- /dev/null
+++ b/MafiaClient/App.axaml
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/MafiaClient/App.axaml.cs b/MafiaClient/App.axaml.cs
new file mode 100644
index 0000000..3b9fb14
--- /dev/null
+++ b/MafiaClient/App.axaml.cs
@@ -0,0 +1,65 @@
+using Avalonia;
+using Avalonia.Controls.ApplicationLifetimes;
+using Avalonia.Markup.Xaml;
+using DiscordRPC;
+using DiscordRPC.Logging;
+using DiscordRPC.Message;
+
+namespace MafiaClient
+{
+ public class App : Application
+ {
+ public override void Initialize()
+ {
+ Instance = this;
+ AvaloniaXamlLoader.Load(this);
+ }
+
+ public override void OnFrameworkInitializationCompleted()
+ {
+ if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
+ {
+ _rpcClient = new DiscordRpcClient("800016130097152000", autoEvents: true);
+ _rpcClient.RegisterUriScheme();
+ _rpcClient.Logger = new ConsoleLogger() { Level = LogLevel.Warning };
+ _rpcClient.OnJoinRequested += RpcClientOnOnJoinRequested;
+ _rpcClient.OnJoin += RpcClientOnOnJoin;
+ _rpcClient.SetSubscription(EventType.Join | EventType.JoinRequest);
+ _rpcClient.Initialize();
+ _rpcClient.SetPresence(new RichPresence()
+ {
+ State = "Запуск игры..."
+ });
+
+ desktop.MainWindow = new MainWindow();
+
+ Settings.Initialize();
+ Settings.Save();
+ }
+
+ base.OnFrameworkInitializationCompleted();
+ }
+
+ public static App Instance;
+
+ private DiscordRpcClient _rpcClient;
+
+ public ServerConnection Connection;
+
+ public DiscordRpcClient GetRpcClient()
+ {
+ return _rpcClient;
+ }
+
+ private void RpcClientOnOnJoin(object sender, JoinMessage args)
+ {
+ string secret = args.Secret;
+ Connection = new ServerConnection(secret.Replace("/join", ""));
+ }
+
+ private void RpcClientOnOnJoinRequested(object sender, JoinRequestMessage args)
+ {
+ _rpcClient.Respond(args, true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/MafiaClient/MafiaClient.csproj b/MafiaClient/MafiaClient.csproj
new file mode 100644
index 0000000..e639195
--- /dev/null
+++ b/MafiaClient/MafiaClient.csproj
@@ -0,0 +1,16 @@
+
+
+ WinExe
+ net5.0
+ enable
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MafiaClient/MainConfig.cs b/MafiaClient/MainConfig.cs
new file mode 100644
index 0000000..a01aa4b
--- /dev/null
+++ b/MafiaClient/MainConfig.cs
@@ -0,0 +1,7 @@
+namespace MafiaClient
+{
+ public class MainConfig
+ {
+ public string Nick = "the Player";
+ }
+}
\ No newline at end of file
diff --git a/MafiaClient/MainWindow.axaml b/MafiaClient/MainWindow.axaml
new file mode 100644
index 0000000..55a5faf
--- /dev/null
+++ b/MafiaClient/MainWindow.axaml
@@ -0,0 +1,336 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MafiaClient/MainWindow.axaml.cs b/MafiaClient/MainWindow.axaml.cs
new file mode 100644
index 0000000..1964f4c
--- /dev/null
+++ b/MafiaClient/MainWindow.axaml.cs
@@ -0,0 +1,304 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Threading;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Input;
+using Avalonia.Interactivity;
+using Avalonia.Markup.Xaml;
+using DiscordRPC;
+using MafiaCommon;
+using Button = Avalonia.Controls.Button;
+
+namespace MafiaClient
+{
+
+ public class MainWindow : Window
+ {
+ public MainWindow()
+ {
+ InitializeComponent();
+#if DEBUG
+ this.AttachDevTools();
+#endif
+ _mainWindow = this;
+
+ App.Instance.GetRpcClient().SetPresence(new RichPresence()
+ {
+ State = "В главном меню"
+ });
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+
+ private static MainWindow _mainWindow;
+
+ public static MainWindow Instance => _mainWindow;
+
+ public void HideAll()
+ {
+ this.Find("MainMenu").IsVisible = false;
+ this.Find("SettingsGui").IsVisible = false;
+ this.Find("IpInput").IsVisible = false;
+ this.Find("GameQueue").IsVisible = false;
+ this.Find("DisconnectScreen").IsVisible = false;
+ this.Find("GameVotingPassive").IsVisible = false;
+ this.Find("GameVotingActive").IsVisible = false;
+ this.Find("GameEndScreen").IsVisible = false;
+ this.Find("GameDay").IsVisible = false;
+ }
+
+ private void IpInputEnable(bool enable)
+ {
+ this.FindControl