Skip to main content

Edit Table

Modifies leaderboard table settings.

URL Confirmation

This API uses the service-api.playnanoo.com domain.

API Information

  • URL: https://service-api.playnanoo.com/leaderboard/v20240301/table/edit
  • Method: PUT
  • Authentication Required: Yes

Request Parameters

ParameterTypeRequiredDescription
uidstringRequiredTable code
record_typestringRequiredRecord type ("highscore", "lowscore", "sum", "last")
record_sort_typestringRequiredSort type ("asc", "desc")
record_prioritystringRequiredRecord priority ("Y" or "N")

Response Data

FieldTypeDescription
StatusstringProcessing status

Code Example

void UMyGame::EditLeaderboardTable(const FString& TableCode)
{
// 요청 데이터 생성
// 플레이어 정보가 포함된 요청 바디 생성
TSharedPtr<FJsonObject> Body = FPlayNANOOHelper::CreateRequestBody();
Body->SetStringField(TEXT("uid"), TableCode);
Body->SetStringField(TEXT("record_type"), TEXT("lowscore"));
Body->SetStringField(TEXT("record_sort_type"), TEXT("asc"));
Body->SetStringField(TEXT("record_priority"), TEXT("Y"));

// JSON 문자열 변환
FString JsonBody = FPlayNANOOHelper::ToJsonString(Body);

// HTTP 요청
TSharedRef<IHttpRequest> Request = FHttpModule::Get().CreateRequest();
Request->SetURL(TEXT("https://service-api.playnanoo.com/leaderboard/v20240301/table/edit"));
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 Status = JsonObject->GetStringField(TEXT("Status"));
UE_LOG(LogTemp, Log, TEXT("테이블 수정 성공: %s"), *Status);
}
}
});

Request->ProcessRequest();
}
Record Types
  • highscore: Keep only the highest score
  • lowscore: Keep only the lowest score (suitable for racing games, etc.)
  • sum: Sum all scores
  • last: Update with the most recent score
Sort Types
  • desc: Descending order (higher scores rank higher)
  • asc: Ascending order (lower scores rank higher)
Table Modification Precautions

Changing table settings may alter the existing ranking calculation method. This can affect scores already recorded by players, so make changes carefully.