Default is always Primary group. Ranks not shown (Player Ranking)Solved

Hello.

I already used Better Chat, so my conf/data should be ok.
Logic is: You rank up with Playtime: Pro = 10 hours / Elite = 20h / Legend = 30h
Each Rank should be shown in Chat before the name: Default = Noob // Pro = Pro .....
This worked so far on my older server withhout problems.

My Config look like this:
{
"Maximal Titles": 4,
"Maximal Characters Per Message": 128,
"Reverse Title Order": false
}

My Data like this:

[
{
"GroupName": "default",
"Priority": 3,
"Title": {
"Text": "[Noob]",
"Color": "#53753C",
"Size": 15,
"Hidden": false,
"HiddenIfNotPrimary": true
},
"Username": {
"Color": "#53753C",
"Size": 15
},
"Message": {
"Color": "white",
"Size": 15
},
"Format": {
"Chat": "{Title} {Username}: {Message}",
"Console": "{Title} {Username}: {Message}"
}
},
{
"GroupName": "Pro",
"Priority": 2,
"Title": {
"Text": "[Pro]",
"Color": "#55aaff",
"Size": 15,
"Hidden": false,
"HiddenIfNotPrimary": true
},
"Username": {
"Color": "#55aaff",
"Size": 15
},
"Message": {
"Color": "white",
"Size": 15
},
"Format": {
"Chat": "{Title} {Username}: {Message}",
"Console": "{Title} {Username}: {Message}"
}
},
{
"GroupName": "Elite",
"Priority": 1,
"Title": {
"Text": "[Elite]",
"Color": "#ff0000",
"Size": 15,
"Hidden": false,
"HiddenIfNotPrimary": true
},
"Username": {
"Color": "#5E2129",
"Size": 15
},
"Message": {
"Color": "white",
"Size": 15
},
"Format": {
"Chat": "{Title} {Username}: {Message}",
"Console": "{Title} {Username}: {Message}"
}
},
{
"GroupName": "Legend",
"Priority": 0,
"Title": {
"Text": "[Legend]",
"Color": "#8A2BE2",
"Size": 15,
"Hidden": false,
"HiddenIfNotPrimary": true
},
"Username": {
"Color": "#8A2BE2",
"Size": 15
},
"Message": {
"Color": "white",
"Size": 15
},
"Format": {
"Chat": "{Title} {Username}: {Message}",
"Console": "{Title} {Username}: {Message}"
}
}
]

So when a player reaches the Rank PRO, the game recognizes it, because its in the PRO-Perm-Group and has Access to the specific Rank-Boni.
The player also always stay in Default-Group, i know. But with my DATA-Logic the player should be in Priority-Group PRO and so be shown in chat.
But it's not. There is still NOOB (Default) standing before name.

So i tried to remove myself from Default Group (Perms - So only in PRO-Perm-Group). When i chat, before my Name there is "Player" in blue standing.
This shouldnt be this way, right? So i guess, he doesnt Recognize the other Groups/Ranks.

I searched in Help several groups and as i told, it worked before on other server. What am i doing wrong?

Maybe the additional Mod "PlayerChallenges", which give you additionel Name-Titles in Chat?

Thanks and regards

If you want your ranks to show you have to change the setting "hidden if not primary"  to "false" and you cannot remove yourself or anyone from "default" because everyone is in default group.

 {
    "GroupName": "Noob",
    "Priority": 4,
    "Title": {
      "Text": "[Noob]",
      "Color": "#00ffffff",
      "Size": 17,
      "Hidden": false,
      "HiddenIfNotPrimary": false
    },
    "Username": {
      "Color": "#ffff00ff",
      "Size": 17
    },
    "Message": {
      "Color": "#ffffffff",
      "Size": 17
    },
    "Format": {
      "Chat": "{Title} {Username}: {Message}",
      "Console": "{Title} {Username}: {Message}"
    }
  },
  {
    "GroupName": "Newbie",
    "Priority": 3,
    "Title": {
      "Text": "[Newbie]",
      "Color": "#00ffffff",
      "Size": 17,
      "Hidden": false,
      "HiddenIfNotPrimary": false
    },
    "Username": {
      "Color": "#ffff00ff",
      "Size": 17
    },
    "Message": {
      "Color": "#ffffffff",
      "Size": 17
    },
    "Format": {
      "Chat": "{Title} {Username}: {Message}",
      "Console": "{Title} {Username}: {Message}"
    }
  },
  {
    "GroupName": "Spaz",
    "Priority": 2,
    "Title": {
      "Text": "[Spaz]",
      "Color": "#00ffffff",
      "Size": 17,
      "Hidden": false,
      "HiddenIfNotPrimary": false
    },
    "Username": {
      "Color": "#ffff00ff",
      "Size": 17
    },
    "Message": {
      "Color": "#ffffffff",
      "Size": 17
    },
    "Format": {
      "Chat": "{Title} {Username}: {Message}",
      "Console": "{Title} {Username}: {Message}"
    }
  },​

so figured out the problem i found this in another thread do exactly this 

I'll see about making a pull request, but I changed line 838 to the following and it's working for me now:

 var groups = _instance._chatGroups.Where(g => oxideGroups.Any(name => g.GroupName.ToLower() == name.ToLower())).ToList();

lextronicgaming

so figured out the problem i found this in another thread do exactly this 

I'll see about making a pull request, but I changed line 838 to the following and it's working for me now:

 var groups = _instance._chatGroups.Where(g => oxideGroups.Any(name => g.GroupName.ToLower() == name.ToLower())).ToList();

Never had any problem with this using the config i posted above with 18 groups/ranks as well as default, admin, vips and using PlayerRankings plugin and shows them all in order when typing /ranks

I know oxide made some changes recently in regards to case insensitivity in regards to group names which may account for it working for you previously?  The code change in the other thread was mine and forces the oxide group names to lower case for the comparison prior to displaying them. default likely works because it's all lowercase.  You might be able to remove the groups, then re-add them with only lower case letters, or the code change should work too.

As you can see from the excerpt from my config the Group/Rank has a Capitol letter and it shows that way when typing /ranks and also in chat,  I have not changed anything in PlayerRankings or BetterChat,

The original posts config should really have *for default group
"Hidden" : true,
"HiddenIfNotPrimary" : true,

That way any new player will only show player name and only show a group/rank when they have achieved one.

I didn't actually fully read the original post, just the reply and was mainly explaining the code change.  @pookins You're right about the HiddenIfNotPrimary change for the config.  If it's still not working after that it may be the case of the group names.

lextronicgaming

so figured out the problem i found this in another thread do exactly this 

I'll see about making a pull request, but I changed line 838 to the following and it's working for me now:

 var groups = _instance._chatGroups.Where(g => oxideGroups.Any(name => g.GroupName.ToLower() == name.ToLower())).ToList();

Thanks! This helped! Your guys are the Best ;)

Lausa

Thanks! This helped! Your guys are the Best ;)

can you change the status to solved :)