update the Player list
@param string $login
@param string[] $blockedPlayerList
2786
final function updatePlayerList(array $blockedPlayerList, $setLocalAllyAction, $unsetLocalAllyAction, $maxAllyCount, $player = '')
	{
		if($player)
		{
			$playerLists = Windows\PlayerList::Get($player);
		}
		else
		{
			$playerLists = Windows\PlayerList::GetAll();
		}
		foreach($playerLists as $playerList)
		{
			$recipient = $playerList->getRecipient();
			$allies = \ManiaLivePlugins\MatchMakingLobby\Services\AllyService::getInstance()->getAll($recipient);
			$loginsWithUnsetAction = array_map(function (\ManiaLivePlugins\MatchMakingLobby\Services\Ally $a)
			{
				if($a->type == \ManiaLivePlugins\MatchMakingLobby\Services\Ally::TYPE_LOCAL)
				{
					return $a->login;
				}
			}, $allies);
			$loginsWithNoAction = array_map(function (\ManiaLivePlugins\MatchMakingLobby\Services\Ally $a)
			{
				if($a->type == \ManiaLivePlugins\MatchMakingLobby\Services\Ally::TYPE_GENERAL)
				{
					return $a->login;
				}
			}, $allies);

			$bilateralAllies = array_map(function (\ManiaLivePlugins\MatchMakingLobby\Services\Ally $a)
			{
				if($a->isBilateral)
				{
					return $a->login;
				}
			}, $allies);
			$storage = Storage::getInstance();
			foreach(array_merge($storage->players, $storage->spectators) as $player)
			{
				if(PlayerInfo::Get($player->login)->isAway())
				{
					continue;
				}
				$ladderPoints = $player->ladderStats['PlayerRankings'][0]['Score'];

				$playerInfo = PlayerInfo::Get($player->login);
				$state = Player::STATE_NOT_READY;
				if($playerInfo->isReady()) $state = Player::STATE_READY;
				if($playerInfo->isInMatch) $state = Player::STATE_IN_MATCH;
				if(array_key_exists($player->login, $blockedPlayerList)) $state = Player::STATE_BLOCKED;

				if($player->login == $recipient)
				{
					$action = null;
					$isAlly = false;
				}
				elseif(in_array($player->login, $loginsWithNoAction))
				{
					$action = null;
					$isAlly = true;
				}
				elseif(in_array($player->login, $loginsWithUnsetAction))
				{
					$action = $unsetLocalAllyAction;
					$isAlly = true;
				}
				else
				{
					$action = (count($allies) >= $maxAllyCount ? null : $setLocalAllyAction);
					$isAlly = false;
				}
				$isBilateral = in_array($player->login, $bilateralAllies);

				$playerList->setPlayer($player->login, $player->nickName, $ladderPoints, $state, $action, $isAlly, $isBilateral);
			}
		}
		Windows\PlayerList::RedrawAll();
	}
446338
public function setVote($login, $vote)
    {
        $player = $this->playerStorage->getPlayerInfo($login);

        $obj = [
            "login" => $login,
            "nickname" => $player->getNickName(),
            "vote" => $vote,
        ];

        $this->changedVotes[$player->getLogin()] = new MxVote((object)$obj);
        $this->chatNotification->sendMessage('expansion_mxkarma.chat.votechanged', $login);
    }
347360
public function loadByLogin($login)
    {
        try {
            return $this->innerGateway->loadByLogin($login);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
318240
public function getPlayerPosition($login)
    {
        return isset($this->positionPerPlayer[$login]) ? $this->positionPerPlayer[$login] : null;
    }
640548
public function getPlayerRecord($login)
    {
        return isset($this->recordsPerPlayer[$login]) ? $this->recordsPerPlayer[$login] : null;
    }
994958
function getMultiplayerPlayer($titleId, $login)
	{
		if(!$login)
		{
			throw new Exception('Invalid login');
		}
		return $this->execute('GET', $this->getPrefixEndpoint($titleId).'/rankings/multiplayer/player/%s/?title=%s', array($login, $titleId));
	}
267984
public static function loginUser( $login, $password, $authenticationMatch = false )
    {
        $user = self::_loginUser( $login, $password, $authenticationMatch );

        if ( is_object( $user ) )
        {
            self::loginSucceeded( $user );
            return $user;
        }
        else
        {
            self::loginFailed( $user, $login );
            return false;
        }
    }
1094907
public function setUserBlockedStatus($username, $blocked = true)
    {
        $this->username = $username;
        $this->getMeta()->blocked = $blocked;
        $this->getMeta()->save();
    }
1119367
public function loadForPlayers($mapUid, $nbLaps, $logins)
    {
        $logins = array_diff($logins, array_keys($this->recordsPerPlayer));

        if (!empty($logins)) {
            $records = $this->recordQueryBuilder->getPlayerMapRecords($mapUid, $nbLaps, $logins);

            foreach ($records as $record) {
                $this->recordsPerPlayer[$record->getPlayer()->getLogin()] = $record;
            }
        }
    }
1059641
public function callbackCallCommand(ManialinkInterface $manialink, $login, $params, $arguments)
    {
        $this->chatCommandDataProvider->onPlayerChat(-1, $login, '/'.$arguments['command'], true);
    }
541887
public function updateCMSFields(FieldList $fields)
    {
        $fields->addFieldToTab(
            'Root.MFA',
            $checkbox = CheckboxField::create(
                'EnforceMFA',
                _t(self::class . '.ENFORCEMFA', 'Enforce MFA on all users'),
                $this->isMFAEnforced()
            )
        );
        $checkbox->setDescription(null);

        $this->updateCheckboxDescription($fields);
    }
1053630
public function onPlayerInfoChanged($playerInfo)
    {
        $playerData = $this->playerStorage->getPlayerInfo($playerInfo['Login']);

        $newPlayerData = clone $playerData;
        $newPlayerData->merge($playerInfo);

        $this->playerStorage->onPlayerInfoChanged($playerData, $newPlayerData);
        $this->dispatch(__FUNCTION__, [$playerData, $newPlayerData]);
    }
1046913
static function updateLastVisit( $userID, $updateLoginCount = false )
    {
        if ( isset( $GLOBALS['eZUserUpdatedLastVisit'] ) )
            return;
        $db = eZDB::instance();
        $userID = (int) $userID;
        $userVisitArray = $db->arrayQuery( "SELECT 1 FROM ezuservisit WHERE user_id=$userID" );
        $time = time();

        if ( isset( $userVisitArray[0] ) )
        {
            $loginCountSQL = $updateLoginCount ? ', login_count=login_count+1' : '';
            $db->query( "UPDATE ezuservisit SET last_visit_timestamp=ABS(current_visit_timestamp), current_visit_timestamp=$time$loginCountSQL WHERE user_id=$userID" );
        }
        else
        {
            $intialLoginCount = $updateLoginCount ? 1 : 0;
            $db->query( "INSERT INTO ezuservisit ( current_visit_timestamp, last_visit_timestamp, user_id, login_count ) VALUES ( $time, $time, $userID, $intialLoginCount )" );
        }
        $GLOBALS['eZUserUpdatedLastVisit'] = true;
    }
1239519
public function callbackApply(ManialinkInterface $manialink, $login, $entries, $args)
    {
        /** @var GridBuilder $grid */
        $grid = $manialink->getData('grid');
        $grid->updateDataCollection($entries); // update datacollection

        // build settings array from datacollection
        $settings = [];
        foreach ($grid->getDataCollection()->getAll() as $key => $value) {
            $settings[$value['name']] = $value['value'];
        }

        try {
            $this->factory->getConnection()->setModeScriptSettings($settings);
            $this->closeManialink($manialink);

        } catch (\Exception $ex) {
            // TODO this should use chat notification.
            $this->factory->getConnection()->chatSendServerMessage("error: ".$ex->getMessage());
            $this->console->writeln('$f00Error: $fff'.$ex->getMessage());
        }
    }
299844
public function onPlayerChat(Player $player, $text)
    {
        if ($player->getPlayerId() === 0) {
            return;
        }
        if (substr($text, 0, 1) == "/") {
            return;
        }

        if ($text == "++") {
            $this->setVote($player->getLogin(), 100);
        }

        if ($text == "--") {
            $this->setVote($player->getLogin(), 0);
        }

    }
683948
protected function setGReplay($login)
    {
        if ($this->enabled->get() == false) {
            return;
        }

        $tempReplay = new IXR_Base64("");
        $this->dedimaniaService->setGReplay("", $tempReplay);

        $player = new Player();
        $player->login = $login;
        try {
            $this->factory->getConnection()->saveBestGhostsReplay($player, "exp2_temp_replay");
            $replay = new IXR_Base64(
                $this->fileSystem->getUserData()->readAndDelete(
                    "Replays".DIRECTORY_SEPARATOR."exp2_temp_replay.Replay.Gbx")
            );
            $this->dedimaniaService->setGReplay($login, $replay);
        } catch (\Exception $e) {
            $this->console->writeln('Dedimania: $f00Error while fetching GhostsReplay');
        }

    }
528583
protected function getNewRecord($login)
    {
        $record = new Record();
        $record->setPlayer($this->playerDb->get($login));
        $record->setNbLaps($this->currentNbLaps);
        $record->setNbFinish(0);
        $record->setMapUid($this->currentMapUid);

        return $record;
    }