Every time I use the following:
Code:
c.getPA().closeAllWindows();
When closing an interface or declining a trade or etc, I get the following NullPointer:
Here are the lines from the CMD:
TradeAndDuel.java:
Code:
263- public void declineTrade() {
264- Client o = (Client) Server.playerHandler.players[c.tradeWith];
265- c.tradeStatus = 0;
266- declineTrade(true);
267- c.sendMessage("Trade was declined.");
268- o.sendMessage("Trade was declined.");
269- }
PlayerAssistant.java
Code:
371- public void closeAllWindows() {
372- if (c.getOutStream() != null && c != null) {
373- c.getOutStream().createFrame(219);
374- c.flushOutStream();
375- c.getTradeAndDuel().declineTrade();
376- }
377- }
ClickingButtons.java
Code:
418- case 39178:
419- c.getPA().closeAllWindows();
420- break;
PacketHandler.java
Code:
public static void processPacket(Client c, int packetType, int packetSize) {
if(packetType == -1) {
return;
}
PacketType p = packetId[packetType];
if(p != null) {
try {
//System.out.println("packet: " + packetType);
140- p.processPacket(c, packetType, packetSize);
} catch(Exception e) {
e.printStackTrace();
}
} else {
System.out.println("Unhandled packet type: "+packetType+ " - size: "+packetSize);
}
}
Client.java
Code:
public synchronized boolean processQueuedPackets() {
Packet p = null;
synchronized(queuedPackets) {
p = queuedPackets.poll();
}
if(p == null) {
return false;
}
inStream.currentOffset = 0;
packetType = p.getId();
packetSize = p.getLength();
inStream.buffer = p.getData();
if(packetType > 0) {
//sendMessage("PacketType: " + packetType);
762- PacketHandler.processPacket(this, packetType, packetSize);
}
timeOutCounter = 0;
return true;
}
PlayerHandler.java
Code:
while(players[i].processQueuedPackets());
Server.java
Code:
playerHandler.process();
Any idea what could resolve the issue?