Public Load Data
Load game data that has been set as public.
URL Verification
This API uses the service-storage-api.playnanoo.com domain.
API Information
- URL:
https://service-storage-api.playnanoo.com/storage/v20211101/load/public - Method:
PUT - Authentication Required: Yes
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| storage_key | string | Required | Key of the data to load |
Response Data
| Field | Type | Description |
|---|---|---|
| StorageKey | string | Key of the saved data |
| StorageValue | string | Value of the saved data |
Code Example
void UMyGame::LoadPublicData(const FString& StorageKey)
{
// 플레이어 정보가 포함된 요청 바디 생성
TSharedPtr<FJsonObject> Body = FPlayNANOOHelper::CreateRequestBody();
Body->SetStringField(TEXT("storage_key"), StorageKey);
// JSON 문자열 변환
FString JsonBody = FPlayNANOOHelper::ToJsonString(Body);
// HTTP 요청
TSharedRef<IHttpRequest> Request = FHttpModule::Get().CreateRequest();
Request->SetURL(TEXT("https://service-storage-api.playnanoo.com/storage/v20211101/load/public"));
Request->SetVerb(TEXT("PUT"));
FPlayNANOOHelper::SetCommonHeaders(Request, true); // 인증 토큰 포함
Request->SetContentAsString(JsonBody);
Request->OnProcessRequestComplete().BindLambda(
[](FHttpRequestPtr Req, FHttpResponsePtr Res, bool bSuccess)
{
if (bSuccess && Res.IsValid())
{
TSharedPtr<FJsonObject> JsonObject;
TSharedRef<TJsonReader<>> Reader = TJsonReaderFactory<>::Create(Res->GetContentAsString());
if (FJsonSerializer::Deserialize(Reader, JsonObject))
{
FString Key = JsonObject->GetStringField(TEXT("StorageKey"));
FString Value = JsonObject->GetStringField(TEXT("StorageValue"));
UE_LOG(LogTemp, Log, TEXT("공용 데이터 조회 성공: %s = %s"), *Key, *Value);
}
}
});
Request->ProcessRequest();
}
Public Data Usage
This API is used to load public data accessible to all players, such as rankings, announcements, and event information.
isPrivate Setting
Only data saved with isPrivate set to "off" can be loaded with this API.