- Last Updated
PC-Bang Integration
Understanding
PC-Bang integration is a feature that lets a game use the STOVE PC-Bang service.
For users who connect from a Smilegate PC-Bang affiliate IP, PC-Bang connection confirmation, login/logout, benefit refresh, and billing are handled automatically.
Integration uses a separate PCBang SDK provided by the STOVE PC SDK.
Be sure to know this
PCBang SDK integration is an optional item. You only need to integrate it if you want to use the Stove PC-Bang service, and it's applied via client integration.
The PCBang SDK is a feature usable only domestically.
This feature is not supported when running the game through the Steam Launcher. Therefore, you cannot use it if you're running the game through the Steam Launcher.
Application Environment and Operating Scope
| Item | Details |
|---|---|
| Provided platform | PC SDK 3.0 (PCBang SDK) only. Client integration. |
| Operating country | Usable domestically only. |
| Applicability | Optional. Integrated only for games that use the Stove PC-Bang service. |
| Connection recognition | Recognized when connecting from a Smilegate PC-Bang affiliate IP. Non-PC-Bang connections are bypassed with no callback handling. |
PC-Bang Benefit Types
The benefit tier of a PC-Bang-connected user is delivered as a PCBangPremium enum value.
| Value | Description |
|---|---|
| PCBANG_ERROR = -1 | Error. |
| PCBANG_PREMIUM = 1 | Premium. |
| PCBANG_FREE = 2 | Free affiliate. |
| PCBANG_FREE_OTHER = 3 | Home (non-PC-Bang) free affiliate. |
PC-Bang connection is valid when it's PCBANG_PREMIUM or PCBANG_FREE.
Proceed with user login only when the connection is confirmed; otherwise, don't proceed with PC-Bang integration actions.
Automatic Benefit Refresh Every 4 Minutes
After a PC-Bang user's login completes, the PCBang SDK automatically refreshes PC-Bang benefits every 4 minutes.
The game doesn't need to implement its own timer.
| Timing | Action |
|---|---|
| Right after user login | StovePCBangUserLogin callback delivers the initial benefit info. |
| Every 4 minutes (loop) | StovePCRefreshUserBenefits callback delivers the refreshed benefit info. |
| On user logout | The 4-minute refresh operation ends. |
Integration Guide
Integration Preparation
| Item | Details |
|---|---|
| Base SDK integration | To use PC-Bang features, Base SDK integration into the game must come first. |
| Base SDK initialization | Complete Base SDK initialization via the Base_Initialize API. If Base SDK initialization isn't complete, the PCBang SDK can't be used. |
| Include the PCBang SDK header | Include the PCBangSDK.h header file. Declare use of the Stove::PCSDK::PCBang namespace. |
| Callback-driving environment | Call Base_RunCallback() periodically in the game loop to handle SDK asynchronous API callbacks. |
Development
PC (PCSDK) — PCBang SDK
This is a PC-SDK-only feature.
PCBang SDK integration is optional and works only domestically. In non-PC-Bang environments, don't proceed with the subsequent steps.
Prerequisites
- BaseSDK integration and initialization (
Base_Initialize) must come first. Initializing the PCBang SDK before initialization fails. Base_RunCallback()must be called periodically in the game loop for the callback to be delivered correctly.- Include the
PCBangSDK.hheader and use theStove::PCSDK::PCBangnamespace. - The cleanup order must proceed as
PCBang_UserLogout→PCBang_UnInitialize→Base_UnInitialize.
Development Flow
- Initialization
After
Base_Initializecompletes, initialize the PCBang SDK withPCBang_Initialize(), and after it succeeds, call the PC-Bang status lookup. - PC-Bang status lookup
Receive the PC-Bang status object with
PCBang_CheckPCBangStatus(...)and inspect the benefit tier. UseStovePCBangStatus::GetPremiumStatus().PCBANG_PREMIUM/PCBANG_FREE→ PC-Bang connection. Proceed to the next stepPCBANG_FREE_OTHER/PCBANG_ERROR→ don't proceed with subsequent steps
- User login
When the PC-Bang connection is confirmed, call
PCBang_UserLogin(...). It registers the initial-login callback and the 4-minute-interval refresh callback at once. In the initial-login callback, get the benefit code, PC-Bang unique number (serial number), and remaining time, and reflect them in the game state. - Automatic benefit refresh
After login, the benefit-refresh callback (
StovePCRefreshUserBenefits) is called automatically every 4 minutes. No game-side timer is needed; just reflect the callback values. - User logout
Right before the game exits, call
PCBang_UserLogout(...)to end billing and benefit refresh. - Cleanup
Clean up with
PCBang_UnInitialize()thenBase_UnInitialize(), and terminate the game process. - Version check (optional)
When contacting technical support, include the version string obtained via
PCBang_GetVersion(buffer, length).
Troubleshooting
| Situation | Cause | Solution |
|---|---|---|
The PCBang_Initialize call fails right after game entry | You initialized the PCBangSDK while BaseSDK initialization wasn't finished. The PCBangSDK depends on the user/environment info the BaseSDK provides. | Call PCBang_Initialize after the BaseSDK initialization callback (OnInitializeFinished) succeeds. Initializing in the order BaseSDK → PCBangSDK in the boot sequence avoids issues. |
PCBang_CheckPCBangStatus returns PCBANG_ERROR (-1) | This API sends an HTTP call to the STOVE /pcbang/v1.0/user/status endpoint. If network disconnection or server-response failure persists, PC-Bang status can't be determined, so PCBANG_ERROR is returned. Since the SDK has internal auto-retry logic, the PCBANG_ERROR the game receives is already after all retries have failed. | The game doesn't need to make additional calls. When PCBANG_ERROR is returned, don't proceed with subsequent steps like PCBang_UserLogin. Showing the user the normal (non-PC-Bang) play flow as-is avoids issues. |
PCBANG_FREE_OTHER is returned | The user is connected from a free-affiliate PC (usually at home). Since it isn't a PC-Bang, don't proceed with the PC-Bang user-login flow. | Classify PCBANG_FREE_OTHER as a non-PC-Bang environment and branch to the normal play flow. Not showing the PC-Bang benefit screen and proceeding with the game as usual avoids issues. |
The RefreshUserBenefits callback isn't called for a long time | If Base_RunCallback() isn't called in the game main loop, the SDK can't deliver the 4-minute benefit refresh to the game. | Call Base_RunCallback() every frame or at a regular interval in the main loop. Calling it once between input handling and rendering avoids issues. |
| The 4-minute refresh callback never comes even once | You didn't call PCBang_UserLogin or the call failed. Or PCBang_UserLogout was already called, so the SDK regards the user as logged out. | Call PCBang_UserLogin on game entry in a PC-Bang environment and confirm the success result. Organizing the flow so logout is called only once right before game exit means the 4-minute refresh comes in normally, which avoids issues. |
| Even after the game exits, the user session appears active for a while on the PC-Bang owner's side | PCBang_UserLogout sends an HTTP POST to the STOVE /pcbang/v1.0/game/logout endpoint to signal session termination. If the game exits without calling it, the STOVE backend regards the game session as still in progress and shows it as active to the PC-Bang side. The same situation can occur on a game crash or forced termination. | You must include the PCBang_UserLogout call in the game's normal exit sequence. To reduce the chance of abnormal termination, calling logout as early as possible in the exit-handling flow avoids issues. |
| Cleaning up the BaseSDK first and then the PCBangSDK makes the logs awkward or drops some handling | The PCBangSDK uses common resources the BaseSDK provides (global SDK state, logging context, etc.). If the BaseSDK is cleaned up first, the context expected at PCBangSDK cleanup is gone, so post-processing may not proceed correctly. | Cleanup must follow the reverse-registration order PCBang_UserLogout → PCBang_UnInitialize → Base_UnInitialize. If you use multiple modules, cleaning up all SDK modules and then the BaseSDK last avoids issues. |
The RefreshUserBenefits callback is called even in the PCBANG_FREE state
Free-affiliate (PC-Bang) users are also PC-Bang connections, so the 4-minute refresh callback is delivered normally. Just branch the game-side handling by benefit tier.
Sample Code
// PCBang SDK C/C++ API example. Unreal uses it the same way.
#include "PCBangSDK.h"
using namespace Stove::PCSDK;
using namespace Stove::PCSDK::Base;
using namespace Stove::PCSDK::PCBang;
// 1) Initialization (after Base_Initialize completes)
auto initResult = PCBang_Initialize();
if (!initResult.IsSuccessful())
{
return;
}
// 2) Look up PC-Bang status
PCBang_CheckPCBangStatus(
[](CallbackResult callbackResult, StovePCBangStatus status)
{
if (!callbackResult.GetResult().IsSuccessful()) return;
auto premium = status.GetPremiumStatus();
if (premium != PCBangPremium::PCBANG_PREMIUM &&
premium != PCBangPremium::PCBANG_FREE)
{
// Not a PC-Bang connection. Don't proceed with subsequent steps
return;
}
// 3) PC-Bang user login (registers the initial-login + 4-minute-interval refresh callbacks together)
PCBang_UserLogin(
[](CallbackResult loginResult, StovePCBangUserLogin login)
{
if (loginResult.GetResult().IsSuccessful())
{
int32_t serial = login.GetPCBangSerialNumber();
int32_t remain = login.GetRemainTime();
// Reflect the benefit in the game state
}
},
// 4) Benefit-refresh callback called automatically every 4 minutes
[](CallbackResult refreshResult, StovePCRefreshUserBenefits benefits)
{
if (refreshResult.GetResult().IsSuccessful())
{
// This callback is called even in the PCBANG_FREE state.
auto premium = benefits.GetPremiumStatus();
}
}
);
}
);
// 5) On game exit
PCBang_UserLogout([](CallbackResult result) { /* handle the result */ });
PCBang_UnInitialize();
// Then call Base_UnInitialize