Skip to main content

Configure the PgosSDK Plugin

There are several configurations for the PgosSDK, you can set up from editor setting or codes.

The following is the field explanation:

  • title_id: the title id you retrieve from the web portal console.
  • log_level: the minimum suppression level of logs from PgosSDK. 0 for Info, 1 for Warn; 2 for Error, 3 for No Log.
  • secret_key: the client secret key generated from the web portal console. (CLIENT ONLY)
  • account_provider : 0 for FAS, 1 for INTL, 2 for MSDK, 3 for WeGame, 4 for PlayFab, 5 for Steam, 6 for Epic. (CLIENT ONLY)
  • chat_msg_cache_max_bytes: maximum size of the local cache for chat messages. (in bytes). (CLIENT ONLY)
  • title_region_config_data_cache_max_bytes: maximum size of the local cache for title region config data. (in bytes). (CLIENT ONLY)
  • group_event_msg_filter: configure the event message types supported by the group, empty (default) means all types are supported. Click Event Message Filtering for detail. (CLIENT ONLY)

In the Unity Editor, navigate to Window->PgosSDK->Generate PGOS Setting file->PgosSDK, and you can see the settings as below:

image-20220919161436581

You need to set at least your Title ID and Secret Key to make PGOS work.

Assets/Resources/PgosSettingData.asset will be created or updated if you change the default settings.

2. Set up from codes

When using C#, you can use a Dictionary to store the configurations and pass it to the InitConfig function, and the field name can refer to the field explanation above.

// For client
var clientConfig = new Dictionary<string, string>();
clientConfig.Add("title_id", "Your Title ID");
clientConfig.Add("secret_key", "Your Server Secret Key");
PgosClientSDK.Get().GetClientSDKAPI().InitConfig(clientConfig);

// For server
var serverConfig = new Dictionary<string, string>();
serverConfig.Add("title_id", "Your Title ID");
PgosServerSDK.Get().GetServerSDKAPI().InitConfig(serverConfig);