本文整理汇总了Java中tools.data.LittleEndianAccessor.readByte方法的典型用法代码示例。如果您正苦于以下问题:Java LittleEndianAccessor.readByte方法的具体用法?Java LittleEndianAccessor.readByte怎么用?Java LittleEndianAccessor.readByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tools.data.LittleEndianAccessor
的用法示例。
在下文中一共展示了LittleEndianAccessor.readByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Movement1
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
public Movement1(LittleEndianAccessor lea, byte command) {
super();
this.command = command;
short x = lea.readShort();
short y = lea.readShort();
position = new Point(x, y);
short xv = lea.readShort();
short yv = lea.readShort();
vposition = new Point(xv, yv);
fh = lea.readShort();
if (command == 15 || command == 17)
fhFootStart = lea.readShort();
short xoffset = lea.readShort();
short yoffset = lea.readShort();
offset = new Point(xoffset, yoffset);
bMoveAction = lea.readByte();
tElapse = lea.readShort();
bForcedStop = lea.readByte();
}
示例2: Movement2
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
public Movement2(LittleEndianAccessor lea, byte command) {
super();
this.command = command;
short x = lea.readShort();
short y = lea.readShort();
position = new Point(x, y);
short xv = lea.readShort();
short xy = lea.readShort();
vposition = new Point(xv, xy);
fh = lea.readShort();
bMoveAction = lea.readByte();
tElapse = lea.readShort();
bForcedStop = lea.readByte();
}
示例3: SkillEffect
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
public static void SkillEffect(LittleEndianAccessor slea, MapleCharacter chr) {
int skillId = slea.readInt();
if (skillId >= 91000000 && skillId < 100000000) {
chr.getClient().getSession().write(CWvsContext.enableActions());
return;
}
byte level = slea.readByte();
short direction = slea.readShort();
byte unk = slea.readByte();
Skill skill = SkillFactory.getSkill(GameConstants.getLinkedAttackSkill(skillId));
if ((chr == null) || (skill == null) || (chr.getMap() == null)) {
return;
}
int skilllevel_serv = chr.getTotalSkillLevel(skill);
if ((skilllevel_serv > 0) && (skilllevel_serv == level) && ((skillId == 33101005) || (skill.isChargeSkill()))) {
chr.setKeyDownSkill_Time(System.currentTimeMillis());
if (skillId == 33101005) {
chr.setLinkMid(slea.readInt(), 0);
}
chr.getMap().broadcastMessage(chr, CField.skillEffect(chr, skillId, level, direction, unk), false);
}
}
示例4: TouchFamiliar
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
public static final void TouchFamiliar(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
if (chr.getSummonedFamiliar() == null) {
return;
}
slea.skip(6);
byte unk = slea.readByte();
MapleMonster target = chr.getMap().getMonsterByOid(slea.readInt());
if (target == null) {
return;
}
int type = slea.readInt();
slea.skip(4);
int damage = slea.readInt();
int maxDamage = chr.getSummonedFamiliar().getOriginalStats().getPhysicalAttack() * 5;
if (damage < maxDamage) {
damage = maxDamage;
}
if ((!target.getStats().isFriendly())) {
chr.getMap().broadcastMessage(chr, CField.touchFamiliar(chr.getId(), unk, target.getObjectId(), type, 600, damage), chr.getTruePosition());
target.damage(chr, damage, true);
chr.getSummonedFamiliar().addFatigue(chr);
}
}
示例5: Movement6
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
public Movement6(LittleEndianAccessor lea, byte command) {
super();
this.command = command;
this.position = new Point(0, 0);
short xv = lea.readShort();
short xy = lea.readShort();
vposition = new Point(xv, xy);
// I'm not sure about this, it' needs testing.
fhFootStart = lea.readShort();
bMoveAction = lea.readByte();
tElapse = lea.readShort();
bForcedStop = lea.readByte();
}
示例6: Movement8
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
public Movement8(LittleEndianAccessor lea, byte command) {
super();
this.command = command;
this.position = new Point(0, 0);
this.bStat = lea.readByte();
}
示例7: ChangePetBuff
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
public static void ChangePetBuff(LittleEndianAccessor slea, MapleCharacter chr) {
slea.readInt(); // 0
int skill = slea.readInt();
slea.readByte(); // 0
if (skill <= 0) {
chr.getQuestRemove(MapleQuest.getInstance(GameConstants.BUFF_ITEM));
} else {
chr.getQuestNAdd(MapleQuest.getInstance(GameConstants.BUFF_ITEM)).setCustomData(String.valueOf(skill));
}
}
示例8: handle
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
@PacketHandler(opcode = RecvPacketOpcode.BATTLE_RECORD_CALC_REQUEST)
public static void handle(MapleClient c, LittleEndianAccessor lea){
boolean isActive = lea.readByte() != 0;
boolean idk = lea.readByte() != 0;
boolean idk2 = lea.readByte() != 0;
if(isActive) {
BattleRecordManager.serverCalcRequestResult(isActive);
}
}
示例9: absorbingDF
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
public static void absorbingDF(LittleEndianAccessor slea, final MapleClient c) {
int size = slea.readInt();
int room = 0;
byte unk = 0;
int sn;
for (int i = 0; i < size; i++) {
room = GameConstants.isDemonAvenger(c.getPlayer().getJob()) || c.getPlayer().getJob() == 212 ? 0
: slea.readInt();
unk = slea.readByte();
sn = slea.readInt();
if (GameConstants.isDemonSlayer(c.getPlayer().getJob())) {
// c.getPlayer().addMP(c.getPlayer().getStat().getForce(room));
}
if (GameConstants.isAngelicBuster(c.getPlayer().getJob())) {
boolean rand = Randomizer.isSuccess(80);
if (sn > 0) {
if (rand) {
c.getSession().write(JobPacket.AngelicPacket.SoulSeekerRegen(c.getPlayer(), sn));
}
}
}
if ((GameConstants.isDemonAvenger(c.getPlayer().getJob())) && slea.available() >= 8) {
// c.getPlayer().getMap().broadcastMessage(MainPacketCreator.ShieldChacingRe(c.getPlayer().getId(),
// slea.readInt(), slea.readInt(), unk,
// c.getPlayer().getKeyValue2("schacing")));
}
if (c.getPlayer().getJob() == 212) {
// c.getPlayer().getMap().broadcastMessage(MainPacketCreator.MegidoFlameRe(c.getPlayer().getId(),
// unk, slea.readInt()));
}
}
}
示例10: MerchantItemStore
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
public static final void MerchantItemStore(final LittleEndianAccessor slea, final MapleClient c) {
if (c.getPlayer() == null) {
return;
}
final byte operation = slea.readByte();
if (operation == 27 || operation == 28) { // Request, Take out
requestItems(c, operation == 27);
} else if (operation == 30) { // Exit
c.getPlayer().setConversation(0);
}
}
示例11: TouchReactor
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
public static void TouchReactor(final LittleEndianAccessor slea, final MapleClient c) {
final int oid = slea.readInt();
final boolean touched = slea.available() == 0 || slea.readByte() > 0; //the byte is probably the state to set it to
final MapleReactor reactor = c.getPlayer().getMap().getReactorByOid(oid);
if (!touched || reactor == null || !reactor.isAlive() || reactor.getTouch() == 0) {
return;
}
if (reactor.getTouch() == 2) {
ReactorScriptManager.getInstance().act(c, reactor); //not sure how touched boolean comes into play
} else if (reactor.getTouch() == 1 && !reactor.isTimerActive()) {
if (reactor.getReactorType() == 100) {
final int itemid = GameConstants.getCustomReactItem(reactor.getReactorId(), reactor.getReactItem().getLeft());
if (c.getPlayer().haveItem(itemid, reactor.getReactItem().getRight())) {
if (reactor.getArea().contains(c.getPlayer().getTruePosition())) {
MapleInventoryManipulator.removeById(c, GameConstants.getInventoryType(itemid), itemid, reactor.getReactItem().getRight(), true, false);
reactor.hitReactor(c);
} else {
c.getPlayer().dropMessage(5, "You are too far away.");
}
} else {
c.getPlayer().dropMessage(5, "You don't have the item required.");
}
} else {
//just hit it
reactor.hitReactor(c);
}
}
}
示例12: handle
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
@PacketHandler(opcode = RecvPacketOpcode.GENERAL_CHAT)
public static void handle(MapleClient c, LittleEndianAccessor slea){
if (c.getPlayer() == null || c.getPlayer().getMap() == null){
return;
}
slea.skip(4); // update tick
String text = slea.readMapleAsciiString();
byte balloon = slea.readByte();
if (CommandProcessor.processCommand(c, text, CommandType.NORMAL)){
return;
}
if (text.length() < 1 || (!c.getPlayer().isIntern() && text.length() >= 80)) {
return;
}
if (!c.getPlayer().getCanTalk()){
c.getSession().write(CWvsContext.broadcastMsg(6, "You have been muted and are therefore unable to talk."));
return;
}
if (!c.getPlayer().isHidden()){
c.getPlayer().getMap().broadcastMessage(CField.getChatText(c.getPlayer().getId(), text, false, balloon));
c.getPlayer().getMap().broadcastMessage(CField.getChatText(c.getPlayer().getId(), text, c.getPlayer().isSuperGM(), 1));
return;
}
// Note: This patch is needed to prevent chat packet from being broadcast to people who might be packet sniffing.
if (c.getPlayer().isIntern() && !c.getPlayer().isSuperGM() && balloon == 0) {
c.getPlayer().getMap().broadcastGMMessage(c.getPlayer(), CField.getChatText(c.getPlayer().getId(), text, c.getPlayer().isSuperGM(), (byte) 1), true);
c.getPlayer().getMap().broadcastGMMessage(c.getPlayer(), CWvsContext.broadcastMsg(2, c.getPlayer().getName() + " : " + text), true);
} else {
c.getPlayer().getMap().broadcastGMMessage(c.getPlayer(), CField.getChatText(c.getPlayer().getId(), text, c.getPlayer().isSuperGM(), balloon), true);
}
}
示例13: DeleteChar
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
public static void DeleteChar(final LittleEndianAccessor lea, final MapleClient c) {
String Secondpw_Client = lea.readMapleAsciiString();
if (Secondpw_Client == null) {
if (lea.readByte() > 0) { // Specific if user have second password or not
Secondpw_Client = lea.readMapleAsciiString();
}
lea.readMapleAsciiString();
}
final int Character_ID = lea.readInt();
if (!c.login_Auth(Character_ID) || !c.isLoggedIn() || loginFailCount(c)) {
c.getSession().close();
return; // Attempting to delete other character
}
byte state = 0;
if (c.getSecondPassword() != null) { // On the server, there's a second password
if (Secondpw_Client == null) { // Client's hacking
c.getSession().close();
return;
} else {
if (!c.CheckSecondPassword(Secondpw_Client)) { // Wrong Password
state = 20;
}
}
}
if (state == 0) {
state = (byte) c.deleteCharacter(Character_ID);
}
c.getSession().write(LoginPacket.deleteCharResponse(Character_ID, state));
}
示例14: DamageSummon
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
public static final void DamageSummon(final LittleEndianAccessor slea, final MapleCharacter chr) {
final int unkByte = slea.readByte();
final int damage = slea.readInt();
final int monsterIdFrom = slea.readInt();
// slea.readByte(); // stance
final Iterator<MapleSummon> iter = chr.getSummonsReadLock().iterator();
MapleSummon summon;
boolean remove = false;
try {
while (iter.hasNext()) {
summon = iter.next();
if (summon.isPuppet() && summon.getOwnerId() == chr.getId() && damage > 0) { //We can only have one puppet(AFAIK O.O) so this check is safe.
summon.addHP((short) -damage);
if (summon.getHP() <= 0) {
remove = true;
}
chr.getMap().broadcastMessage(chr, SummonPacket.damageSummon(chr.getId(), summon.getSkill(), damage, unkByte, monsterIdFrom), summon.getTruePosition());
break;
}
}
} finally {
chr.unlockSummonsReadLock();
}
if (remove) {
chr.cancelEffectFromBuffStat(CharacterTemporaryStat.PUPPET);
}
}
示例15: SpawnFamiliar
import tools.data.LittleEndianAccessor; //导入方法依赖的package包/类
public static final void SpawnFamiliar(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
slea.skip(4); // update tick
int mId = slea.readInt();
c.getSession().write(CWvsContext.enableActions());
c.getPlayer().removeFamiliar();
if ((c.getPlayer().getFamiliars().containsKey(Integer.valueOf(mId))) && (slea.readByte() > 0)) {
MonsterFamiliar mf = (MonsterFamiliar) c.getPlayer().getFamiliars().get(Integer.valueOf(mId));
if (mf.getFatigue() > 0) {
c.getPlayer().dropMessage(1, "Please wait " + mf.getFatigue() + " seconds to summon it.");
} else {
c.getPlayer().spawnFamiliar(mf, false);
}
}
}