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:
Commands.cs Stuff that Matters:
I have my account rank set to 6.
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;
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;
}
