Skip to main content
Version: SDK-6.0.0

UpdateMyGuildCurrency

public BackndReturnObject UpdateMyGuildCurrency(GoodsType goodsType, GoodsUse goodsUse, int goodsAmount, bool setBlockDuringLeaderboardUpdateTime); public BackndReturnObject UpdateMyGuildCurrency(GoodsType goodsType, GoodsUse goodsUse, long goodsAmount, bool setBlockDuringLeaderboardUpdateTime); public BackndReturnObject UpdateMyGuildCurrency(GoodsType goodsType, GoodsUse goodsUse, float goodsAmount, bool setBlockDuringLeaderboardUpdateTime); public BackndReturnObject UpdateMyGuildCurrency(GoodsType goodsType, GoodsUse goodsUse, double goodsAmount, bool setBlockDuringLeaderboardUpdateTime);

Parameters

ValueTypeDescription
goodsTypeGoodsType(enum)Type of currency to contribute. goodsType.goodsN(N: 1 - 10)
goodsUseGoodsUse(enum)If you want to donate merchandise, enter Give; if you want to use merchandise, enter Spend. Only Master or ViceMaster can Use.
goodsAmountint, long, float, doubleAmount of contribution. Only positive numbers are allowed.
setBlockDuringLeaderboardUpdateTimeboolWhen utilizing guild rankings using metadata, true

Description

Contributes currency to the currently joined guild.

In BACKND, 10 types of goods can be contributed, and a total amount of contributed goods can be set when creating a guild.
These types are named goods1, goods2, goods3 ⋯ goods10.

Example

Synchronous

Backnd.Guild.UpdateMyGuildCurrency(goodsType.goods1, GoodsUse.Give, 20, true);

Asynchronous

Backnd.Guild.UpdateMyGuildCurrency(goodsType.goods1, GoodsUse.Give, 20, true, (callback) => 
{
// Post-process
});

Return cases

Success cases

When the contribution is successful
statusCode : 204
message : Success

Error cases

When the contributed goodsType exceeds the goodsCount
statusCode : 400
errorCode : BadParameterException
message : bad goodsType, Invalid goodsType

When the amount is a negative number
statusCode : 412
errorCode : PreconditionFailed
message : type prerequisites are not met.

When a user who has not joined a guild calls the method
statusCode : 412
errorCode : PreconditionFailed
message : notGuildMember prerequisites are not met.