public function serverGroupGetProfiles()
  {
    $profiles = array();

    foreach($this->serverGroupList() as $sgid => $sgroup)
    {
      if($sgroup["type"] != \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\TeamSpeak3::GROUP_DBTYPE_REGULAR) continue;

      $profiles[$sgid] = array(
        "b_permission_modify_power_ignore" => 0,
        "i_group_needed_member_add_power" => 0,
        "i_group_member_add_power" => 0,
        "i_group_needed_member_remove_power" => 0,
        "i_group_member_remove_power" => 0,
        "i_needed_modify_power_count" => 0,
        "i_needed_modify_power_total" => 0,
        "i_permission_modify_power" => 0,
        "i_group_needed_modify_power" => 0,
        "i_group_modify_power" => 0,
        "i_client_needed_modify_power" => 0,
        "i_client_modify_power" => 0,
        "b_virtualserver_servergroup_create" => 0,
        "b_virtualserver_servergroup_delete" => 0,
        "b_client_ignore_bans" => 0,
        "b_client_ignore_antiflood" => 0,
        "b_group_is_permanent" => 0,
        "i_client_needed_ban_power" => 0,
        "i_client_needed_kick_power" => 0,
        "i_client_needed_move_power" => 0,
        "i_client_talk_power" => 0,
        "__sgid" => $sgid,
        "__name" => $sgroup->toString(),
        "__node" => $sgroup,
      );

      try
      {
        $perms = $this->serverGroupPermList($sgid, TRUE);
        $grant = isset($perms["i_permission_modify_power"]) ? $perms["i_permission_modify_power"]["permvalue"] : null;
      }
      catch(\ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Adapter\ServerQuery\Exception $e)
      {
        /* ERROR_database_empty_result */
        if($e->getCode() != 0x501) throw $e;

        $perms = array();
        $grant = null;
      }

      foreach($perms as $permsid => $perm)
      {
        if(in_array($permsid, array_keys($profiles[$sgid])))
        {
          $profiles[$sgid][$permsid] = $perm["permvalue"];
        }
        elseif(\ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\String::factory($permsid)->startsWith("i_needed_modify_power_"))
        {
          if(!$grant || $perm["permvalue"] > $grant) continue;

          $profiles[$sgid]["i_needed_modify_power_total"] = $profiles[$sgid]["i_needed_modify_power_total"]+$perm["permvalue"];
          $profiles[$sgid]["i_needed_modify_power_count"]++;
        }
      }
    }

    array_multisort($profiles, SORT_DESC);

    return $profiles;
  }
public function serverGroupGetProfiles()
  {
    $profiles = array();

    foreach($this->serverGroupList() as $sgid => $sgroup)
    {
      if($sgroup["type"] != \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\TeamSpeak3::GROUP_DBTYPE_REGULAR) continue;

      $profiles[$sgid] = array(
        "b_permission_modify_power_ignore" => 0,
        "i_group_needed_member_add_power" => 0,
        "i_group_member_add_power" => 0,
        "i_group_needed_member_remove_power" => 0,
        "i_group_member_remove_power" => 0,
        "i_needed_modify_power_count" => 0,
        "i_needed_modify_power_total" => 0,
        "i_permission_modify_power" => 0,
        "i_group_needed_modify_power" => 0,
        "i_group_modify_power" => 0,
        "i_client_needed_modify_power" => 0,
        "i_client_modify_power" => 0,
        "b_virtualserver_servergroup_create" => 0,
        "b_virtualserver_servergroup_delete" => 0,
        "b_client_ignore_bans" => 0,
        "b_client_ignore_antiflood" => 0,
        "b_group_is_permanent" => 0,
        "i_client_needed_ban_power" => 0,
        "i_client_needed_kick_power" => 0,
        "i_client_needed_move_power" => 0,
        "i_client_talk_power" => 0,
        "__sgid" => $sgid,
        "__name" => $sgroup->toString(),
        "__node" => $sgroup,
      );

      try
      {
        $perms = $this->serverGroupPermList($sgid, TRUE);
        $grant = isset($perms["i_permission_modify_power"]) ? $perms["i_permission_modify_power"]["permvalue"] : null;
      }
      catch(\ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Adapter\ServerQuery\Exception $e)
      {
        /* ERROR_database_empty_result */
        if($e->getCode() != 0x501) throw $e;

        $perms = array();
        $grant = null;
      }

      foreach($perms as $permsid => $perm)
      {
        if(in_array($permsid, array_keys($profiles[$sgid])))
        {
          $profiles[$sgid][$permsid] = $perm["permvalue"];
        }
        elseif(\ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\String::factory($permsid)->startsWith("i_needed_modify_power_"))
        {
          if(!$grant || $perm["permvalue"] > $grant) continue;

          $profiles[$sgid]["i_needed_modify_power_total"] = $profiles[$sgid]["i_needed_modify_power_total"]+$perm["permvalue"];
          $profiles[$sgid]["i_needed_modify_power_count"]++;
        }
      }
    }

    array_multisort($profiles, SORT_DESC);

    return $profiles;
  }
public function serverGroupGetProfiles ( ) { $ profiles = array ( ) ; foreach ( $ this -> serverGroupList ( ) as $ sgid => $ sgroup ) { if ( $ sgroup [ "type" ] != \ ManiaLivePlugins \ Standard \ TeamSpeak \ TeamSpeak3 \ TeamSpeak3 :: GROUP_DBTYPE_REGULAR ) continue ; $ profiles [ $ sgid ] = array ( "b_permission_modify_power_ignore" => 0 , "i_group_needed_member_add_power" => 0 , "i_group_member_add_power" => 0 , "i_group_needed_member_remove_power" => 0 , "i_group_member_remove_power" => 0 , "i_needed_modify_power_count" => 0 , "i_needed_modify_power_total" => 0 , "i_permission_modify_power" => 0 , "i_group_needed_modify_power" => 0 , "i_group_modify_power" => 0 , "i_client_needed_modify_power" => 0 , "i_client_modify_power" => 0 , "b_virtualserver_servergroup_create" => 0 , "b_virtualserver_servergroup_delete" => 0 , "b_client_ignore_bans" => 0 , "b_client_ignore_antiflood" => 0 , "b_group_is_permanent" => 0 , "i_client_needed_ban_power" => 0 , "i_client_needed_kick_power" => 0 , "i_client_needed_move_power" => 0 , "i_client_talk_power" => 0 , "__sgid" => $ sgid , "__name" => $ sgroup -> toString ( ) , "__node" => $ sgroup , ) ; try { $ perms = $ this -> serverGroupPermList ( $ sgid , TRUE ) ; $ grant = isset ( $ perms [ "i_permission_modify_power" ] ) ? $ perms [ "i_permission_modify_power" ] [ "permvalue" ] : null ; } catch ( \ ManiaLivePlugins \ Standard \ TeamSpeak \ TeamSpeak3 \ Adapter \ ServerQuery \ Exception $ e ) { /* ERROR_database_empty_result */ if ( $ e -> getCode ( ) != 0x501 ) throw $ e ; $ perms = array ( ) ; $ grant = null ; } foreach ( $ perms as $ permsid => $ perm ) { if ( in_array ( $ permsid , array_keys ( $ profiles [ $ sgid ] ) ) ) { $ profiles [ $ sgid ] [ $ permsid ] = $ perm [ "permvalue" ] ; } elseif ( \ ManiaLivePlugins \ Standard \ TeamSpeak \ TeamSpeak3 \ Helper \ String :: factory ( $ permsid ) -> startsWith ( "i_needed_modify_power_" ) ) { if ( ! $ grant || $ perm [ "permvalue" ] > $ grant ) continue ; $ profiles [ $ sgid ] [ "i_needed_modify_power_total" ] = $ profiles [ $ sgid ] [ "i_needed_modify_power_total" ] + $ perm [ "permvalue" ] ; $ profiles [ $ sgid ] [ "i_needed_modify_power_count" ] ++ ; } } } array_multisort ( $ profiles , SORT_DESC ) ; return $ profiles ; }
Returns an ordered array of regular server groups available based on a pre-defined
set of rules.

@return array
Returns an ordered array of regular server groups available based on a pre - defined set of rules .