namespace Holo.Source.Managers.User { using Holo; using Ion.Storage; using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Threading; public static class FuserightManager { private static Hashtable Storage; public static void GenerateFuseList(int UserID, ref List FuseList) { FuseList = new List(); try { foreach (Fuse fuse in Storage.Values) { if (fuse.IsBindedToUser(UserID)) { FuseList.Add(fuse.GetFuseData); } } } catch { } } public static void Init(bool Update) { DataTable table; Out.WriteLine("Caching fuseright system"); Storage = new Hashtable(); using (DatabaseClient client = Eucalypt.dbManager.GetClient()) { table = client.getTable("SELECT * FROM system_fuserights"); } foreach (DataRow row in table.Rows) { int num = Convert.ToInt32(row["id"]); int num2 = 0; try { num2 = Convert.ToInt32(row["userid"]); } catch { } Fuse fuse = new Fuse(Convert.ToString(row["fuseright"]), num, Convert.ToInt32(row["minrank"]), num2); Storage.Add(num, fuse); } Out.WriteLine("Fuserights cached"); if (Update) { Thread.CurrentThread.Abort(); } } } }