namespace Holo.Managers { using Holo; using System; using System.Collections; using System.Runtime.InteropServices; using System.Text; public static class rankManager { private static Hashtable ᙄ; private static gameRank[] ᙅ; private static gameRank[] 4AAAA; public static bool containsRight(byte rankID, string fuseRight) { rankManager.ᙃ ᙃ = (rankManager.ᙃ) ᙄ[rankID]; for (int i = 0; i < ᙃ.fuseRights.Length; i++) { if (ᙃ.fuseRights[i] == fuseRight) { return true; } } return false; } public static string fuseRights(byte rankID) { string[] fuseRights = ((ᙃ) ᙄ[rankID]).fuseRights; StringBuilder builder = new StringBuilder(); for (int i = 0; i < fuseRights.Length; i++) { builder.Append(fuseRights[i] + Convert.ToChar(2)); } return builder.ToString(); } public static gameRank getGameRank(bool isBattleBall, string Title) { gameRank[] rankArray = null; if (isBattleBall) { rankArray = ᙅ; } else { rankArray = 4AAAA; } foreach (gameRank rank in rankArray) { if (rank.Title == Title) { return rank; } } return new gameRank("holo.cast.gamerank.null", 0, 0); } public static string getGameRankTitle(bool isBattleBall, int Score) { gameRank[] rankArray = null; if (isBattleBall) { rankArray = ᙅ; } else { rankArray = 4AAAA; } foreach (gameRank rank in rankArray) { if ((Score >= rank.minPoints) && ((rank.maxPoints == 0) || (Score <= rank.maxPoints))) { return rank.Title; } } return "holo.cast.gamerank.null"; } public static void Init() { Out.WriteLine("Inizializzo livelli utenti..."); ᙄ = new Hashtable(); for (byte i = 1; i <= 7; i = (byte) (i + 1)) { ᙄ.Add(i, new ᙃ(i)); } Out.WriteLine("7 livvelli caricati."); Out.WriteBlank(); Out.WriteLine("Inizializzo livelli per gioco..."); string[] strArray = DB.runReadColumn("SELECT title FROM games_ranks WHERE type = 'bb' ORDER BY id ASC", 0); int[] numArray = DB.runReadColumn("SELECT minpoints FROM games_ranks WHERE type = 'bb' ORDER BY id ASC", 0, null); int[] numArray2 = DB.runReadColumn("SELECT maxpoints FROM games_ranks WHERE type = 'bb' ORDER BY id ASC", 0, null); ᙅ = new gameRank[strArray.Length]; for (int j = 0; j < ᙅ.Length; j++) { ᙅ[j] = new gameRank(strArray[j], numArray[j], numArray2[j]); Out.WriteLine(string.Concat(new object[] { "Carico livello '", strArray[j], "' [", numArray[j], "-", numArray2[j], "] per il gioco 'BattleBall'." })); } Out.WriteLine("Caricati " + strArray.Length + " livelli per il gioco 'BattleBall'."); strArray = DB.runReadColumn("SELECT title FROM games_ranks WHERE type = 'ss' ORDER BY id ASC", 0); numArray = DB.runReadColumn("SELECT minpoints FROM games_ranks WHERE type = 'ss' ORDER BY id ASC", 0, null); numArray2 = DB.runReadColumn("SELECT maxpoints FROM games_ranks WHERE type = 'ss' ORDER BY id ASC", 0, null); 4AAAA = new gameRank[strArray.Length]; for (int k = 0; k < 4AAAA.Length; k++) { 4AAAA[k] = new gameRank(strArray[k], numArray[k], numArray2[k]); Out.WriteLine(string.Concat(new object[] { "Carico livello '", strArray[k], "' [", numArray[k], "-", numArray2[k], "] per il gioco 'SnowStorm'." })); } Out.WriteLine("Caricati " + strArray.Length + " livelli per il gioco 'SnowStorm'."); } [StructLayout(LayoutKind.Sequential)] private struct ᙃ { internal string[] fuseRights; internal ᙃ(byte rankID) { this.fuseRights = DB.runReadColumn("SELECT fuseright FROM system_fuserights WHERE minrank <= " + rankID, 0); } } [StructLayout(LayoutKind.Sequential)] public struct gameRank { internal int minPoints; internal int maxPoints; internal string Title; internal gameRank(string Title, int minPoints, int maxPoints) { this.Title = Title; this.minPoints = minPoints; this.maxPoints = maxPoints; } } } }