From 2ac5ea929b09a90e0df9546563f738c9e8a9d29e Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sun, 1 Jan 2012 02:55:54 -0700 Subject: [PATCH] Remove yet another flat file converter from yet another constructor --- TShockAPI/DB/GroupManager.cs | 39 ------------------------------------ 1 file changed, 39 deletions(-) diff --git a/TShockAPI/DB/GroupManager.cs b/TShockAPI/DB/GroupManager.cs index 763d4e29..7e147145 100644 --- a/TShockAPI/DB/GroupManager.cs +++ b/TShockAPI/DB/GroupManager.cs @@ -39,45 +39,6 @@ namespace TShockAPI.DB "ban,unban,whitelist,causeevents,spawnboss,spawnmob,managewarp,time,tp,pvpfun,kill,logs,immunetokick,tphere"); AddGroup("trustedadmin", "admin", "maintenance,cfg,butcher,item,heal,immunetoban,usebanneditem,manageusers"); AddGroup("vip", "default", "reservedslot"); - - String file = Path.Combine(TShock.SavePath, "groups.txt"); - if (File.Exists(file)) - { - using (StreamReader sr = new StreamReader(file)) - { - String line; - while ((line = sr.ReadLine()) != null) - { - if (!line.Equals("") && !line.Substring(0, 1).Equals("#")) - { - String[] info = line.Split(' '); - String comms = ""; - int size = info.Length; - for (int i = 1; i < size; i++) - { - if (!comms.Equals("")) - comms = comms + ","; - comms = comms + info[i].Trim(); - } - - string query = ""; - if (TShock.Config.StorageType.ToLower() == "sqlite") - query = "INSERT OR IGNORE INTO GroupList (GroupName, Commands) VALUES (@0, @1);"; - else if (TShock.Config.StorageType.ToLower() == "mysql") - query = "INSERT IGNORE INTO GroupList SET GroupName=@0, Commands=@1;"; - - db.Query(query, info[0].Trim(), comms); - } - } - } - String path = Path.Combine(TShock.SavePath, "old_configs"); - String file2 = Path.Combine(path, "groups.txt"); - if (!Directory.Exists(path)) - Directory.CreateDirectory(path); - if (File.Exists(file2)) - File.Delete(file2); - File.Move(file, file2); - } }