05-21-2016, 10:40 AM
http://hkar.ru/IGru
сделал раунды но ошибка в том что выигрывает синяя комнада
http://hkar.ru/IGru
код фраг инфо:
сделал раунды но ошибка в том что выигрывает синяя комнада
http://hkar.ru/IGru
код фраг инфо:
Код:
if (room.getType() == 2)
{
if (room.getBlueKills() == room.redTeamCount)
{
TeamWin = 1;
}
else if (room.getRedKills() == room.blueTeamCount)
{
TeamWin = 0;
}
}
/* Уничтожение */
if (room.getType() == 4)
{
if (room.getBlueKills() == room.redTeamCount)
{
TeamWin = 1;
}
else if (room.getRedKills() == room.blueTeamCount)
{
TeamWin = 0;
}
}
}
for (Player member : room.getPlayers().values()) {
if (SlotState.SLOT_STATE_BATTLE == room.getRoomSlotByPlayer(member).getState()) {
member.getConnection().sendPacket(new SM_BATTLE_FRAG_INFO(room, fragInfos));
}
}
if (TeamWin >= 0)
{
//TeamWin = -1;
if (!(TeamWin == 1 && room.getBombState() == 1))
{
room.setRedKills(0);
room.setBlueKills(0);
if (TeamWin == 1)
{
room.setBlueWinRounds(room.getBlueWinRounds() + 1);
}
else
{
room.setRedWinRounds(room.getRedWinRounds() + 1);
}
if ((TeamWin == 0 ? room.getBlueWinRounds() : room.getRedWinRounds()) == room.getKillsByMask())
// if ((((((room.killtime == 2) && (room.getRedWinRounds() >= 3)) || ((room.killtime == 2) && (room.getBlueWinRounds() >= 3))) || (((room.killtime == 3) && (room.getRedWinRounds() >= 5)) || ((room.killtime == 3) && (room.getBlueWinRounds() >= 5)))) || ((((room.killtime == 4) && (room.getRedWinRounds() >= 7)) || ((room.killtime == 4) && (room.getBlueWinRounds() >= 7))) || ((room.killtime == 5) && (room.getRedWinRounds() >= 9)))) || ((room.killtime == 5) && (room.getBlueWinRounds() >= 9)))
{
for (Player member : getConnection().getRoom().getPlayers().values())
{
RoomSlot slot = room.getRoomSlotByPlayer(member);
member.getConnection().sendPacket(new SM_BATTLE_END(player, room));
slot.setKillMessage(0);
slot.setLastKillMessage(0);
slot.setOneTimeKills(0);
slot.setAllKills(0);
slot.setAllDeahts(0);
}
room.setRedKills(0);
room.setRedDeaths(0);
room.setBlueKills(0);
room.setBlueDeaths(0);
room.setFigth(false);
room.setBlueWinRounds(0);
room.setRedWinRounds(0);
room.setBombState(0);
}
else
{
for (Player member : getConnection().getRoom().getPlayers().values())
{
RoomSlot slot = room.getRoomSlotByPlayer(member);
slot.setKillMessage(0);
slot.setLastKillMessage(0);
slot.setOneTimeKills(0);
slot.lastKillState = 0;
room.setRedKills(0);
room.setRedDeaths(0);
room.setBlueKills(0);
room.setBlueDeaths(0);
room.setBombState(0);
member.getConnection().sendPacket(new SM_BATTLE_ROUND_END(TeamWin, 4, room));
}
try {
Thread.sleep(8000);
} catch (InterruptedException ex) {
Logger.getLogger(CM_BATTLE_FRAG_INFO.class.getName()).log(Level.SEVERE, null, ex);
}
for (Player member : getConnection().getRoom().getPlayers().values())
{
member.getConnection().sendPacket(new SM_UNK_3865());
member.getConnection().sendPacket(new SM_BATTLE_ROUND_START(room));
}
}
// TeamWin = -1;
}
// TeamWin = -1;
}
}
//TeamWin = -1;
}
// }
// }