Browse Source

Players are now auth'd to the default group when the UUID is empty.

pull/3/head
JustinAJ 10 years ago
parent
commit
2322e3609a
  1. 7
      RenX.ModSystem/RenX_ModSystem.cpp

7
RenX.ModSystem/RenX_ModSystem.cpp

@ -151,8 +151,9 @@ int RenX_ModSystemPlugin::auth(RenX::Server *server, const RenX::PlayerInfo *pla
{
if (player->isBot)
return 0;
ModGroup *group;
if (player->uuid.isEmpty() == false)
{
Jupiter::INIFile::Section *section = RenX_ModSystemPlugin::modsFile.getSection(player->uuid);
if (section != nullptr)
{
@ -168,6 +169,7 @@ int RenX_ModSystemPlugin::auth(RenX::Server *server, const RenX::PlayerInfo *pla
player->formatNamePrefix = section->get(STRING_LITERAL_AS_REFERENCE("Prefix"), group->prefix);
player->gamePrefix = section->get(STRING_LITERAL_AS_REFERENCE("GamePrefix"), group->gamePrefix);
player->access = section->getInt(STRING_LITERAL_AS_REFERENCE("Access"), group->access);
if (player->access != 0)
server->sendMessage(player, Jupiter::StringS::Format("You are now authenticated with access level %d; group: %.*s.", player->access, group->name.size(), group->name.ptr()));
Jupiter::String playerName = RenX::getFormattedPlayerName(player);
server->sendLogChan(IRCCOLOR "03[Authentication] " IRCBOLD "%.*s" IRCBOLD IRCCOLOR " is now authenticated with access level %d; group: %.*s.", playerName.size(), playerName.ptr(), player->access, group->name.size(), group->name.ptr());
@ -199,7 +201,8 @@ int RenX_ModSystemPlugin::auth(RenX::Server *server, const RenX::PlayerInfo *pla
return -1;
}
}
group = RenX_ModSystemPlugin::groups.get(0);
}
group = this->getDefaultGroup();
player->varData.set(this->name, STRING_LITERAL_AS_REFERENCE("Group"), group->name);
player->formatNamePrefix = group->prefix;

Loading…
Cancel
Save