HelpRanks Not Working

Posts 14 of 4 · Page 1 of 1
Ranks Not Working
I'm relatively new to RotMG server programming, so please bear with me.
I guess I set my ranks up incorrectly. I need help fixing them. I can't execute commands or speak in chat.
Player.cs Stuff that Matters:
Code:
        public Player(RealmManager manager, Client psr)
: base(manager, (ushort)psr.Character.ObjectType, psr.Random)
        {
            try
            {
                Client = psr;
                Manager = psr.Manager;
                StatsManager = new StatsManager(this, psr.Random.CurrentSeed);
                Name = psr.Account.Name;
                switch (psr.Account.Rank)
                {
                    case 0:
                        Name = psr.Account.Name; break;
                    case 1:
                        Name = "[P] " + psr.Account.Name; break;
                    case 2:
                        Name = "[Helper] " + psr.Account.Name; break;
                    case 3:
                        Name = "[Mod] " + psr.Account.Name; break;
                    case 4:
                        Name = "[GM] " + psr.Account.Name; break;
                    case 5:
                        Name = "[Dev] " + psr.Account.Name; break;
                    case 6:
                        Name = "[Admin] " + psr.Account.Name; break;
                    case 7:
                        Name = "[Founder] " + psr.Account.Name; break;
                }
                AccountId = psr.Account.AccountId;
                FameCounter = new FameCounter(this);
                Tokens = psr.Account.FortuneTokens;
                HpPotionPrice = 1;
                MpPotionPrice = 1;

                Level = psr.Character.Level == 0 ? 1 : psr.Character.Level;
                Experience = psr.Character.Exp;
                ExperienceGoal = GetExpGoal(Level);
                Stars = GetStars();
                Texture1 = psr.Character.Tex1;
                Texture2 = psr.Character.Tex2;
                Credits = psr.Account.Credits;
                NameChosen = psr.Account.NameChosen;
                CurrentFame = psr.Account.Stats.Fame;
                Fame = psr.Character.CurrentFame;
                XpBoosted = psr.Character.XpBoosted;
                XpBoostTimeLeft = psr.Character.XpTimer;
                xpFreeTimer = XpBoostTimeLeft != -1.0;
                LootDropBoostTimeLeft = psr.Character.LDTimer;
                lootDropBoostFreeTimer = LootDropBoost;
                LootTierBoostTimeLeft = psr.Character.LTTimer;
                lootTierBoostFreeTimer = LootTierBoost;
Commands.cs Stuff that Matters:
Code:
    public abstract class Command
    {
        protected static readonly ILog log = LogManager.GetLogger(typeof (Command));

        public Command(string name, int permLevel = 0)
        {
            CommandName = name;
            PermissionLevel = permLevel;
        }

        public string CommandName { get; private set; }
        public int PermissionLevel { get; private set; }

        protected abstract bool Process(Player player, RealmTime time, string[] args);

        private static int GetPermissionLevel(Player player)
        {
            if (player.Client.Account.Rank == 1)
                return 1;
            return 0;
            if (player.Client.Account.Rank == 2)
                return 2;
            return 0;
            if (player.Client.Account.Rank == 3)
                return 3;
            return 0;
            if (player.Client.Account.Rank == 4)
                return 4;
            return 0;
            if (player.Client.Account.Rank == 5)
                return 5;
            return 0;
            if (player.Client.Account.Rank == 6)
                return 6;
            return 0;
        }
I have my account rank set to 6.
Quote Originally Posted by koalaleader View Post
please help bump
not sure what source u use so no idea how it works but i think the ranks should have a return etc

something like this

switch (psr.Account.Rank)
{
case 0:
Name = psr.Account.Name; return 0;
case 1:
Name = "[P] " + psr.Account.Name; return 1;
case 2:
Name = "[Helper] " + psr.Account.Name; return 2;
case 3:
Name = "[Mod] " + psr.Account.Name; return 3;
case 4:
Name = "[GM] " + psr.Account.Name; return 4;
case 5:
Name = "[Dev] " + psr.Account.Name; return 5;
case 6:
Name = "[Admin] " + psr.Account.Name; return 6;
case 7:
Name = "[Founder] " + psr.Account.Name; return 7;
}

and if that doesnt work then i have no idea

and since u have 2 permission things then they probably blocks each other etc

can maybe help you if you add me on skype: just search for Larsniplayz or Larsni99 [̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅]
Posts 14 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?