コンテンツにスキップ

起動パラメーターを返す

概要

実行パラメータの取得は、ゲームクライアントからゲーム実行URIに追加された実行パラメータ値を取得するHive SDKの機能です。アプリがcrossplay launcherで起動されたときにゲームに渡された実行パラメータを確認できます。

クエリメソッド

元の文字列形式で渡された実行パラメータの値を受け取ります。

例のコード

例のコードは次のとおりです。

using hive;

PlatformHelper.getLaunchParameters((ResultAPI result, String parameters) => 
{
    if (result.success)
    {
        // API 呼び出し成功
        // parameters: 返されたパラメータ値
    }
});
#include "HivePlatformHelper.h"

FHivePlatformHelper::GetLaunchParameters(FHivePlatformHelperOnGetLaunchParametersDelegate::CreateLambda([this](const FHiveResultAPI& Result, const FString& Parameters) {
    if (Result.IsSuccess()) {
        // API call succeeded
        // Parameters: returned parameter value
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;

PlatformHelper::getLaunchParameters([=](ResultAPI const & result, string parameters) {
    if (result.isSuccess()) {
        // API呼び出しが成功しました
        // parameters: 戻り値のパラメータ
    }
});

概要

launch parameter クエリは、Hive SDK の機能で、ゲームクライアントがゲーム起動 URI に追加された起動パラメータの値を取得できるようにします。アプリが Crossplay Launcher を介して起動されたときに、ゲームに渡された起動パラメータを確認できます。

戻り値の方法

起動パラメータの値は、元の文字列形式で受信されます。

例のコード

例のコードは以下の通りです。

using hive;

PlatformHelper.getLaunchParameters((ResultAPI result, String parameters) => 
{
    if (result.success)
    {
        // API呼び出し成功
        // parameters: 返されたパラメータ値
    }
});
#include "HivePlatformHelper.h"

FHivePlatformHelper::getLaunchParameters(FHivePlatformHelperOnGetLaunchParametersDelegate::CreateLambda([this](const FHiveResultAPI& Result, const FString& Parameters) {
    if (Result.IsSuccess()) {
        // API call succeeded
        // Parameters: returned parameter value
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;

PlatformHelper::getLaunchParameters([=](ResultAPI const & result, string parameters) {
    if (result.isSuccess()) {
        // API呼び出しが成功しました
        // parameters: 戻り値のパラメータ
    }
});