Thread: Some bug fixes

Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1 Some bug fixes 
    Banned
    Join Date
    Aug 2011
    Posts
    369
    Thanks given
    50
    Thanks received
    57
    Rep Power
    0
    These are some bug fixes for EasyRSC/RSCDaemon/NOOBScape.
    Let's get started!


    java.lang.ExceptionInInitializerError
    Simply find the class listed after:
    Code:
    Cannot construct *CLASSNAME HERE* as it does not have a default no-args constructor
    Then add a constructor to the class. For example, for the class InvItem:

    BEFORE:
    Code:
    package org.rscdaemon.server.model;
    
    import org.rscdaemon.server.entityhandling.EntityHandler;
    import org.rscdaemon.server.entityhandling.defs.ItemDef;
    import org.rscdaemon.server.entityhandling.defs.extras.*;
    
    public class InvItem extends Entity implements Comparable<InvItem> {
        
        private int amount;
        private boolean wielded = false;
    
        public InvItem(int id) {
            setID(id);
            setAmount(1);
        }
    
        public InvItem(int id, int amount) {
            setID(id);
            setAmount(amount);
        }
        
        public ItemSmeltingDef getSmeltingDef() {
            return EntityHandler.getItemSmeltingDef(id);
        }
        
        public ItemCookingDef getCookingDef() {
            return EntityHandler.getItemCookingDef(id);
        }
        
        public ItemUnIdentHerbDef getUnIdentHerbDef() {
            return EntityHandler.getItemUnIdentHerbDef(id);
        }
        
        public ItemWieldableDef getWieldableDef() {
            return EntityHandler.getItemWieldableDef(id);
        }
        
        public ItemDef getDef() {
            return EntityHandler.getItemDef(id);
        }
        
        public boolean isWieldable() {
            return EntityHandler.getItemWieldableDef(id) != null;
        }
        
        public boolean isEdible() {
            return EntityHandler.getItemEdibleHeals(id) > 0;
        }
        
        public boolean isWielded() {
            return wielded;
        }
        
        public void setWield(boolean wielded) {
            this.wielded = wielded;
        }
        
        public void setAmount(int amount) {
            if(amount < 0) {
                amount = 0;
            }
            this.amount = amount;    
        }
        
        public int getAmount() {
            return amount;
        }
        
        public boolean wieldingAffectsItem(InvItem i) {
            if(!i.isWieldable() || !isWieldable()) {
                return false;
            }
                  for(int affected : getWieldableDef().getAffectedTypes()) {
                      if(i.getWieldableDef().getType() == affected) {
                          return true;
                      }
                  }
                  return false;
        }
        
        public int eatingHeals() {
            if(!isEdible()) {
                return 0;
            }
            return EntityHandler.getItemEdibleHeals(id);
        }
        
        public boolean equals(Object o) {
            if (o instanceof InvItem) {
                InvItem item = (InvItem)o;
                return item.getID() == getID();
            }
            return false;
        }
        
        public int compareTo(InvItem item) {
            if(item.getDef().isStackable()) {
                return -1;
            }
            if(getDef().isStackable()) {
                return 1;
            }
            return item.getDef().getBasePrice() - getDef().getBasePrice();
        }
    
    }
    AFTER:
    Code:
    package org.rscdaemon.server.model;
    
    import org.rscdaemon.server.entityhandling.EntityHandler;
    import org.rscdaemon.server.entityhandling.defs.ItemDef;
    import org.rscdaemon.server.entityhandling.defs.extras.*;
    
    public class InvItem extends Entity implements Comparable<InvItem> {
        
        private int amount;
        private boolean wielded = false;
    
        public InvItem() {}
    
        public InvItem(int id) {
            setID(id);
            setAmount(1);
        }
    
        public InvItem(int id, int amount) {
            setID(id);
            setAmount(amount);
        }
        
        public ItemSmeltingDef getSmeltingDef() {
            return EntityHandler.getItemSmeltingDef(id);
        }
        
        public ItemCookingDef getCookingDef() {
            return EntityHandler.getItemCookingDef(id);
        }
        
        public ItemUnIdentHerbDef getUnIdentHerbDef() {
            return EntityHandler.getItemUnIdentHerbDef(id);
        }
        
        public ItemWieldableDef getWieldableDef() {
            return EntityHandler.getItemWieldableDef(id);
        }
        
        public ItemDef getDef() {
            return EntityHandler.getItemDef(id);
        }
        
        public boolean isWieldable() {
            return EntityHandler.getItemWieldableDef(id) != null;
        }
        
        public boolean isEdible() {
            return EntityHandler.getItemEdibleHeals(id) > 0;
        }
        
        public boolean isWielded() {
            return wielded;
        }
        
        public void setWield(boolean wielded) {
            this.wielded = wielded;
        }
        
        public void setAmount(int amount) {
            if(amount < 0) {
                amount = 0;
            }
            this.amount = amount;    
        }
        
        public int getAmount() {
            return amount;
        }
        
        public boolean wieldingAffectsItem(InvItem i) {
            if(!i.isWieldable() || !isWieldable()) {
                return false;
            }
                  for(int affected : getWieldableDef().getAffectedTypes()) {
                      if(i.getWieldableDef().getType() == affected) {
                          return true;
                      }
                  }
                  return false;
        }
        
        public int eatingHeals() {
            if(!isEdible()) {
                return 0;
            }
            return EntityHandler.getItemEdibleHeals(id);
        }
        
        public boolean equals(Object o) {
            if (o instanceof InvItem) {
                InvItem item = (InvItem)o;
                return item.getID() == getID();
            }
            return false;
        }
        
        public int compareTo(InvItem item) {
            if(item.getDef().isStackable()) {
                return -1;
            }
            if(getDef().isStackable()) {
                return 1;
            }
            return item.getDef().getBasePrice() - getDef().getBasePrice();
        }
    
    }
    Repeat this for all errors you get, replacing the name after "public" with the classname.

    javac error
    You will simply need to open up your source files and find build.xml. Open it up in notepad and find:

    Code:
    <javac srcdir="${src}" destdir="${build}" debug="on" target="1.5">
    And change 1.5 to your JDK version.

    Ant Error

    http://www.rune-server.org/runescape...ant-issue.html

    ERROR: The process "java.exe" not found

    Simply open up your compile.bat and remove the following code:

    Code:
    taskkill /F /IM java.exe
    NOTE: This does not actually affect your server and it is probably a better idea to leave this in the file, as it closes any current connections to prevent errors.

    MISCELLANEOUS

    Replace the red
    Code:
    set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_11
    with your Java JDK path.

    Please post some more errors here and I'll try to fix them, all I ask in return is some rep
    Reply With Quote  
     

  2. #2  
    Developer

    Join Date
    Jun 2009
    Posts
    793
    Thanks given
    26
    Thanks received
    67
    Rep Power
    11
    Um, this would be sort of explanatory. But I guess for the kids who know nothing would need it, but I'll post later on what you should actually do in this topic. Everything you posted was not needed. Except for the last one, if you do not have your paths set for, Java, Javac, and ANT
    Want something done? Private message me, but have something to offer.
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Aug 2011
    Posts
    369
    Thanks given
    50
    Thanks received
    57
    Rep Power
    0
    Quote Originally Posted by ifailatcoding View Post
    Um, this would be sort of explanatory. But I guess for the kids who know nothing would need it, but I'll post later on what you should actually do in this topic. Everything you posted was not needed. Except for the last one, if you do not have your paths set for, Java, Javac, and ANT
    Then this is for those who "know nothing".
    Reply With Quote  
     

  4. #4  
    Developer

    Join Date
    Jun 2009
    Posts
    793
    Thanks given
    26
    Thanks received
    67
    Rep Power
    11
    1. UppIT - Free File Sharing - ant.zip
    Download this, (3MB) the only Apache ANT Files needed.
    Add it to your source, outside of it. Where Build.xml is located and such..

    Delete everything in your compile batch(.bat) and add this..

    Code:
    set PATH=%PATH%;ant\bin
    set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_11
    ant compile
    Change the
    Code:
     C:\Program Files\Java\jdk1.6.0_11
    to yours.

    All your problems are fixed.
    Want something done? Private message me, but have something to offer.
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Aug 2011
    Posts
    369
    Thanks given
    50
    Thanks received
    57
    Rep Power
    0
    Quote Originally Posted by ifailatcoding View Post
    1. UppIT - Free File Sharing - ant.zip
    Download this, (3MB) the only Apache ANT Files needed.
    Add it to your source, outside of it. Where Build.xml is located and such..

    Delete everything in your compile batch(.bat) and add this..

    Code:
    set PATH=%PATH%;ant\bin
    set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_11
    ant compile
    Change the
    Code:
     C:\Program Files\Java\jdk1.6.0_11
    to yours.

    All your problems are fixed.
    You also need to change JDK level in build.xml and add the no-args constructors.
    Now stop being an arrogant douchebag.
    Reply With Quote  
     

  6. #6  
    Developer

    Join Date
    Jun 2009
    Posts
    793
    Thanks given
    26
    Thanks received
    67
    Rep Power
    11
    Actually you don't seeing as I have JDK 1.6.

    Code:
    set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_11
    Also, I was just giving you an easier way to do this. No need for the name calling.
    Want something done? Private message me, but have something to offer.
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Aug 2011
    Posts
    369
    Thanks given
    50
    Thanks received
    57
    Rep Power
    0
    Quote Originally Posted by ifailatcoding View Post
    Actually you don't seeing as I have JDK 1.6.

    Code:
    set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_11
    Also, I was just giving you an easier way to do this. No need for the name calling.
    Sorry. Anyway, the main intention of this thread was to assist noobs, as I once was, at RSC programming. If you could give me a list of some errors to solve that would be great.
    Reply With Quote  
     

  8. #8  
    Developer

    Join Date
    Jun 2009
    Posts
    793
    Thanks given
    26
    Thanks received
    67
    Rep Power
    11
    Eh, I know there's a bug in noobscape and a few crashes.

    You can fix:

    Pking(When you attack someone, it acts as following. So if you click attack them twice it catch's everytime.) could fix it with 'ResetFollow(); or w/e it is.

    The GUI causes a crash in Noobscape, not many people know how to remove it fully.

    Uh, the Spamming. Say if you spam something really fast it will disconnect you. Make it so it just ignores the packets and doesn't disconnect you.

    I already fixed all these before, but if you want you can show other people how.
    Want something done? Private message me, but have something to offer.
    Reply With Quote  
     

  9. #9  
    The One And Only

    01053's Avatar
    Join Date
    Apr 2011
    Age
    28
    Posts
    2,887
    Thanks given
    417
    Thanks received
    885
    Rep Power
    856
    Nice.


    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Dec 2010
    Age
    29
    Posts
    1,186
    Thanks given
    513
    Thanks received
    340
    Rep Power
    35
    decent, goodjob.
    Reply With Quote  
     

  11. Thankful users:


Page 1 of 3 123 LastLast

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. 562 GFX and Other Fixes?
    By Floof of light in forum Help
    Replies: 2
    Last Post: 06-26-2011, 04:18 PM
  2. Help with some fixes
    By JeremyM in forum Help
    Replies: 0
    Last Post: 12-28-2009, 01:05 AM
  3. Some Fixes
    By Vastiko in forum Snippets
    Replies: 3
    Last Post: 05-30-2009, 09:27 PM
  4. [525] Bug Fixes [525]
    By 'Hunter in forum Help
    Replies: 3
    Last Post: 03-30-2009, 10:57 PM
  5. 525 Fixes
    By valdamoon in forum Requests
    Replies: 5
    Last Post: 02-11-2009, 09:35 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
  •