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
Value | Type | Description |
---|---|---|
leaderboardUuid | string | uuid of the leaderboard to update |
goodsType | goodsType | Type of guild goods to update |
goodsUse | GoodsUse | Choice to contribute or spend goods (Give / Spend) |
value | int / long / float / double | Value to contribute (Must be 0 or higher) |
Description
Contributes goods to the guild and updates the leaderboard at the same time.
- This method is an enhanced version of Backend.Social.Guild.ContributeGoodsV3 that includes a feature to update the leaderboard.
- Goods updated using either the ContributeGoodsV3 method or UseGuildGoods will not be applied to the leaderboard.
현재 리더보드에 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