Skip to main content
Version: 5.11.8

UseGoodsV4

public BackendReturnObject UseGoodsV4(goodsType type, int amount);

Note

This method allows the use 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 to be used. Only negative numbers are allowed.

Description

Uses the currency of the guild's goodsType.

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 UseGoodsV3.

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.UseGoodsV4(goodsType.goods1, -20);

Asynchronous

Backend.Guild.UseGoodsV4(goodsType.goods1, -10, (callback) => 
{
// Post-process
});

SendQueue

SendQueue.Enqueue(Backend.Guild.UseGoodsV4, goodsType.goods1, -10, (callback) => 
{
// Post-process
});

Return cases

Success cases

When used
statusCode : 204

Error cases

When a guild member who is not the master attempts to use
statusCode : 403
errorCode : ForbiddenException

When the amount is a positive number
statusCode : 412
errorCode : PreconditionFailed

When the used amount is larger than the owned amount
statusCode : 412
errorCode : PreconditionFailed

When a person not in the guild attempts to use
statusCode : 412
errorCode : PreconditionFailed

When called between 4 - 5 am
statusCode : 428
errorCode : Precondition Required