Beispiel #1
0
bool permission_isGuest(const char* name)
{
  User* tempuser = userFromName(std::string(name));
  if (tempuser == NULL)
  {
    return false;
  }
  return (IS_GUEST(tempuser->permissions) != 0);
}
Beispiel #2
0
bool permission_isGuest(const char* name)
{
  User* tempuser = User::byNick(name);
  if (tempuser == NULL)
  {
    return false;
  }
  return (IS_GUEST(tempuser->permissions) != 0);
}
Beispiel #3
0
void Chat::registerCommand(Command* command)
{
  // Loop thru all the words for this command
  std::string currentWord;
  std::deque<std::string> words = command->names;
  while(!words.empty())
  {
    currentWord = words[0];
    words.pop_front();

    if(IS_ADMIN(command->permissions))
    {
      m_adminCommands[currentWord] = command;
      continue;
    }

    if(IS_OP(command->permissions))
    {
      m_opCommands[currentWord] = command;
      m_adminCommands[currentWord] = command;
      continue;
    }

    if(IS_MEMBER(command->permissions))
    {
      m_memberCommands[currentWord] = command;
      m_opCommands[currentWord] = command;
      m_adminCommands[currentWord] = command;
      continue;
    }

    if(IS_GUEST(command->permissions))
    {
      // insert into all
      m_guestCommands[currentWord] = command;
      m_memberCommands[currentWord] = command;
      m_opCommands[currentWord] = command;
      m_adminCommands[currentWord] = command;
    }
  }
}