All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.playfab.PlayFabSettings Maven / Gradle / Ivy

Go to download

PlayFab is the unified backend platform for games — everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience.

There is a newer version: 0.118.200901
Show newest version
package com.playfab;

import java.lang.StringBuilder;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import com.playfab.PlayFabErrors.ErrorCallback;

public class PlayFabSettings {
    public static String SdkVersion = "0.108.200402";
    public static String BuildIdentifier = "jbuild_javasdk__sdk-genericslave-3_1";
    public static String SdkVersionString = "JavaSDK-0.108.200402";

    public static Map RequestGetParams;
    static {
        Map getParams = new HashMap();
        getParams.put("sdk", SdkVersionString);
        RequestGetParams = Collections.unmodifiableMap(getParams);
    }

    public static String ProductionEnvironmentUrl = ".playfabapi.com"; // This is only for customers running a private cluster.  Generally you shouldn't touch this
    public static String VerticalName = null; // The name of a customer vertical. This is only for customers running a private cluster. Generally you shouldn't touch this
    public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website)
    public static ErrorCallback GlobalErrorHandler;
    public static String EntityToken = null; // Set by GetEntityToken
    public static String DeveloperSecretKey = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website)
    public static String ClientSessionTicket = null; // Set by any Client Login Call
    public static String AdvertisingIdType = null; // Set this to the appropriate AD_TYPE_X constant below
    public static String AdvertisingIdValue = null; // Set this to corresponding device value

    // DisableAdvertising is provided for completeness, but changing it is not suggested
    // Disabling this may prevent your advertising-related PlayFab marketplace partners from working correctly
    public static Boolean DisableAdvertising = false;
    public static final String AD_TYPE_IDFA = "Idfa";
    public static final String AD_TYPE_ANDROID_ID = "Adid";

    public static String GetURL(String apiCall) {
        StringBuilder sb = new StringBuilder(1000);

        String baseUrl = ProductionEnvironmentUrl;
        if (!baseUrl.startsWith("http")) {
            if (VerticalName != null) {
                sb.append("https://").append(VerticalName);
            } else {
                sb.append("https://").append(TitleId);
            }
        }

        sb.append(baseUrl).append(apiCall);

        boolean firstParam = true;
        for (Map.Entry paramPair : RequestGetParams.entrySet()) {
            if (firstParam) {
                sb.append("?");
                firstParam = false;
            } else {
                sb.append("&");
            }
            sb.append(paramPair.getKey()).append("=").append(paramPair.getValue());
        }

        return sb.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy