| 1512 | |
| 1513 | |
| 1514 | void cPlayer::LoadPermissionsFromDisk() |
| 1515 | { |
| 1516 | m_Groups.clear(); |
| 1517 | m_Permissions.clear(); |
| 1518 | |
| 1519 | cIniFile IniFile; |
| 1520 | if (IniFile.ReadFile("users.ini")) |
| 1521 | { |
| 1522 | std::string Groups = IniFile.GetValue(m_PlayerName, "Groups", ""); |
| 1523 | if (!Groups.empty()) |
| 1524 | { |
| 1525 | AStringVector Split = StringSplitAndTrim(Groups, ","); |
| 1526 | for (AStringVector::const_iterator itr = Split.begin(), end = Split.end(); itr != end; ++itr) |
| 1527 | { |
| 1528 | if (!cRoot::Get()->GetGroupManager()->ExistsGroup(*itr)) |
| 1529 | { |
| 1530 | LOGWARNING("The group %s for player %s was not found!", itr->c_str(), m_PlayerName.c_str()); |
| 1531 | } |
| 1532 | AddToGroup(*itr); |
| 1533 | } |
| 1534 | } |
| 1535 | else |
| 1536 | { |
| 1537 | AddToGroup("Default"); |
| 1538 | } |
| 1539 | |
| 1540 | AString Color = IniFile.GetValue(m_PlayerName, "Color", "-"); |
| 1541 | if (!Color.empty()) |
| 1542 | { |
| 1543 | m_Color = Color[0]; |
| 1544 | } |
| 1545 | } |
| 1546 | else |
| 1547 | { |
| 1548 | cGroupManager::GenerateDefaultUsersIni(IniFile); |
| 1549 | AddToGroup("Default"); |
| 1550 | } |
| 1551 | ResolvePermissions(); |
| 1552 | } |
| 1553 | |
| 1554 | |
| 1555 |
nothing calls this directly
no test coverage detected