From f5ef64e87d4ec61f630ab28235c4906bfb08a2e1 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 12 Feb 2017 14:03:46 -0500 Subject: Admin panel for chat frontend. --- ShiftOS.Server/Program.cs | 61 ++--------------------------------------------- 1 file changed, 2 insertions(+), 59 deletions(-) (limited to 'ShiftOS.Server/Program.cs') diff --git a/ShiftOS.Server/Program.cs b/ShiftOS.Server/Program.cs index 46d5ab3..ea16ab3 100644 --- a/ShiftOS.Server/Program.cs +++ b/ShiftOS.Server/Program.cs @@ -79,36 +79,6 @@ namespace ShiftOS.Server /// public static event StringEventHandler ServerStarted; - /// - /// Saves the chats. - /// - /// The chats. - public static void SaveChats() - { - List saved = new List(); - foreach(var chat in chats) - { - saved.Add(new Channel - { - ID = chat.ID, - Name = chat.Name, - MaxUsers = chat.MaxUsers, - Topic = chat.Topic, - Users = new List() - }); - } - File.WriteAllText("chats.json", JsonConvert.SerializeObject(saved)); - } - - /// - /// Loads the chats. - /// - /// The chats. - public static void LoadChats() - { - chats = Newtonsoft.Json.JsonConvert.DeserializeObject>(File.ReadAllText("chats.json")); - } - /// /// The entry point of the program, where the program control starts and ends. /// @@ -121,15 +91,6 @@ namespace ShiftOS.Server Directory.CreateDirectory("saves"); } - if(!File.Exists("chats.json")) - { - SaveChats(); - } - else - { - LoadChats(); - } - if(!Directory.Exists("scripts")) { Console.WriteLine("Creating scripts directory..."); @@ -202,28 +163,10 @@ namespace ShiftOS.Server Console.WriteLine("Server stopping."); }; + ChatBackend.StartDiscordBots(); } - /// - /// Users the in chat. - /// - /// The in chat. - /// Chan. - /// User. - public static bool UserInChat(Channel chan, Save user) - { - foreach(var usr in chan.Users) - { - if(usr.Username == user.Username) - { - return true; - } - } - return false; - } - - - public static string ReadEncFile(string fPath) + public static string ReadEncFile(string fPath) { return Encryption.Decrypt(File.ReadAllText(fPath)); } -- cgit v1.2.3