Leaderboard Update 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 | Select between contributing or uisng goods (Give / Spend) |
value | int / long / float / double | Value to contribute (must be 0 or above) |
Description
Contributes goods to the guild and updates the leaderboard at the same time.
This is a method where the leaderboard update method is added to the Backend.Social.Guild.ContributeGoodsV3 method.
ContributeGoodsV3 method or the information of goods updated with UseGuildGoods is not reflected in the leaderboard.
When 1,000 points are contributed using the Backend.Social.Guild.ContributeGoodsV3 method while 10,000 points are reflected in the current leaderboard, 10,000 points will be reflected in the leaderboard, and 11,000 points will be reflected in the guild goods.
If the user contributes 1,000 points again using the UpdateMyGuildGoodsAndRefreshLeaderboard method, 12,000 points will be reflected in the leaderboard and 12,000 points will also be reflected in the guild goods.
Guild leaderboard does not support additional fields.
Example
Synchronous
// Contribute goods equal to 100 to goods1
Backend.Leaderboard.Guild.UpdateMyGuildGoodsAndRefreshLeaderboard("leaderboardUuid", goodsType.goods1, GoodsUse.Give, 100);
// Spend goods equal to 10 on goods2
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 the uuid is null or string.Empty
statusCode : 400
errorCode : ValidationException
message : leaderboardUuid is null or string.Empty
When the leaderboard to be updated 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, Cannot use goods
When the user tries to update with goods not selected during leaderboard creation
statusCode : 404
errorCode : NotFoundException
message : guild rank not found, guild rank cannot be found.
[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 an attempt is made to update the leaderboard during reset time
statusCode : 428
errorCode : Precondition Required
message : Precondition Required ranking is being counted
When the user tries to renew an expired one-time leaderboard
statusCode : 428
errorCode : Precondition Required
message : Precondition Required ranking is being counted