com.tera.lapi.network.packet.server.S_ACCOUNT_AUTH_STATUS.java Source code

Java tutorial

Introduction

Here is the source code for com.tera.lapi.network.packet.server.S_ACCOUNT_AUTH_STATUS.java

Source

/**
 * This file is part of tera-api.
 *
 * tera-api is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
    
 * tera-api is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
    
 * You should have received a copy of the GNU General Public License
 * along with tera-api.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.tera.lapi.network.packet.server;

import org.apache.commons.lang.StringUtils;

import com.tera.common.network.packet.NetworkPacket;

/**
 * @author ATracer
 */
public class S_ACCOUNT_AUTH_STATUS extends NetworkPacket {

    private final int channelId;

    private final int accountId;

    private final boolean success;

    private final String accountName;

    private final int accessLevel;

    private final int membership;

    /**
     * <p>
     * This constructor should be used for sending successful authentication
     * status
     * </p>
     * 
     * @param channelId
     * @param accountId
     * @param accountName
     * @param accessLevel
     * @param membership
     */
    public S_ACCOUNT_AUTH_STATUS(int channelId, int accountId, String accountName, int accessLevel,
            int membership) {
        this.channelId = channelId;
        this.accountId = accountId;
        this.accountName = accountName;
        this.accessLevel = accessLevel;
        this.membership = membership;
        this.success = true;
    }

    /**
     * <p>
     * This constructor should be used for sending unsuccessful authentication
     * status
     * </p>
     * 
     * @param channelId
     * @param accountId
     */
    public S_ACCOUNT_AUTH_STATUS(int channelId, int accountId) {
        this.channelId = channelId;
        this.accountId = accountId;
        this.accountName = StringUtils.EMPTY;
        this.accessLevel = 0;
        this.membership = 0;
        this.success = false;
    }

    /**
     * @return the channelId
     */
    public int getChannelId() {
        return channelId;
    }

    /**
     * @return the accountId
     */
    public int getAccountId() {
        return accountId;
    }

    /**
     * @return the success
     */
    public boolean isSuccess() {
        return success;
    }

    /**
     * @return the accountName
     */
    public String getAccountName() {
        return accountName;
    }

    /**
     * @return the accessLevel
     */
    public int getAccessLevel() {
        return accessLevel;
    }

    /**
     * @return the membership
     */
    public int getMembership() {
        return membership;
    }

}