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 retrieve from the web portal console. (GAME 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, "7" for XboxLive, "8" for PlayStationNetwork, "9" for Nintendo. (GAME CLIENT ONLY)
  • chat_msg_cache_max_bytes: The maximum size of the local cache for chat messages. (in bytes). (GAME CLIENT ONLY)
  • title_region_config_data_cache_max_bytes: The maximum size of the local cache for title region config data. (in bytes). (GAME 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. (GAME CLIENT ONLY)
  • title_region_id: Specify the title region that the server should access. This configuration is only applicable to servers that do not use the PGOS DS Hosting service, while both online DS (deployed in the PGOS cloud environment) and local DS (configured with a local placer ID) that utilize the PGOS DS Hosting service do not require this configuration. (DEDICATED SERVER ONLY)
  • ds_hosting_feature_enable: Enable the PGOS DS Hosting feature or not. If this feature is not being used, disabling it can speed up SDK initialization. "true" for enable, "false" for disable. (DEDICATED SERVER 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);