Сообщений: 120
Тем: 33
Зарегистрирован: Nov 2014
Репутация:
5
[Point Blank] BATTLE_END Error Player SLOT
i have error BATTLE END FINAL SLOT Player end someone know what locate for fix this BUG ?
when finish battle SLOT bug player
see image
SLOT BATTLE FINAL ERROR Someone can help me fix this error?
Сообщений: 6,449
Тем: 262
Зарегистрирован: Nov 2007
Репутация:
44,165
Show me the source code of PROTOCOL_BATTLE_ENDBATTLE_ACK packet.
Сообщений: 120
Тем: 33
Зарегистрирован: Nov 2014
Репутация:
5
Код: ublic class SM_BATTLE_END extends ServerPacket {
protected final Logger log = LoggerFactory.getLogger(getClass());
private final Player player;
private final Room room;
public SM_BATTLE_END(Player player, Room room) {
super(0xD08);
this.player = player;
this.room = room;
}
@Override
public void writeImpl() {
//TODO переделать
LevelUpInfo levelUpInfo = LevelUpDaoService.getInstance().getLevelInfoForRank((byte) (player.getRank() + 1));
RoomSlot slotByPlayer = room.getRoomSlotByPlayer(player);
player.setExp(player.getExp() + slotByPlayer.getAllExp());
player.setGp(player.getGp() + slotByPlayer.getAllGp());
if (player.getRank() <= 52) {
if (levelUpInfo.getAllExp() < player.getExp()) {
player.setRank((short) (player.getRank() + 1));
player.setGp(player.getGp() + levelUpInfo.getRewardGp());
}
}
if (room.getBlueKills() > room.getRedKills())
{
}
else if (room.getBlueKills() < room.getRedKills())
{
writeH(383); // что �то???
writeH(266); // что �то???
// Опыт
for (int i = 0; i < 16; i++) {
RoomSlot slot = room.getRoomSlot(i);
writeH(slot.getAllExp());
}
// Очки
for (int i = 0; i < 16; i++) {
RoomSlot slot = room.getRoomSlot(i);
writeH(slot.getAllGp());
}
//Очки за ботов
for (int i = 0; i < 16; i++) {
if (room.getSpecial() == 6) {
RoomSlot slot = room.getRoomSlot(i);
int score = slot.getBotScore();
writeH(score);
} else writeH(0);
}
writeB(new byte[]{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//
0x00, 0x00,//
// и тут ХЗ
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//
0x00, 0x00, 0x00, 0x00
//
});
writeS(player.getName(), Player.MAX_NAME_SIZE); // Им� пер�а
writeD(player.getExp()); // опыт
writeD(player.getRank()); // ранк (0-54)
writeD(player.getRank()); // Пока не пон�тно за чего отвечают пу�тые байты...
writeD(player.getGp()); // ГП
writeD(con.getAccount().getMoney()); // Ð-ублики
writeD(0); // ClanID
writeD(0); // ClanNameColor
writeD(0); // Unk
writeD(0); // Unk
writeH(player.getPcCafe());
writeC(player.getColor()); // 0-9 Color name
if (player.getClan() == null) {
writeS("", 16);
writeC(0);
writeH(0);
writeC(255);
writeC(255);
writeC(255);
writeC(255);
writeH(0);
} else {
writeS(player.getClan().getName(), 16);
writeC(0); // unk - Видимо разделитель
writeH(player.getClan().getRank());
writeC(player.getClan().getLogo1());
writeC(player.getClan().getLogo2());
writeC(player.getClan().getLogo3());
writeC(player.getClan().getLogo4());
writeH(player.getClan().getColor());
}
writeD(0);
writeD(0);
writeD(0);
writeD(player.getStats().getFights());
writeD(player.getStats().getWins());
writeD(player.getStats().getLosts());
writeD(0); // unk
writeD(player.getStats().getKills());
writeD(player.getStats().getHeadSort());
writeD(player.getStats().getDeaths());
writeD(0); // unk
writeD(player.getStats().getKills());
writeD(player.getStats().getEscapes());
writeD(player.getStats().getFights());
writeD(player.getStats().getWins());
writeD(player.getStats().getLosts());
writeD(0); // unk
writeD(player.getStats().getKills());
writeD(player.getStats().getHeadSort());
writeD(player.getStats().getDeaths());
writeD(0); // unk
writeD(player.getStats().getKills());
writeD(player.getStats().getEscapes());
writeB(new byte[53]);
}
}
Сообщений: 6,449
Тем: 262
Зарегистрирован: Nov 2007
Репутация:
44,165
Instead of writeH(383) there must be:
[SRC="csharp"]WriteH(room.PlayersSlotsMask); // |= 1 << slot.Id
[/SRC]
Сообщений: 120
Тем: 33
Зарегистрирован: Nov 2014
Репутация:
5
Сообщений: 6,449
Тем: 262
Зарегистрирован: Nov 2007
Репутация:
44,165
You'r welcome.
|