public function index()
 {
     $options = array("address" => "gameservers.address ASC, gameservers.port ASC", "name" => "gameservers.name ASC", "game" => "games.name ASC", "map" => "gameservers.map ASC", "players" => "gameservers.numplayers DESC, gameservers.maxplayers DESC", "ping" => "gameservers.ping ASC");
     if (isset($_GET['sort']) && array_key_exists($_GET['sort'], $options)) {
         $sortkey = $_GET['sort'];
         $sort = $options[$_GET['sort']];
     } else {
         $sort = $options['name'];
         $sortkey = "name";
     }
     $content = Content::find_by_permalink("servers", false);
     $servers = Gameserver::find_all("gametypes.deleted = false AND gameservers.online = 1", $sort);
     $this->assign("servers", $servers);
     $this->assign("content", $content);
     $this->assign("sort", $sortkey);
     $this->title = "Servers";
     $this->render("gameserver/index.tpl");
 }