Server maintenance
When providing the app service, there are situations where you need to display a server maintenance popup due to regular or emergency server maintenance, and either terminate the app or redirect users to another site. In this way, the Hive SDK provides a notification popup that can respond to server maintenance situations.
Popup | Description |
---|---|
Server Maintenance | You can set the maintenance status for each game server, and it is recommended to provide game-related links during the maintenance period |
Exposure method¶
- Register the desired server maintenance notice popup in the Hive console.
- Register the server ID to be maintained in the Hive console app center.
- Call Configuration.setServerId to input the server information to be maintained.
- When calling
AuthV4.checkMaintenance
at the time of server maintenance, the registered popup will be displayed when accessing the corresponding server.
The point at which server maintenance is performed means blocking access to the user app server for server maintenance and logging out users who have already connected to the server. You can set the desired server maintenance time zone when registering a popup in the Hive console.
Note
After successfully initializing the Hive SDK, you must call AuthV4.checkMaintenance
.
Info
It is recommended to always run AuthV4.checkMaintenance
in the app. This allows for easy exposure of periodic server maintenance pop-ups, such as regular server checks.
An example of calling AuthV4.checkMaintenance
is as follows.
API Reference: Unity®
using hive;
// Whether to use Hive SDK UI
Boolean isShow = true;
AuthV4.checkMaintenance(isShow, (ResultAPI result, List maintenanceInfoList) => {
if (isShow) {
if (result.isSuccess()) {
// There's nothing to check
} else if (result.needExit()) {
// TODO: Implement app termination functionality
// Example) Application.Quit();
} else {
// Network error or other. try again.
}
} else { // isShow false
if (result.isSuccess()) {
if (maintenanceInfoList.Any()) {
// TODO: Show custom maintenance dialog.
} else {
// There's nothing to check
}
} else {
// Network error or other. try again.
}
}
});
API Reference: C++
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;
// Whether to use Hive SDK UI
bool isShow = true;
AuthV4::checkMaintenance(isShow, [=](ResultAPI const & result, vector const & maintenanceInfolist){
if (isShow) {
if (result.isSuccess()) {
// There's nothing to check
} else if (reuslt.needExit()) {
// TODO: Implement app termination functionality
// Cocos2d-x engine user
// Example) exit(0);
// Unreal Engine User
// Example) UKismetSystemLibrary::QuitGame(GetWorld(), nullptr, EQuitPreference::Quit, false);
} else {
// Network error or other. try again.
}
} else { // isShow false
if (result.isSuccess()) {
if (maintenanceInfolist.size() > 0) {
// TODO: Show custom maintenance dialog.
} else {
// There's nothing to check
}
} else {
// Network error or other. try again.
}
}
});
API Reference: Kotlin
import com.hive.AuthV4;
import com.hive.AuthV4;
import com.hive.ResultAPI;
// Hive SDK UI 사용 여부
val isShow = true
AuthV4.checkMaintenance(isShow, object : AuthV4.AuthV4MaintenanceListener {
override fun onAuthV4Maintenance(result: ResultAPI, maintenanceInfo: ArrayList<AuthV4.AuthV4MaintenanceInfo>?) {
if (isShow) {
if (result.isSuccess) {
// There's nothing to check
} else if (result.needExit()) {
// TODO: Implement app termination functionality
// Example) exitProcess(0)
} else {
// Network error or other. try again.
}
} else { // isShow false
if (result.isSuccess) {
if (maintenanceInfo != null && maintenanceInfo.size > 0) {
// TODO: Show custom maintenance dialog.
} else {
// There's nothing to check
}
} else {
// Network error or other. try again.
}
}
}
})
API Reference: Java
import com.hive.AuthV4;
import com.hive.ResultAPI;
// Whether to use Hive SDK UI
boolean isShow = true;
AuthV4.checkMaintenance(isShow, (result, maintenanceInfo) -> {
if (isShow) {
if (result.isSuccess()) {
// There's nothing to check
} else if (result.needExit()) {
// TODO: Implement app termination functionality
// Example) System.exit(0);
} else {
// Network error or other. try again.
}
} else { // isShow false
if (result.isSuccess()) {
if (maintenanceInfo != null && maintenanceInfo.size() > 0) {
// TODO: Show custom maintenance dialog.
} else {
// There's nothing to check
}
} else {
// Network error or other. try again.
}
}
});
API Reference: Swift
import HIVEService
// Hive SDK UI를 사용할지 여부
let isShow = true
AuthV4Interface.checkMaintenance(isShow) { result, maintenances in
if isShow {
if result.isSuccess() {
// There's nothing to check
} else if result.needExit() {
// TODO: Implement app termination functionality
// Example) exit(0)
} else {
// Network error or other. try again.
}
} else { // isShow false
if result.isSuccess() {
if (maintenances.count > 0) {
// TODO: Show custom maintenance dialog.
} else {
// There's nothing to check
}
} else {
// Network error or other. try again.
}
}
}
API Reference: Objective-C
#import <HIVEService/HIVEService-Swift.h>
// Whether to use Hive SDK UI
BOOL isShow = YES;
[HIVEAuthV4 checkMaintenance:isShow handler: ^(HIVEResultAPI *result, NSArray<HIVEAuthV4MaintenanceInfo *> *maintenanceInfolist) {
if (isShow) {
if (result.isSuccess) {
// There's nothing to check
} else if (result.needExit) {
// TODO: Implement app termination functionality
// Example) exit(0);
} else {
// Network error or other. try again.
}
} else { // isShow false
if (result.isSuccess) {
if (maintenanceInfolist.count > 0) {
// TODO: Show custom maintenance dialog.
} else {
// There's nothing to check
}
} else {
// Network error or other. try again.
}
}
}];
#include "HiveAuthV4.h"
// Hive SDK UI usage
bool bIsShow = true;
FHiveAuthV4::CheckMaintenance(bIsShow, FHiveAuthV4OnMaintenanceInfoDelegate::CreateLambda([this](const FHiveResultAPI& Result, const TArray<FHiveAuthV4MaintenanceInfo>& AuthV4MaintenanceInfoArray) {
if (bIsShow) {
if (Result.IsSuccess()) {
// There's nothing to check
} else if (Result.NeedExit()) {
// TODO: Implement app termination functionality
// Example) UKismetSystemLibrary::QuitGame(GetWorld(), nullptr, EQuitPreference::Quit, false);
} else {
// Network error or other. try again.
}
} else { // isShow false
if (Result.IsSuccess()) {
if (AuthV4MaintenanceInfoArray.Num() > 0) {
// TODO: Show custom maintenance dialog.
} else {
// There's nothing to check
}
} else {
// Network error or other. try again.
}
}
}));
The server maintenance popup UI can use the default UI of the Hive SDK or a customized UI, and if isShow
is true
, the default UI is used. If using a customized UI, isShow
must be false
.
Configuration.setserverid¶
Before displaying the server maintenance popup, the developer must select which server to check. The Hive console allows you to register server maintenance popups differently for each app server, and you can display different server maintenance popups for each server.
If you have registered different maintenance pop-ups for each server in the console, the SDK will select the server to be checked by calling Configuration.setServerId
with the server ID value to be checked. You only need to call this method before calling AuthV4.checkMaintenance
.
If the app user selects a server after accessing the app, call Configuration.setServerId
with the server ID value selected by the user.
Implementation of actions based on popup button settings¶
In the Hive console, you can select buttons to display in the server maintenance popup, such as closing the popup, exiting the game, or navigating to a URL. The actions that need to be implemented when the user presses a button depend on whether you are using the default UI of the Hive SDK or a custom UI. For more details, please refer to the Server Maintenance Popup UI.
Popup ui: basic ui¶
The server maintenance popup can use the default UI provided by the Hive SDK or a customized UI. When using a customized UI, the Hive SDK provides the necessary information for creating a custom UI to the app client. The app client must implement the code to draw and expose the UI using this information.
The basic UI is the server maintenance popup UI provided by the Hive SDK by default. To expose the basic UI, call AuthV4.checkMaintenance
with isShow
set to true
as shown below.
Info
It is recommended to separately register pop-ups for regular server maintenance or emergency server maintenance in the Hive console and use them.
- Regular Maintenance
- Set the maintenance time zone in the Hive console
- Call
AuthV4.checkMaintenance
from the app client - Display the popup only during the specified time zone based on the call result
- Emergency Maintenance
- Set the time to "current time" in the Hive console
- Block all users from accessing the app server
- Call
AuthV4.checkMaintenance
from the app client - Display the popup according to the current time when users reconnect to the app based on the call result
API Reference: Unity®
using hive;
// Whether to use Hive SDK UI
Boolean isShow = true;
AuthV4.checkMaintenance(isShow, (ResultAPI result, List maintenanceInfoList) => {
if (result.isSuccess()) {
// There's nothing to check
} else if (result.needExit()) {
// TODO: Implement app termination functionality
// Example) Application.Quit();
} else {
// Network error or other. try again.
}
});
API Reference: C++
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;
// Whether to use Hive SDK UI
bool isShow = true;
AuthV4::checkMaintenance(isShow, [=](ResultAPI const & result, vector const & maintenanceInfolist){
if (result.isSuccess()) {
// There's nothing to check
} else if (reuslt.needExit()) {
// TODO: Implement app termination functionality
// Cocos2d-x engine user
// Example) exit(0);
// Unreal Engine User
// Example) UKismetSystemLibrary::QuitGame(GetWorld(), nullptr, EQuitPreference::Quit, false);
} else {
// Network error or other. try again.
}
});
API Reference: Kotlin
import com.hive.AuthV4;
import com.hive.AuthV4;
import com.hive.ResultAPI;
// Whether to use Hive SDK UI
val isShow = true
AuthV4.checkMaintenance(isShow, object : AuthV4.AuthV4MaintenanceListener {
override fun onAuthV4Maintenance(result: ResultAPI, maintenanceInfo: ArrayList<AuthV4.AuthV4MaintenanceInfo>?) {
if (result.isSuccess) {
// There's nothing to check
} else if (result.needExit()) {
// TODO: Implement app termination functionality
// Example) exitProcess(0)
} else {
// Network error or other. try again.
}
}
})
API Reference: Java
import com.hive.AuthV4;
import com.hive.ResultAPI;
// Whether to use Hive SDK UI
boolean isShow = true;
AuthV4.checkMaintenance(isShow, (result, maintenanceInfo) -> {
if (result.isSuccess()) {
// There's nothing to check
} else if (result.needExit()) {
// TODO: Implement app termination functionality
// Example) System.exit(0);
} else {
// Network error or other. try again.
}
});
API Reference: Swift
import HIVEService
// Whether to use Hive SDK UI
let isShow = true
AuthV4Interface.checkMaintenance(isShow) { result, maintenances in
if result.isSuccess() {
// There's nothing to check
} else if result.needExit() {
// TODO: Implement app termination functionality
// Example) exit(0)
} else {
// Network error or other. try again.
}
}
API Reference: Objective-C
#import <HIVEService/HIVEService-Swift.h>
// Whether to use Hive SDK UI
BOOL isShow = YES;
[HIVEAuthV4 checkMaintenance:isShow handler: ^(HIVEResultAPI *result, NSArray<HIVEAuthV4MaintenanceInfo *> *maintenanceInfolist) {
if (result.isSuccess) {
// There's nothing to check
} else if (result.needExit) {
// TODO: Implement app termination functionality
// Example) exit(0);
} else {
// Network error or other. try again.
}
}];
#include "HiveAuthV4.h"
// Whether to use Hive SDK UI
bool bIsShow = true;
FHiveAuthV4::CheckMaintenance(bIsShow, FHiveAuthV4OnMaintenanceInfoDelegate::CreateLambda([this](const FHiveResultAPI& Result, const TArray<FHiveAuthV4MaintenanceInfo>& AuthV4MaintenanceInfoArray) {
if (Result.IsSuccess()) {
// There's nothing to check
} else if (Result.NeedExit()) {
// TODO: Implement app termination functionality
// Example) UKismetSystemLibrary::QuitGame(GetWorld(), nullptr, EQuitPreference::Quit, false);
} else {
// Network error or other. try again.
}
}));
Implementing app exit when using the game exit button¶
If you use the Game Exit button in the Hive console, the Hive SDK will send an event (NeedExit
) to ResultAPI result
indicating that the app should exit.
The app client must implement and execute the code to terminate the app after receiving this event, and this part is the same for both the Hive SDK default UI and custom UI.
Implementing URL navigation when using the detail view (go to url) button¶
If you set the base URL in the Hive console and enabled navigate to URL, pressing the view details button will automatically open an external browser and redirect the app user to the address set in the base URL by the Hive SDK.
Implementing popup closure when using the close button¶
When using the close popup button in the Hive console, pressing the close button will automatically close the popup window by the Hive SDK.
User behavior return¶
In the basic UI, you can know which button the user pressed in the popup window through the ResultAPI
object. When the user presses a button, you get the ResultAPI
object, which is the callback result of AuthV4.checkMaintenance
, and you can know the action taken by the user from this object.
Popup ui: custom ui¶
The custom UI is a server maintenance popup UI implemented directly by the app developer. When isShow=false
is called with AuthV4.checkMaintenance
, the app client receives the necessary information to implement the popup UI in the form of the AuthV4MaintenanceInfo
object. The developer must use this object to implement and display the custom UI directly. If this value is returned as null
, it means there is no content to display in the popup.
Below is an example of when isShow
is false
.
API Reference: Unity®
using hive;
// Whether to use Hive SDK UI
Boolean isShow = false;
AuthV4.checkMaintenance(isShow, (ResultAPI result, List maintenanceInfoList) => {
if (result.isSuccess()) {
if (maintenanceInfoList.Any()) {
// TODO: Show custom maintenance dialog.
} else {
// There's nothing to check
}
} else {
// Network error or other. try again.
}
});
API Reference: C++
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;
// Whether to use Hive SDK UI
bool isShow = flase;
AuthV4::checkMaintenance(isShow, [=](ResultAPI const & result, vector const & maintenanceInfolist){
if (result.isSuccess()) {
if (maintenanceInfolist.size() > 0) {
// TODO: Show custom maintenance dialog.
} else {
// There's nothing to check
}
} else {
// Network error or other. try again.
}
});
API Reference: Kotlin
import com.hive.AuthV4;
import com.hive.AuthV4;
import com.hive.ResultAPI;
// Whether to use Hive SDK UI
val isShow = false
AuthV4.checkMaintenance(isShow, object : AuthV4.AuthV4MaintenanceListener {
override fun onAuthV4Maintenance(result: ResultAPI, maintenanceInfo: ArrayList<AuthV4.AuthV4MaintenanceInfo>?) {
if (result.isSuccess) {
if (maintenanceInfo != null && maintenanceInfo.size > 0) {
// TODO: Show custom maintenance dialog.
} else {
// There's nothing to check
}
} else {
// Network error or other. try again.
}
}
})
API Reference: Java
import com.hive.AuthV4;
import com.hive.ResultAPI;
// Whether to use Hive SDK UI
boolean isShow = false;
AuthV4.checkMaintenance(isShow, (result, maintenanceInfo) -> {
if (result.isSuccess()) {
if (maintenanceInfo != null && maintenanceInfo.size() > 0) {
// TODO: Show custom maintenance dialog.
} else {
// There's nothing to check
}
} else {
// Network error or other. try again.
}
});
API Reference: Swift
import HIVEService
// Whether to use Hive SDK UI
let isShow = false
AuthV4Interface.checkMaintenance(isShow) { result, maintenances in
if result.isSuccess() {
if (maintenances.count > 0) {
// TODO: Show custom maintenance dialog.
} else {
// There's nothing to check
}
} else {
// Network error or other. try again.
}
}
API Reference: Objective-C
#import <HIVEService/HIVEService-Swift.h>
// Whether to use Hive SDK UI
BOOL isShow = YES;
[HIVEAuthV4 checkMaintenance:isShow handler: ^(HIVEResultAPI *result, NSArray<HIVEAuthV4MaintenanceInfo *> *maintenanceInfolist) {
if (result.isSuccess) {
if (maintenanceInfolist.count > 0) {
// TODO: Show custom maintenance dialog.
} else {
// There's nothing to check
}
} else {
// Network error or other. try again.
}
}];
#include "HiveAuthV4.h"
// Hive SDK UI usage status
bool bIsShow = true;
FHiveAuthV4::CheckMaintenance(bIsShow, FHiveAuthV4OnMaintenanceInfoDelegate::CreateLambda([this](const FHiveResultAPI& Result, const TArray<FHiveAuthV4MaintenanceInfo>& AuthV4MaintenanceInfoArray) {
if (Result.IsSuccess()) {
if (AuthV4MaintenanceInfoArray.Num() > 0) {
// TODO: Show custom maintenance dialog.
} else {
// There's nothing to check
}
} else {
// Network error or other. try again.
}
}));
Authv4maintenanceinfo object¶
Field Name | Description | Type |
---|---|---|
title | Popup title | String |
message | Popup content | String |
button | Label text of the popup button | String |
action | Indicates what action will be taken when the popup button is pressed OPEN_URL: Executes the URL passed to the external browser EXIT: Exits the app DONE: Closes the inspection popup without any processing | AuthV4MaintenanceActionType enum |
url | URL to be opened in the external browser. Valid when the action field value is OPEN_URL | String |
remainingTime | Remaining time in seconds until the inspection is complete. The time is updated in real-time, and the app will exit when it reaches 0 seconds | Integer |
startDate | Inspection start date | String |
endDate | Inspection end date | String |
customerButton | Customer service button text (an empty string is passed in the inspection popup) | String |
customerLink | Customer service button link (an empty string is passed in the inspection popup) | String |
exButtons | Popup button information (up to 3 can be passed) | JSONArray |
exButtons.action | Indicates what action will be taken when the popup button is pressed OPEN_URL: Executes the URL passed to the external browser EXIT: Exits the app DONE: Closes the inspection popup without any processing | AuthV4MaintenanceActionType enum |
exButtons.button | Label text of the popup button | String |
exButtons.url | URL to be opened in the external browser. Valid when the action field value is OPEN_URL | String |
The developer implements code in the app client to create and display a custom server maintenance popup using this object. By using this object, a custom server maintenance popup can be automatically displayed every time the server is checked.
Note
If the server maintenance time set in the Hive console is not correct, it will return null
with the AuthV4MaintenanceInfo
object.
Info
It is recommended to separately register pop-ups for regular server maintenance or emergency server maintenance in the Hive console and use them.
- Regular Maintenance
- Set the maintenance time zone in the Hive console
- Call
AuthV4.checkMaintenance
from the app client - Show the popup only during the specified time zone based on the call result
- Emergency Maintenance
- Set the time to "current time" in the Hive console
- Block all users from accessing the app server
- Call
AuthV4.checkMaintenance
from the app client - Show the popup when users reconnect to the app according to the current time based on the call result
Implementation of app exit when using the game exit button¶
If you use the End Game button in the Hive console, the Hive SDK will send an event (Exit
) to the ResultAPI result
indicating that the app should be terminated. The app client must implement and execute the code to terminate the app after receiving this event, and this part is the same for both the default UI and custom UI of the Hive SDK.
Implementing URL navigation when using the detailed view (go to url) button¶
If the default URL is set in the Hive console and Navigate to URL is activated, the developer must implement the action to redirect the user to the address set as the default URL when the View Details button is pressed. The information needed to implement this is in the AuthV4MaintenanceInfo
object.
For example, if you set the base URL, you will receive a value (OPEN_URL
) in the action
field of the AuthV4MaintenanceInfo
object that indicates the need to navigate to a specific URL. If the app client receives this value, it must implement code to redirect the app user to the URL in url
.
Implementing popup closure when using the close button¶
If using the close button in the Hive console, the developer must implement code that automatically closes the popup based on the information in the AuthV4MaintenanceInfo
object when the close button is pressed.
Exposure order¶
Notice pop-ups do not appear simultaneously. If you have registered all notice pop-ups (country restrictions, updates, general notices, server maintenance) in the console, the order in which the notice pop-ups are displayed is as follows.
- Country Restriction Popup
- Role: Notify users that access is blocked if they are connecting from a specific country
- Next Step: Encourage users to close the app
- Update Popup
- Role: Notify users to update if they are using an older version of the app (if not restricted by country)
- Next Step: Close the app and direct users to the app market to update to the latest version
- General Notice Popup
- Role: Display information about app updates and any notices if the app is not restricted by country and is the latest version
- Server Maintenance Popup
- Role: Notify users of server maintenance (if not restricted by country, the app is the latest version, and general notices have been provided)
- Next Step: Encourage users to close the app
Example 1: when a user accesses from a restricted country¶
If a user connects from a restricted country, only the country restriction popup will be displayed, and the game will exit. If the country restriction popup has not been registered in the console, the country restriction popup will not be displayed, and it will proceed to the update popup display step as shown in Example 2 below.
Example 2: when a user accesses from an allowed country¶
If the user has accessed from a country that is allowed, the country restriction popup will not be displayed. The popup that is displayed afterward will vary as shown below, depending on whether the app is the latest version or not.
If the app is an older version (if the app has not been updated)¶
Displays an update popup. The update popup encourages users to update the game to the latest version from the market after exiting the game.
If the app is the latest version (if the app has been updated)¶
Displays a general notice popup without showing the update popup. If the server is under maintenance, it will display the server maintenance popup.