ContributeGoodsV4
public BackendReturnObject ContributeGoodsV4(goodsType type, int amount);
This method allows the contribution of goods only outside the period of 4-5 am daily to prevent ranking settlement errors.
If rankings using goods are not included, please use ContributeGoodsV3, which does not have such restrictions.
Parameters
Value | Type | Description |
---|---|---|
type | goodsType(enum) | Type of currency to contribute. goodsType.goodsN(N: 1 - 10) |
amount | int | Amount of contribution. Only positive numbers are allowed. |
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.
Making changes between 4 - 5 am is unavailable, and requesting a change will return a 428 error.
It is used in the same way as ContributeGoodsV3.
When the ContributeGoodsV3 method is called while updating rankings using goods information, the ranking settlement process may fail with a low probability. Therefore, it is recommended to migrate to the ContrivuteGoodsV4 method to restrict updates during settlement time.
Example
Synchronous
Backend.Guild.ContributeGoodsV4(goodsType.goods1, 20);
Asynchronous
Backend.Guild.ContributeGoodsV4(goodsType.goods1, 10, (callback) =>
{
// Post-process
});
SendQueue
SendQueue.Enqueue(Backend.Guild.ContributeGoodsV4, goodsType.goods1, 10, (callback) =>
{
// Post-process
});
Return cases
Success cases
When the contribution is successful
statusCode : 204
Error cases
When the contributed goodsType exceeds the goodsCount
statusCode : 400
errorCode : BadParameterException
When the amount is a negative number
statusCode : 412
errorCode : PreconditionFailed
When called between 4 - 5 am
statusCode : 428
errorCode : Precondition Required