public function onCompletion(Server $server)
 {
     $friends = [Session::FRIEND_LEVEL_NONE => [], Session::FRIEND_LEVEL_ACQUAINTANCE => [], Session::FRIEND_LEVEL_GOOD_FRIEND => [], Session::FRIEND_LEVEL_BEST_FRIEND => []];
     if ($this->session->getPlayer()->isOnline()) {
         $result = $this->getResult()["result"];
         foreach ($result as $row) {
             $type = $row["type"];
             $nick = array_filter(explode("|", $row["nicks"]))[0];
             $isOnline = $server->getPlayerExact($nick) instanceof Player;
             $class = $type & ~Session::FRIEND_BITMASK_REQUEST;
             $req = $type & Session::FRIEND_BITMASK_REQUEST;
             if ($isOnline) {
                 $nick = TextFormat::GREEN . "*" . TextFormat::WHITE . $nick;
             }
             if ($req === Session::FRIEND_IN) {
                 $nick .= TextFormat::GOLD . ">";
             } elseif ($req === Session::FRIEND_OUT) {
                 $nick .= TextFormat::DARK_AQUA . "<";
             }
             $nick .= TextFormat::WHITE;
             $friends[$class][] = $nick;
         }
         $this->session->send(Phrases::CMD_FRIEND_LIST_KEY);
         $this->session->sendCurlyLines();
         foreach ($friends as $class => $list) {
             $type = $this->session->translate(Session::$FRIEND_TYPES[$class]);
             $this->session->setMaintainedPopup(TextFormat::BLUE . $type . ": " . implode(TextFormat::WHITE . ":", $list));
         }
         $this->session->sendCurlyLines();
     }
 }