Ejemplo n.º 1
0
    private void HttpLoad()
    {
        game_container.clearWorlds();
        requested_level = 0;
        game_container.fillStubs(4);
        GetNode <ScrollContainer>("MainContainer/ScrollContainer").ScrollVertical = 0;
        connectionLost(lost: false);

        string url = GDKnyttSettings.ServerURL + "/levels/?";

        if (filter_category_int != 0)
        {
            url += $"category={filter_category_int}&";
        }
        if (filter_difficulty_int != 0)
        {
            url += $"difficulty={filter_difficulty_int}&";
        }
        if (filter_size_int != 0)
        {
            url += $"size={filter_size_int}&";
        }
        if (filter_text != null && filter_text != "")
        {
            url += $"text={Uri.EscapeDataString(filter_text)}&";
        }
        url += $"order={filter_order_int}";

        http_levels_node.CancelRequest();
        var error = http_levels_node.Request(url);

        if (error != Error.Ok)
        {
            connectionLost();
        }
    }