<aside> 💡 For games with online feature, you must integrate the following
1) Prevention of excessive immersion in games (in section 4) (click here) 2) Shutdown ⇒ only for games with age rating of below 19. (click here)
If you have any questions, feel free to contact STOVE Store Support.
</aside>
PC SDK provides API to integrate additional services into games.
Additional services supported by PC SDK include custom event log, PC SDK version inquiry, over-immersion prevention notification, shutdown notification, tracking clue inquiry.
Games can send custom in-game events (game logs) to the Stove platform. Also, the game can query the semantic version of the PC SDK currently in use.
PC SDK semantic version inquiry can be obtained as a return value, not a callback.
The Over Immersion Prevention Alert delivers a warning phrase about over immersion in the game through a callback every hour.
Shutdown notification is a system that restricts children under the age of 18 from using the game at a specific time per day of the week by their parents. When the requirements are met, notifications are delivered through callbacks up to 4 times.
In order to communicate with the PC SDK using the additional service API, the game must define a delegate function to connect to the callback pointer of the StovePCCallback
structure below.
public class StovePCCallback
{
public StovePCErrorDelegate OnError;
public StovePCInitializationCompleteDelegate OnInitializationComplete;
public StovePCTokenDelegate OnToken;
public StovePCUserDelegate OnUser;
public StovePCOwnershipDelegate OnOwnership;
public StovePCStatDelegate OnStat;
public StovePCSetStatDelegate OnSetStat;
public StovePCAchievementDelegate OnAchievement;
public StovePCAllAchievementDelegate OnAllAchievement;
public StovePCRankDelegate OnRank;
// Callback called when StashCustomEvent processing is complete
public StovePCStashCustomEventDelegate OnStashCustomEvent;
// ADD 2.6.0 Start
// Callback that is called every hour to prevent over-immersion
public StovePCOverImmersionDelegate OnOverImmersion;
// Callback to be called on shutdown limit
public StovePCShutdownDelegate OnShutdown;
// 2.6.0 End
}
Connect the delegate to the callback of the StovePCCallback
class as in Integrating 2) Config, Callback Settings
.
// Create StovePCCallback class instance
this.callback = new StovePCCallback
{
OnError = new StovePCErrorDelegate(this.OnError),
OnInitializationComplete = new StovePCInitializationCompleteDelegate(this.OnInitializationComplete),
OnToken = new StovePCTokenDelegate(this.OnToken),
OnUser = new StovePCUserDelegate(this.OnUser),
OnOwnership = new StovePCOwnershipDelegate(this.OnOwnership),
// game support service
OnStat = new StovePCStatDelegate(this.OnStat),
OnSetStat = new StovePCSetStatDelegate(this.OnSetStat),
OnAchievement = new StovePCAchievementDelegate(this.OnAchievement),
OnAllAchievement = new StovePCAllAchievementDelegate(this.OnAllAchievement),
OnRank = new StovePCRankDelegate(this.OnRank),
//Extra service
OnStashCustomEvent = new StovePCStashCustomEventDelegate(this.OnStashCustomEvent)
// ADD 2.6.0 Start
OnOverImmersion = new StovePCOverImmersionDelegate(this.OnOverImmersion);
OnShutdown = new StovePCShutdownDelegate(this.OnShutdown);
// 2.6.0 End
};
You are not required to implement the OnStashCustomEvent
callback. You only need to connect if your game uses the custom event log feature.
<aside> 💡 Warning
The OnOverImmersion
callback must be implemented if legally required to prevent overimmersion/addiction to games.
The OnShutdown
callback must be implemented if a selective shutdown is required by law.
</aside>
Log custom events (game logs) with StovePC.StashCustomEvent
function.
// input parameters
// string name: event name
// string category1 : primary category name
// string category2: 2nd category name
// float simpleValue : simple value
// StovePCCustomEventParameter[] parameters : detailed parameter information
StovePCResult result = StovePC.StashCusomEvent("EVENT_NAME", "CATEGORY1", "CATEGORY2", 1.0f, parameters);
if(result == StovePCResult.NoError)
{
// handle success
}
When the StovePC.StashCustomEvent
function is successfully processed, the OnStashCustomEvent
callback is called.