Package networking.response

Source Code of networking.response.ResponseUpdateTime

package networking.response;

import metadata.Constants;
import utility.GamePacket;

/**
*
* @author Xuyuan
*/
public class ResponseUpdateTime extends GameResponse {

    private int current;
    private int duration;
    private int month;
    private int year;
    private float rate;

    public ResponseUpdateTime() {
        responseCode = Constants.SMSG_UPDATE_TIME;
    }

    @Override
    public byte[] constructResponseInBytes() {
        GamePacket packet = new GamePacket(responseCode);
        packet.addShort16((short) month);
        packet.addShort16((short) year);
        packet.addInt32(duration);
        packet.addInt32(current);
        packet.addFloat(rate);
        return packet.getBytes();
    }

    public void setCurrent(int current) {
        this.current = current;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public void setRate(float rate) {
        this.rate = rate;
    }
}
TOP

Related Classes of networking.response.ResponseUpdateTime

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.