Skip to content
Stove
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.h header and use the Stove::PCSDK::PCBang namespace.
  • The cleanup order must proceed as PCBang_UserLogoutPCBang_UnInitializeBase_UnInitialize.



Development Flow

  1. Initialization After Base_Initialize completes, initialize the PCBang SDK with PCBang_Initialize(), and after it succeeds, call the PC-Bang status lookup.
  2. PC-Bang status lookup Receive the PC-Bang status object with PCBang_CheckPCBangStatus(...) and inspect the benefit tier. Use StovePCBangStatus::GetPremiumStatus().
    • PCBANG_PREMIUM / PCBANG_FREE → PC-Bang connection. Proceed to the next step
    • PCBANG_FREE_OTHER / PCBANG_ERROR → don't proceed with subsequent steps
  3. 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.
  4. 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.
  5. User logout Right before the game exits, call PCBang_UserLogout(...) to end billing and benefit refresh.
  6. Cleanup Clean up with PCBang_UnInitialize() then Base_UnInitialize(), and terminate the game process.
  7. Version check (optional) When contacting technical support, include the version string obtained via PCBang_GetVersion(buffer, length).



Troubleshooting

SituationCauseSolution
The PCBang_Initialize call fails right after game entryYou 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 returnedThe 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 timeIf 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 onceYou 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 sidePCBang_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 handlingThe 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_UserLogoutPCBang_UnInitializeBase_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

cpp
// 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

Frequently Asked Questions



Q1. Does every game need to apply PC-Bang integration?
A. PCBang SDK integration is an optional item. Only games that want to use the Stove PC-Bang service need to integrate it.
Games that don't use the PC-Bang service are fine with just normal PC SDK integration, without separate integration.
Q2. What's the SDK call order?
A. At game start, call in the order Base_Initialize → PCBang_Initialize → PCBang_CheckPCBangStatus → (if PC-Bang) PCBang_UserLogin.
At game exit, call in the reverse order PCBang_UserLogout → PCBang_UnInitialize → Base_UnInitialize.
Cleaning up the Base SDK first may prevent PCBang SDK cleanup from happening correctly, so following the order matters.
Q3. How does it behave in a non-PC-Bang environment?
A. If the PCBang_CheckPCBangStatus call confirms it isn't a PC-Bang connection, you don't need to proceed with subsequent PC-Bang integration steps.
Proceeding without checking PC-Bang status can cause unnecessary API calls and errors, so we strongly recommend branching after checking PC-Bang status.
Q4. Which value do I use to determine PC-Bang status?
A. You can determine a PC-Bang connection when the return value of StovePCBangStatus's GetPremiumStatus() is PCBANG_PREMIUM or PCBANG_FREE.
PCBANG_FREE_OTHER is a home (non-PC-Bang) free affiliate, so it isn't a PC-Bang user-login target.
PCBANG_ERROR means the lookup itself failed, so don't proceed with subsequent actions.
Q5. What is the callback called every 4 minutes for?
A. After PC-Bang user login, the PCBang SDK automatically refreshes PC-Bang benefits every 4 minutes. Each time it refreshes, the StovePCRefreshUserBenefits callback is delivered to the game.
The game doesn't need to implement its own timer—just reflect the refresh info received via the callback (benefit code, remaining time) in the game state.
When user logout is called, the 4-minute refresh also ends.
Q6. Do I have to call user logout on game exit?
A. Yes, PCBang_UserLogout must be called before game exit.
Logout must be called for PC-Bang user management and billing to end correctly, and the 4-minute benefit refresh also ends.
Exiting the game without logout can affect billing.
Q7. How do I handle it if PCBang SDK initialization fails?
A. If the PCBang SDK initialization step isn't implemented, you can't use PCBang SDK features. First, you need to check whether Base SDK initialization completed correctly.
Initializing the PCBang SDK while Base SDK initialization isn't complete fails, so re-check the call order.
If it still fails, check the SDK version info as well and contact technical support.
Q8. How do I test in a normal, non-PC-Bang environment?
A. The PCBang SDK recognizes a PC-Bang only when connecting from a Smilegate PC-Bang affiliate IP.
In a normal environment, PCBANG_FREE_OTHER or PCBANG_ERROR is returned, and user login and benefit refresh don't work.
If you need to verify behavior in a PC-Bang environment, request test-environment support from the publishing technical contact.
Q9. Can it be used overseas too?
A. The PCBang SDK is a feature usable only domestically. In overseas environments, PC-Bang recognition itself doesn't happen, so there's no integration effect.
Q10. Where can I check the SDK version?
A. If you pass a pre-allocated buffer (e.g., wchar_t buffer[256]) and the buffer size to the PCBang_GetVersion API, the currently integrated SDK version string is filled in and returned.
Including the SDK version info when contacting technical support helps identify the cause quickly.



Need to contact us directly? stove.developers@smilegate.com