Skip to main content
Version: SDK-5.11.6

WithdrawAccount

public BackendReturnObject WithdrawAccount();
public BackendReturnObject WithdrawAccount(int graceHours);

Parameter

ValueTypeDescriptiondefault
graceHoursintWithdrawal grace period0(Withdraw immediately)

Description

The user's membership is withdrawn from the server.
The differences from the existing SignOut method are as follows:

Comparison with existing SignOut method

SignOutWithdrawAccount
Grace period7 days(fixed)Can be set by the hour
Withdrawal cancellationWithdrawal canceled upon loginIf set to 'Withdraw immediately,' the withdrawal can only be canceled via the console before the next hour starts.
410 error occurs when attempting to log in.
During the grace period, the withdrawal is canceled upon login.
Deleted dataPush messages, guild, friends, ranking, nickname, federation, country codeData of SignOut() and all the user's game information management data

Upon withdrawal, the following information is deleted automatically.

  • Device token used in push messages
  • Friends information(list of sent friends requests, list of received friend requests)
  • Ranking information
  • Nickname information
  • Federation & custom ID information
  • Country code information
  • Game information
  • Guild information
    - If the guild master withdraws, the corresponding guild will exist without a guild master.
    - If the withdrawn user was the guild's only member, the guild is deleted automatically.

Withdraw immediately

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 graceHours, 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 graceHours 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.BMember.WithdrawAccount();

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


//Withdrawal reserved to be made 7 days later(previous SignOut method)
Backend.BMember.WithdrawAccount(24 * 7);

Asynchronous

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

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

SendQueue

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

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

Return cases

Success cases

When the membership withdrawal is successful
statusCode : 204
message : Success