To initialize the SDK, set the environment value of StoveSDK in the FStovePCConfig structure, and write the example code below into the UMyStoveSDKObject::StoveSDKInit and write the example code below into the function.
Caution
Change YOUR_APP_KEY, YOUR_SECRET_KEY, and YOUR_GAME_ID to the pre-issued data. If you call the UMyStoveSDKObject::StoveSDKInit function without logging into the Stove Launcher, an error occurs.
MyStoveSDKObject.cpp
FStoveResult UMyStoveSDKObject::StoveSDKInit(const FStoveConfig& Config)
{
/*Add some 'follow along' code here:*/
/*In this function, ignore Config received as a function argument. */
//config
FStoveConfig ReplaceConfig{
"LIVE",
"YOUR_APP_KEY",
"YOUR_SECRET_KEY",
"YOUR_GAME_ID",
STOVE_PC_LOG_LEVEL_DEBUG,
"" }; // logpath
FStoveResult ErrorResult = Super::StoveSDKInit(ReplaceConfig);
if (ErrorResult.Result == STOVE_PC_NO_ERROR)
{
OnLog("[Success] StovePC_Init");
}
else
{
OnLog("[Error] StovePC_Init, Result %d", ErrorResult.Result);
}
return ErrorResult;
}
C++
복사
Precautions
The PCSDK log path must be set as an absolute path. ex) C:\Program Files\{Your Game Folder}\Logs Do not add "\" at the end. PCSDK automatically adds the file name "StovePCSDK.log".
If "" is set as an empty string, PCSDK automatically creates a log in the path of the game executable file folder or the folder where the PCSDK DLL is located.
Change YOUR_APP_KEY, YOUR_SECRET_KEY, YOUR_GAME_ID in the code above to the ID and Key-value registered in STOVE Studio (opens new window)in advance. If you call the Super::StoveSDKInit function without logging in to the stove launcher with the stove account applied for entry into STOVE Studio, error code 150 (sgup initialization failure) occurs.
If the return value of the UMyStoveSDKObject::StoveSDKInit function is STOVE_PC_NO_ERROR that is, 'success', enter true in the _isOnCallback value in the UStoveSDKObject::StoveSDKInit function, which is the super class of UMyStoveSDKObject. You will use the UStoveSDKObject::Tick function like a timer.
To check whether the UMyStoveSDKObject::StoveSDKInit function was successfully completed, add OnLog to the callback UMyStoveSDKObject::OnInitComplete function as shown below.
void UMyStoveSDKObject::OnInitComplete()
{
/*Add the 'walkthrough' codes here.*/
OnLog("[Success] InitComplete");
}
C++
복사
If the UMyStoveSDKObject::StoveSDKInit function or any other plugin's function call fails, you can check the error code through the callback UMyStoveSDKObject::OnError function. To check the error code, you can get error information through the FStoveError structure entered as an argument for the UMyStoveSDKObject::OnError function shown below.
MyStoveSDKObject.cpp
void UMyStoveSDKObject::OnError(FStoveError Error)
{
/*Add the 'walkthrough' codes here.*/
OnLog("[Error]");
OnLog("FuncType: %d", Error.FunctionType);
OnLog("Result: %d", Error.ErrorResult.Result);
OnLog("ExternalError: %d", Error.ExternalError);
}
C++
복사