Skip to main content
Version: 5.16.0

Update Leaderboard with Goods

public BackendReturnObject UpdateMyGuildGoodsAndRefreshLeaderboard(string leaderboardUuid, goodsType goodsType, GoodsUse goodsUse, int value);\ public BackendReturnObject UpdateMyGuildGoodsAndRefreshLeaderboard(string leaderboardUuid, goodsType goodsType, GoodsUse goodsUse, long value);\ public BackendReturnObject UpdateMyGuildGoodsAndRefreshLeaderboard(string leaderboardUuid, goodsType goodsType, GoodsUse goodsUse, float value);\ public BackendReturnObject UpdateMyGuildGoodsAndRefreshLeaderboard(string leaderboardUuid, goodsType goodsType, GoodsUse goodsUse, double value);

Parameters

ValueTypeDescription
leaderboardUuidstringuuid of the leaderboard to update
goodsTypegoodsTypeType of guild goods to update
goodsUseGoodsUseChoice to contribute or spend goods (Give / Spend)
valueint / long / float / doubleValue to contribute (Must be 0 or higher)

Description

Contributes goods to the guild and updates the leaderboard at the same time.

현재 리더보드에 10000점이 반영되어 있는 상태에서 Backend.Social.Guild.ContributeGoodsV3 함수를 이용하여 1000점을 기부한 경우 리더보드에는 10000점, 길드 굿즈에는 11000점이 반영되게 됩니다.

여기서 다시 UpdateMyGuildGoodsAndRefreshLeaderboard 함수를 이용하여 1000점을 기부한 경우 리더보드에는 12000점, 길드 굿즈에도 12000점이 반영되게 됩니다.

Guild leaderboards do not support additional fields.

Example

Synchronous

// 굿즈1에 100만큼 굿즈 기부
Backend.Leaderboard.Guild.UpdateMyGuildGoodsAndRefreshLeaderboard("leaderboardUuid", goodsType.goods1, GoodsUse.Give, 100);

// 굿즈2에 10만큼 굿즈 소모
Backend.Leaderboard.Guild.UpdateMyGuildGoodsAndRefreshLeaderboard("leaderboardUuid", goodsType.goods1, GoodsUse.Spend, 10);

Asynchronous

Backend.Leaderboard.Guild.UpdateMyGuildGoodsAndRefreshLeaderboard("leaderboardUuid", goodsType.goods1, GoodsUse.Spend, 10, callback => {
// Post-process
});

ReturnCase

Success cases

When the update is successful\ statusCode : 204\ message : Success

Error cases

When uuid is null or string.Empty\ statusCode : 400\ errorCode : ValidationException\ message : leaderboardUuid is null or string.Empty

When the leaderboard attempted for update is not a goods leaderboard\ statusCode : 400\ errorCode : BadParameterException\ message : bad table, Invalid table

When the value is 0 or lower\ statusCode : 400\ errorCode : ValidationException\ message : value can't be negative

[Spend] When a user who is not the guild master calls GoodsUse.Spend\ statusCode : 403\ errorCode : ForbiddenException\ message : Forbidden useGoods, Forbidden use goods

리더보드를 생성할 때 선택하지 않은 굿즈로 갱신을 시도한 경우\ statusCode : 404\ errorCode : NotFoundException\ message : guild rank not found, guild rank을(를) 찾을 수 없습니다

[Spend] When there is an attempt to use goods more than the amount owned by the guild\ statusCode : 412\ errorCode : PreconditionFailed\ message : inadequateAmount prerequisites are not met.

When a user who has not joined a guild attempts to update the leaderboard\ statusCode : 412\ errorCode : PreconditionFailed\ message : notGuildMember prerequisites are not met.

When trying to update the leaderboard during initialization\ statusCode : 428\ errorCode : Precondition Required\ message : Precondition Required ranking is being counted

When there is an attempt to update an expired one-time leaderboard\ statusCode : 428\ errorCode : Precondition Required\ message : Precondition Required ranking is being counted