Thread: Null Pointer Help :\

Results 1 to 5 of 5
  1. #1 Null Pointer Help :\ 



    Join Date
    Oct 2011
    Posts
    874
    Thanks given
    301
    Thanks received
    373
    Rep Power
    338
    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?
    Reply With Quote  
     

  2. #2  



    Join Date
    Oct 2011
    Posts
    874
    Thanks given
    301
    Thanks received
    373
    Rep Power
    338
    Bump
    Reply With Quote  
     

  3. #3  
    Registered Member
    Vox''s Avatar
    Join Date
    Nov 2008
    Age
    31
    Posts
    3,113
    Thanks given
    49
    Thanks received
    181
    Rep Power
    731
    Post the lines; more specifically the trade and duel ones.

    Quote Originally Posted by Zirtrix View Post
    So I've recently changed some things in the server, but when i compile it says
    Code:
    source\server\model\players\packets\Commands.java: 58: error: cannot find symbol
    This.Antileech("Remove This Line");
    ^
    Anyone know the problem?
    Student and Developer for http://www.rune-server.org/runescape...pve-based.html
    Reply With Quote  
     

  4. #4  



    Join Date
    Oct 2011
    Posts
    874
    Thanks given
    301
    Thanks received
    373
    Rep Power
    338
    Updated thread with the lines as requested.
    Reply With Quote  
     

  5. #5  
    Fuckin PRO Derek's Avatar
    Join Date
    May 2008
    Posts
    1,257
    Thanks given
    38
    Thanks received
    86
    Rep Power
    67
    Get it out of the process so it doesn't loop and give you errors.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Null Pointer
    By Jaegon in forum Help
    Replies: 6
    Last Post: 10-09-2011, 10:05 PM
  2. Null pointer
    By Andrew in forum Help
    Replies: 12
    Last Post: 08-05-2010, 05:12 PM
  3. Null pointer
    By Mr. Epic in forum Help
    Replies: 3
    Last Post: 12-01-2009, 08:17 AM
  4. Null pointer
    By Warlock 999 in forum Help
    Replies: 4
    Last Post: 11-02-2009, 01:09 AM
  5. Null pointer
    By Bruno in forum Help
    Replies: 3
    Last Post: 07-09-2009, 04:39 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •