Skip to main content
Version: SDK-5.11.4

WithdrawAccount

public BackendReturnObject WithdrawAccount();
public BackendReturnObject WithdrawAccount(int expirationHours);

Parameters

ValueTypeDescriptiondefault
expirationHoursintWithdrawal grace period0 (immediate withdrawal)

Description

The connected user's membership is withdrawn from the server.
Upon withdrawal, all the characters owned by the user are also deleted.
Additionally, the access token and the refresh token stored in the device are deleted, auto-login is disabled, and the account is logged out.

Immediate withdrawal

If the parameter value is not inserted or graceHours is set to 0, the user will be withdrawn immediately.
Not all information related to the user is deleted immediately after the call; the procedure takes place according to the following:

  1. Upon a successful call, the user is logged out forcefully. (bad accesstoken error occurs when requesting BACKND method afterward)

  2. Then, the following error is printed and login becomes unavailable when the login method is called.

    statusCode : 410
    errorCode : GoneResourceException
    message : Gone user, This user does not exist

  3. The data is not deleted immediately; all pieces of data are deleted at the start of the hour closest to the call time.
    (If 'Withdraw immediately' is requested at 10:15, login is restricted and the data is deleted at 11:00.)

  4. The user cannot cancel the request to withdraw after the request is made; the withdrawal will not proceed if the withdrawal status is changed to 'normal' in the console before deleting the data.

The user cannot immediately create an ID identical to the withdrawn ID; creating an identical ID will be available after the data is deleted.
Notify the user that it may take up to 1 hour for the withdrawal to be completed from the time of the request.

Reserved withdrawal

When you enter a value on expirationHours, a grace period that corresponds to that value in the unit of hours is granted.
A withdrawal request is canceled if the user logs in during the grace period after requesting the withdrawal.
If the grace period passes, the user can no longer log in, identical to 'Withdraw immediately,' and the data is deleted at the start of the nearest hour.

If a withdrawal request is called at 10:15 with expirationHours set to 2, the following procedure will take place:

1 When a BACKND method is called after the withdrawal request, bad accesstoken error occurs.

  1. When the user logs in before 12:15, the login succeeds and the withdrawal request is canceled.

  2. When the user logs in after 12:15, the following error is printed, and login is restricted.

    statusCode : 410
    errorCode : GoneResourceException
    message : Gone user, This user does not exist

  3. All data related to the user is deleted at 1:00, the starting hour closest to 12:15.

Example

Synchronous

//Withdraw immediately
Backend.MultiCharacter.Account.WithdrawAccount();

//Withdrawal reserved to be made 2 hours later
Backend.BMember.MultiCharacter.Account.WithdrawAccount(2);

Asynchronous

//Withdraw immediately
Backend.MultiCharacter.Account.WithdrawAccount(callback => {
// Post-process
});

//Withdrawal reserved to be made 2 hours later
Backend.MultiCharacter.Account.WithdrawAccount(2, callback => {
// Post-process
});

SendQueue

//Withdraw immediately
SendQueue.Enqueue(Backend.MultiCharacter.Account.WithdrawAccount, callback => {
// Post-process
});

//Withdrawal reserved to be made 2 hours later
SendQueue.Enqueue(Backend.MultiCharacter.Account.WithdrawAccount, 2, callback => {
// Post-process
});

ReturnCase

Success cases

When the membership withdrawal succeeds
statusCode : 204
message : Success