테스트

aion-server 4.8

Gitteol
최고관리자 · 1 · 💬 0 클론/새로받기
 4.8 61f661d · 1 commits 새로받기(Pull)
game-server/src/com/aionemu/gameserver/model/team/legion/LegionEmblem.java
package com.aionemu.gameserver.model.team.legion;

import com.aionemu.gameserver.model.gameobjects.Persistable;

/**
 * @author Simple, cura, Neon
 */
public class LegionEmblem implements Persistable {

	private byte emblemId = 0;
	private byte color_a = 0;
	private byte color_r = 0;
	private byte color_g = 0;
	private byte color_b = 0;
	private LegionEmblemType emblemType = LegionEmblemType.DEFAULT;
	private PersistentState persistentState;

	private boolean isUploading = false;
	private int uploadSize = 0;
	private int uploadedSize = 0;
	private byte[] uploadData;

	private byte[] customEmblemData = {};

	public byte[] getCustomEmblemData() {
		return customEmblemData;
	}

	public void setCustomEmblemData(byte[] customEmblemData) {
		setPersistentState(PersistentState.UPDATE_REQUIRED);
		this.customEmblemData = customEmblemData;
		this.emblemType = LegionEmblemType.CUSTOM;
	}

	public LegionEmblem() {
		setPersistentState(PersistentState.NEW);
	}

	public void setEmblem(int emblemId, int color_a, int color_r, int color_g, int color_b, LegionEmblemType emblemType, byte[] emblem_data) {
		this.emblemId = (byte) emblemId;
		this.color_a = (byte) color_a;
		this.color_r = (byte) color_r;
		this.color_g = (byte) color_g;
		this.color_b = (byte) color_b;
		this.emblemType = emblemType;
		this.customEmblemData = emblem_data;
		if (this.emblemType == LegionEmblemType.CUSTOM && customEmblemData == null)
			this.emblemType = LegionEmblemType.DEFAULT;

		setPersistentState(PersistentState.UPDATE_REQUIRED);
	}

	public byte getEmblemId() {
		return emblemId;
	}

	/**
	 * @return The alpha value.
	 */
	public byte getColor_a() {
		return color_a;
	}

	public byte getColor_r() {
		return color_r;
	}

	public byte getColor_g() {
		return color_g;
	}

	public byte getColor_b() {
		return color_b;
	}

	public void setUploading(boolean isUploading) {
		this.isUploading = isUploading;
	}

	public boolean isUploading() {
		return isUploading;
	}

	public void setUploadSize(int emblemSize) {
		this.uploadSize = emblemSize;
	}

	public int getUploadSize() {
		return uploadSize;
	}

	public void addUploadData(byte[] data) {
		byte[] newData = new byte[uploadedSize];
		int i = 0;
		if (uploadData != null && uploadData.length > 0) {
			for (byte dataByte : uploadData) {
				newData[i] = dataByte;
				i++;
			}
		}
		for (byte dataByte : data) {
			newData[i] = dataByte;
			i++;
		}
		this.uploadData = newData;
	}

	public byte[] getUploadData() {
		return this.uploadData;
	}

	public void addUploadedSize(int uploadedSize) {
		this.uploadedSize += uploadedSize;
	}

	public int getUploadedSize() {
		return uploadedSize;
	}

	public void setEmblemType(LegionEmblemType emblemType) {
		this.emblemType = emblemType;
	}

	public LegionEmblemType getEmblemType() {
		return emblemType;
	}

	/**
	 * This method will clear out all upload data
	 */
	public void resetUploadSettings() {
		this.isUploading = false;
		this.uploadedSize = 0;
		this.uploadData = null;
	}

	@Override
	@SuppressWarnings("fallthrough")
	public void setPersistentState(PersistentState persistentState) {
		switch (persistentState) {
			case UPDATE_REQUIRED:
				if (this.persistentState == PersistentState.NEW)
					break;
			default:
				this.persistentState = persistentState;
		}
	}

	@Override
	public PersistentState getPersistentState() {
		return persistentState;
	}

}

📎 첨부파일

댓글 작성 권한이 없습니다.
🏆 포인트 랭킹 TOP 10
순위 닉네임 포인트
1 no_profile 타키야겐지쪽지보내기 자기소개 아이디로 검색 전체게시물 102,949
2 no_profile 동가리쪽지보내기 자기소개 아이디로 검색 전체게시물 63,733
3 no_profile 라프텔쪽지보내기 자기소개 아이디로 검색 전체게시물 51,771
4 no_profile 불멸의행복쪽지보내기 자기소개 아이디로 검색 전체게시물 36,923
5 서번트쪽지보내기 자기소개 아이디로 검색 전체게시물 35,011
6 no_profile 닥터스쪽지보내기 자기소개 아이디로 검색 전체게시물 29,470
7 no_profile 검은고양이쪽지보내기 자기소개 아이디로 검색 전체게시물 29,077
8 no_profile Revolution쪽지보내기 자기소개 아이디로 검색 전체게시물 28,199
9 no_profile 보거스쪽지보내기 자기소개 아이디로 검색 전체게시물 26,731
10 no_profile 호롤롤로쪽지보내기 자기소개 아이디로 검색 전체게시물 17,020
알림 0