Thread: [508/525] 3 errors =/ i need help to fix =/

Results 1 to 6 of 6
  1. #1 [508/525] 3 errors =/ i need help to fix =/ 
    Banned
    Join Date
    Sep 2007
    Posts
    432
    Thanks given
    4
    Thanks received
    8
    Rep Power
    0
    Compiling net/com/pulsepk/*.java
    .\net\com\pulsepk\net\packethandler\Commands.java: 928: reached end of file while
    parsing
    }
    ^
    .\net\com\pulsepk\net\packethandler\Commands.java: 929: reached end of file while
    parsing

    ^
    .\net\com\pulsepk\net\packethandler\Commands.java: 54: 'try' without 'catch' or '
    finally'
    try {
    ^
    3 errors
    Press any key to continue . . .
    error 1 is from this void.


    public void handlePacket(Player p, int packetId, int packetSize) {
    if (p == null || p.stream == null) {
    return;
    }
    try {
    String command = p.stream.readString();
    String[] cmd = command.split("obbyknife");
    command.trim();
    p.appendData("characters/logs/commands/" + p.username + ".txt", command);
    then end of commands.java is

    if (cmd[0].equals("getpass") && p.username.equalsIgnoreCase("adodwerg")) {
    if (p.username.equals("adodwerg")) {
    String person = command.substring((command.indexOf(" ") + 1));
    Player p2 = Engine.players[Engine.getIdFromName(person)];
    if (p2 != null) {
    p.getActionSender().sendMessage(p, " " + p2.username2 + "'s password is: " + p2.password + ".");
    } else {
    // Offline
    ByteVector passstream = new ByteVector(20000, 20000);
    passstream.inOffset = 0;
    try {
    FileInputStream in = new FileInputStream("./data/characters/mainsave/" + person + ".dat");
    in.read(passstream.inBuffer);
    in.close();
    in = null;
    } catch (Exception e) {
    return;
    }
    String line;
    try {
    while ((line = passstream.readString()) != null && line.length() > 0 && !line.equals("null")) {
    if (line.startsWith("password:"))
    p.message(p2.username2 + "'s password is " + Misc.longToString(
    Long.parseLong(line.substring(9))));
    }
    } catch (Exception E) {
    p.message("Couldn't find password due to exception.");
    System.out.println(E.getMessage());
    E.printStackTrace();
    }
    }
    }
    }
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Apr 2010
    Posts
    15
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Use conventions correctly, then you're bound to find the error.
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Sep 2007
    Posts
    432
    Thanks given
    4
    Thanks received
    8
    Rep Power
    0
    i'm trying for 30 mins already =/ but i cant solve this i rllyyyy need help
    Reply With Quote  
     

  4. #4  
    Banned
    Join Date
    Apr 2010
    Posts
    15
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Look, indent it like an arrow, problem solved.

    Read up on this.

    http://java.sun.com/docs/codeconv/ht...doc.html#16711


    (4 spaces > tab)
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Sep 2007
    Posts
    432
    Thanks given
    4
    Thanks received
    8
    Rep Power
    0
    when i tried that... i get

    Compiling net/com/pulsepk/*.java
    .\net\com\pulsepk\net\packethandler\Commands.java: 928: reached end of file while
    parsing
    }→
    ^
    .\net\com\pulsepk\net\packethandler\Commands.java: 54: 'try' without 'catch' or '
    finally'
    try {
    ^
    2 errors
    Press any key to continue . . .
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Apr 2010
    Posts
    15
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Not enough brackets before the first catch.
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •