Рейтинг темы:
  • 0 Голос(ов) - 0 в среднем
  • 1
  • 2
  • 3
  • 4
  • 5
CM_READY help camera mod
#1
hello Programmator hrlp masomeone know how i can fix this camera
exemple when two people PVP 1X1 i go start PVP
he don't wait in this camera
[SRC="java"]package ru.pb.game.network.client.packets.client;

import ru.pb.game.network.client.packets.ClientPacket;
import ru.pb.game.network.client.packets.server.SM_BATTLE_READY;
import ru.pb.game.network.client.packets.server.SM_BATTLE_READY2;
import ru.pb.game.network.client.packets.server.SM_ROOM_INFO;
import ru.pb.game.network.client.packets.server.SM_ROOM_READY_ERROR;
import ru.pb.global.enums.SlotState;
import ru.pb.global.models.Player;
import ru.pb.global.models.Room;
import ru.pb.global.models.RoomSlot;
import ru.pb.global.utils.concurrent.ThreadPoolManager;


public class CM_BATTLE_READY extends ClientPacket {

public CM_BATTLE_READY(int opcode) {
super(opcode);
}

@Override
public void readImpl() {
}

@Override
public void runImpl() {
final Room room = getConnection().getRoom();
if (room.getLeader().equals(getConnection().getPlayer())) {
int num = 0;
for(Player p : room.getPlayers().values()){
if(room.getRoomSlotByPlayer(p).getState() == SlotState.SLOT_STATE_READY && room.getRoomSlotByPlayer(p).getId() % 2 != room.getRoomSlotByPlayer(room.getLeader()).getId() % 2)
num++;
}
if(num > 0 || room.getSpecial() == 6 || room.getSpecial() == 9){
room.setFigth(true);
room.setTimeLost(room.getKillTime() * 60);
room.readySlots1.clear();
room.readySlots2.clear();
room.preStart = false;
room.Started = false;
room.prestartedCount = 0;
room.trex = -1;
room.rounds = 0;
if(room.getType() == 12)
room.rounds = 1;
room.bar1 = 0;
room.bar2 = 0;
room.swapCorrect = true;
room.RoundRespawning = false;
room.setRedWinRounds(0);
room.setBlueWinRounds(0);
room.getRoomSlotByPlayer(room.getLeader()).setState(SlotState.SLOT_STATE_READY);
ThreadPoolManager.getInstance().executeTask(new Runnable() {
@Override
public void run() {
for (Player member : getConnection().getRoom().getPlayers().values()) {
RoomSlot slot = room.getRoomSlotByPlayer(member);
slot.bar1 = 0;
slot.bar2 = 0;
slot.util = 0;
if (slot.getState() == SlotState.SLOT_STATE_READY) {
slot.setState(SlotState.SLOT_STATE_LOAD);
room.readySlots1.put(slot.getId(), slot.getPlayer());
member.getConnection().sendPacket(new SM_BATTLE_READY(room, member));
}
}
}
});
}else{
sendPacket(new SM_ROOM_READY_ERROR(0x80001009));
}
} else {
RoomSlot slotLeader = room.getRoomSlotByPlayer(room.getLeader());
RoomSlot slot = room.getRoomSlotByPlayer(getConnection().getPlayer());
if (slotLeader.getState() == SlotState.SLOT_STATE_LOAD || slotLeader.getState() == SlotState.SLOT_STATE_RENDEZVOUS || slotLeader.getState() == SlotState.SLOT_STATE_PRESTART || slotLeader.getState() == SlotState.SLOT_STATE_BATTLE_READY || slotLeader.getState() == SlotState.SLOT_STATE_BATTLE) {
room.changeSlotState(slot.getId(), SlotState.SLOT_STATE_LOAD, true);
sendPacket(new SM_BATTLE_READY(room, getConnection().getPlayer()));
sendPacket(new SM_ROOM_READY_ERROR(slot.getState().ordinal()));
for(Player member : room.getPlayers().values())
if(room.getRoomSlotByPlayer(member).getState().ordinal() > 8 && room.getRoomSlotByPlayer(member).getId() != slot.getId())
member.getConnection().sendPacket(new SM_BATTLE_READY2(room, slot.getPlayer()));
}
if (slot.getState() == SlotState.SLOT_STATE_READY) {
slot.setState(SlotState.SLOT_STATE_NORMAL);
slot.Ghost = true;
} else if (slot.getState() == SlotState.SLOT_STATE_NORMAL) {
slot.setState(SlotState.SLOT_STATE_READY);
slot.Ghost = true;
}
}
ThreadPoolManager.getInstance().executeTask(new Runnable() {
@Override
public void run() {
for (Player member : getConnection().getRoom().getPlayers().values()) {
member.getConnection().sendPacket(new SM_ROOM_INFO(room));
}
}
});
}

}
[/SRC]
Ответ


Возможно похожие темы ...
Тема Автор Ответы Просмотры Последний пост
  BATTLE Camera Game mode Exile03 9 2,262 02-08-2016, 06:43 PM
Последний пост: Exile03
  No wait respawn in camera mode Exile03 14 4,003 01-22-2016, 05:53 PM
Последний пост: Exile03

Перейти к форуму:


Пользователи, просматривающие эту тему: 1 Гость(ей)