Thread: few errors converting

Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1 few errors converting 
    Registered Member
    Join Date
    Aug 2009
    Posts
    383
    Thanks given
    3
    Thanks received
    6
    Rep Power
    34
    hey, just tried to convert this http://www.rune-server.org/runescape...hat-ranks.html to z508/525 and got a few errors, id be happy if anyone can help

    Compiling vi/z525/base/Engine.java
    .\vi\z525\base\net\packethandler\PublicChat.java:3 7: cannot find symbol
    symbol : variable chatText
    location: class vi.z525.base.net.packethandler.PublicChat
    Engine.clanChat.sendMessage(p, chatText.substring(1));
    ^
    .\vi\z525\base\net\packethandler\PublicChat.java:3 7: package Engine does not exi
    st
    Engine.clanChat.sendMessage(p, chatText.substring(1));
    ^
    Note: .\vi\z525\base\clanchat\Room.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Press any key to continue . . .
    here is my PublicChat.java
    /*
    * Class PublicChat
    *
    * Version 1.0
    *
    * Saturday, September 11, 2010
    *
    * Created by Codeusa palis was crap i re did it
    */

    package vi.z525.base.net.packethandler;

    import vi.z525.base.Server;
    import vi.z525.base.model.Player;
    import vi.z525.base.util.Misc;
    import vi.z525.base.Engine;

    public class PublicChat implements Packet {
    /**
    * Handles player chatting.
    * @param p The Player which the frame should be handled for.
    * @param packetId The packet id this belongs to.
    * @param packetSize The amount of bytes being recieved for this packet.
    */
    public void handlePacket(Player p, int packetId, int packetSize) {
    if (p == null || p.stream == null) {
    return;
    }
    p.chatTextEffects = p.stream.readUnsignedWord();
    int numChars = p.stream.readUnsignedByte();
    p.chatText = Misc.decryptPlayerChat(p.stream, numChars);
    if (p.muteType > 0) {
    p.getActionSender().sendMessage(p, "You are muted and cannot talk.");
    return;
    }
    if (p.chatText.startsWith("/")) {
    if (p.clanRoom.length() > 0) {
    Engine.clanChat.sendMessage(p, p.chatText.substring(1));
    }
    } else {

    p.chatTextEffects = p.stream.readUnsignedWord();
    p.chatText = Misc.decryptPlayerChat(p.stream, numChars);
    p.chatTextUpdateReq = true;
    p.updateReq = true;
    }
    }
    }
    Reply With Quote  
     

  2. #2  
    Registered Wizard

    Jesse's Avatar
    Join Date
    Sep 2009
    Age
    29
    Posts
    5,119
    Thanks given
    1,519
    Thanks received
    1,148
    Rep Power
    5000
    Compiling vi/z525/base/Engine.java
    .\vi\z525\base\net\packethandler\PublicChat.java:4 5: reached end of file while p
    arsing
    }→

    missing a }

    also use eclipse



    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Aug 2009
    Posts
    383
    Thanks given
    3
    Thanks received
    6
    Rep Power
    34
    Quote Originally Posted by Katy Perry View Post
    Compiling vi/z525/base/Engine.java
    .\vi\z525\base\net\packethandler\PublicChat.java:4 5: reached end of file while p
    arsing
    }→

    missing a }

    also use eclipse
    yer i figured that one out but ty for helping
    Reply With Quote  
     

  4. #4  
    Registered Member
    AndyJay's Avatar
    Join Date
    Jun 2008
    Posts
    1,285
    Thanks given
    38
    Thanks received
    48
    Rep Power
    84
    Compiling vi/z525/base/Engine.java
    .\vi\z525\base\util\Misc.java:393: cannot find symbol
    symbol : class Player
    location: class vi.z525.base.util.Misc
    public static Player player(String name) {

    Import the Player class in Misc. That should also fix a lot of the others.


    Add
    Code:
    	public long readBigQWord() {
        	long l = (long) readDWordBigEndian();
            long l1 = (long) readDWordBigEndian();
            
            if(l1<0) {
            	l1 = l1 & 0xffffffffL;
            }
    
            return (l  << -41780448) + l1;
        }
    	public int readDWordBigEndian() {
        	return (inBuffer[inOffset++] & 0xff)
        	    | ((inBuffer[inOffset++] & 0xff) << 1279827400)
        	    | ((inBuffer[inOffset++] & 0xff) << -882770384)
        	    | ((inBuffer[inOffset++] & 0xff) << 1432242680);
        }
    Into ByteVector.


    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Registered Member
    Join Date
    Aug 2009
    Posts
    383
    Thanks given
    3
    Thanks received
    6
    Rep Power
    34
    Quote Originally Posted by AndyJay123 View Post
    Compiling vi/z525/base/Engine.java
    .\vi\z525\base\util\Misc.java:393: cannot find symbol
    symbol : class Player
    location: class vi.z525.base.util.Misc
    public static Player player(String name) {

    Import the Player class in Misc. That should also fix a lot of the others.


    Add
    Code:
    	public long readBigQWord() {
        	long l = (long) readDWordBigEndian();
            long l1 = (long) readDWordBigEndian();
            
            if(l1<0) {
            	l1 = l1 & 0xffffffffL;
            }
    
            return (l  << -41780448) + l1;
        }
    	public int readDWordBigEndian() {
        	return (inBuffer[inOffset++] & 0xff)
        	    | ((inBuffer[inOffset++] & 0xff) << 1279827400)
        	    | ((inBuffer[inOffset++] & 0xff) << -882770384)
        	    | ((inBuffer[inOffset++] & 0xff) << 1432242680);
        }
    Into ByteVector.
    thank you fixed 3 errors
    Reply With Quote  
     

  7. #6  
    Registered Member
    AndyJay's Avatar
    Join Date
    Jun 2008
    Posts
    1,285
    Thanks given
    38
    Thanks received
    48
    Rep Power
    84
    Replace
    p.chatTextEffects = chatTextEffects;

    With:
    p.chatTextEffects = p.stream.readUnsignedWord();

    And replace:
    p.chatText = chatText;

    With:
    p.chatText = Misc.decryptPlayerChat(p.stream, numChars);


    Reply With Quote  
     

  8. Thankful user:


  9. #7  
    Registered Member
    Join Date
    Aug 2009
    Posts
    383
    Thanks given
    3
    Thanks received
    6
    Rep Power
    34
    Quote Originally Posted by AndyJay123 View Post
    Replace
    p.chatTextEffects = chatTextEffects;

    With:
    p.chatTextEffects = p.stream.readUnsignedWord();

    And replace:
    p.chatText = chatText;

    With:
    p.chatText = Misc.decryptPlayerChat(p.stream, numChars);
    thanks man 2 errors left now
    Reply With Quote  
     

  10. #8 reply 
    Registered Member
    Mr.Client's Avatar
    Join Date
    Jun 2010
    Posts
    2,094
    Thanks given
    100
    Thanks received
    317
    Rep Power
    259
    Quote Originally Posted by Virtual View Post
    thanks man 2 errors left now
    send me link to tut ill tell u what your missing.
    Reply With Quote  
     

  11. #9  
    Registered Member
    Join Date
    Aug 2009
    Posts
    383
    Thanks given
    3
    Thanks received
    6
    Rep Power
    34
    Reply With Quote  
     

  12. #10  
    Registered Member
    AndyJay's Avatar
    Join Date
    Jun 2008
    Posts
    1,285
    Thanks given
    38
    Thanks received
    48
    Rep Power
    84
    Whats the errors


    Reply With Quote  
     

Page 1 of 2 12 LastLast

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
  •