diff options
| author | Michael <[email protected]> | 2017-02-12 14:03:46 -0500 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-02-12 14:03:46 -0500 |
| commit | f5ef64e87d4ec61f630ab28235c4906bfb08a2e1 (patch) | |
| tree | 3dd39c5bc05bb34986cff27e145b347a629c6fd7 /ShiftOS.Server/Program.cs | |
| parent | 9f782550b571912c1450f94100c372c60ecd1881 (diff) | |
| download | shiftos_thereturn-f5ef64e87d4ec61f630ab28235c4906bfb08a2e1.tar.gz shiftos_thereturn-f5ef64e87d4ec61f630ab28235c4906bfb08a2e1.tar.bz2 shiftos_thereturn-f5ef64e87d4ec61f630ab28235c4906bfb08a2e1.zip | |
Admin panel for chat frontend.
Diffstat (limited to 'ShiftOS.Server/Program.cs')
| -rw-r--r-- | ShiftOS.Server/Program.cs | 61 |
1 files changed, 2 insertions, 59 deletions
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 @@ -80,36 +80,6 @@ namespace ShiftOS.Server public static event StringEventHandler ServerStarted; /// <summary> - /// Saves the chats. - /// </summary> - /// <returns>The chats.</returns> - public static void SaveChats() - { - List<Channel> saved = new List<Channel>(); - foreach(var chat in chats) - { - saved.Add(new Channel - { - ID = chat.ID, - Name = chat.Name, - MaxUsers = chat.MaxUsers, - Topic = chat.Topic, - Users = new List<Save>() - }); - } - File.WriteAllText("chats.json", JsonConvert.SerializeObject(saved)); - } - - /// <summary> - /// Loads the chats. - /// </summary> - /// <returns>The chats.</returns> - public static void LoadChats() - { - chats = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Channel>>(File.ReadAllText("chats.json")); - } - - /// <summary> /// The entry point of the program, where the program control starts and ends. /// </summary> /// <param name="args">The command-line arguments.</param> @@ -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(); } - /// <summary> - /// Users the in chat. - /// </summary> - /// <returns>The in chat.</returns> - /// <param name="chan">Chan.</param> - /// <param name="user">User.</param> - 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)); } |
