Skip to main content
Version: 5.11.8

ContributeGoodsV4

public BackendReturnObject ContributeGoodsV4(goodsType type, int amount);

info

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

ValueTypeDescription
typegoodsType(enum)Type of currency to contribute. goodsType.goodsN(N: 1 - 10)
amountintAmount 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