Thread: What is slowing down item equipping [Espeon/Palidino/Codeusa]

Page 1 of 3 123 LastLast
Results 1 to 10 of 28
  1. #1 What is slowing down item equipping [Espeon/Palidino/Codeusa] 
    Registered Member
    Dark Regen's Avatar
    Join Date
    Jan 2009
    Posts
    678
    Thanks given
    184
    Thanks received
    22
    Rep Power
    185
    Alright, most servers have hybrid switch. Well it's still too slow. This thread must be read if you are running a PK server.

    What actually is slowing down equipping items is:
    Code:
    Thread.sleep(100 - (System.currentTimeMillis() - curTime));
    What is this doing?
    Its making it sleep for around 100 ms, this can effect the packet timer (Item equipping, object options etc). Not only the packet timer, it's also effecting the login system.
    Code:
                connectAwaitingPlayers();
                packets.parseIncomingPackets();
    The correct ms for the packet to sleep is 30 (I'm not sure, correct me if i'm wrong).

    How to fix it?
    Process it with another run, but allow it to sleep for 30ms.
    What I suggest is using a multithreader. (scheduleAtFixedRate)

    Thank you for reading, hope you understand.


    Quote Originally Posted by Nikki View Post
    Make sure this won't affect any packets though, it may be slowing it down but it also stops the server from accepting too many players at a time (You should monitor this differently than Palidino did, since you should probably accept a max of 10 players per cycle?), This can also be used to flood the server with packets, make sure you have a good enough plan to stop any mass-packeting which can cause problems.

    Quote Originally Posted by Boomer View Post
    ...or perhaps its due to the fact that MANY servers loop through 200+ string comparisons to find out which slot to equip an item to.

    ie)
    Code:
    private String[] capes = {"cape","Cape", "attractor", "accumulator", "Hooded cloak"};
        private String[] hats = {"A powdered wig", "a powdered wig", "Sleeping cap", "sleeping cap", "ears", "helm","hood","coif","Coif","hat","partyhat","Hat","full helm (t)","full helm (g)","hat (t)","hat (g)","cav","boater","helmet","mask","Helm of neitiznot"};
        private String[] boots = {"boots","Boots"};
        private String[] gloves = {"gloves","gauntlets","Gloves","vambraces","vamb","bracers"};
        private String[] shields = {"kiteshield","sq shield","Toktz-ket","books","book","kiteshield (t)","kiteshield (g)","kiteshield(h)","defender","shield"};
        private String[] amulets = {"Gnome scarf", "amulet","necklace","Amulet of"};
        private String[] arrows = {"arrow","arrows","arrow(p)","arrow(+)","arrow(s)","bolt","Bolt rack","Opal bolts","Dragon bolts","Onyx bolts"};
        private String[] rings = {"ring", "Ring of dueling", "stone", "recoil"};
        private String[] body = {"Guthix dragonhide", "Saradomin d'hide", "Zamorak d'hide", "platebody","chainbody","robetop","leathertop","platemail","top","brassard","Robe top","body","platebody (t)","platebody (g)","body(g)","body_(g)","chestplate","torso","shirt", "armour"};
        private String[] legs = {"pantaloons", "Pantaloons", "platelegs", "plateskirt","skirt","bottoms","chaps","platelegs (t)","platelegs (g)","bottom","skirt","skirt (g)","skirt (t)","chaps (g)","chaps (t)","tassets","legs", "robe", "flared", "trousers"};
        private String[] weapons = {"Toy kite", "toy kite", "sceptre", "snowball", "Snowball", "Ivandis", "gnomecopter", "flail", "Monkey greegree", "Barb-tail harpoon", "Flowers", "Keris", "Saradomin banner", "Zamorak banner", "scimitar","longsword","sword","longbow","shortbow","dagger","mace","halberd","spear",
        "Abyssal whip","axe","flail","crossbow","Torags hammers","dagger(p)","dagger(+)","dagger(s)","spear(p)","spear(+)",
        "spear(s)","spear(kp)","maul","dart","dart(p)","javelin","javelin(p)","knife","knife(p)","Longbow","Shortbow",
        "Crossbow","Toktz-xil","Toktz-mej","Tzhaar-ket","staff","Staff","godsword","c'bow","Crystal bow","Dark bow",
        "Barrelchest anchor", "Training bow", "claws", "Gnomecopter", "Gnome", "copter", "gnomecopter", "omni-talisman", "Omni-talisman", "Omni-Talisman"};
        /* Fullbody is an item that covers your arms. */
        private String[] fullbody = {"Guthix dragonhide", "Saradomin d'hide", "Zamorak d'hide", "top","shirt","platebody","Ahrims robetop","Karils leathertop","brassard","Robe top","robetop","platebody (t)","platebody (g)","chestplate","torso", "chainbody"};
        /* Fullhat covers your head but not your beard. */
        private String[] fullhat = {"Hooded cloak", "med helm","coif","Dharoks helm","hood","Initiate helm","Coif","Helm of neitiznot", "full helm", "helm"};
        /* Fullmask covers your entire head. */
        private String[] fullmask = {"full helm","Veracs helm","Guthans helm","Torags helm","Karils coif","full helm (t)","full helm (g)"};
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Mar 2011
    Posts
    222
    Thanks given
    32
    Thanks received
    24
    Rep Power
    0
    Thanks but do you think instant switching is fast?

    That's what I have on mine atm and it seems to be working out good
    Reply With Quote  
     

  3. #3  
    Registered Member
    Dark Regen's Avatar
    Join Date
    Jan 2009
    Posts
    678
    Thanks given
    184
    Thanks received
    22
    Rep Power
    185
    Quote Originally Posted by Gargamele View Post
    Thanks but do you think instant switching is fast?

    That's what I have on mine atm and it seems to be working out good
    I'm not sure if it's instant switching, but yeah it is fast
    Reply With Quote  
     

  4. #4  
    Renown Programmer

    Nikki's Avatar
    Join Date
    Aug 2008
    Posts
    3,992
    Thanks given
    553
    Thanks received
    1,078
    Rep Power
    5000
    Make sure this won't affect any packets though, it may be slowing it down but it also stops the server from accepting too many players at a time (You should monitor this differently than Palidino did, since you should probably accept a max of 10 players per cycle?), This can also be used to flood the server with packets, make sure you have a good enough plan to stop any mass-packeting which can cause problems.
    Please don't add/pm me asking for RSPS help!

    Links:
    - Pastebin
    - Sleeksnap

    Reply With Quote  
     

  5. #5  
    Номер 1


    Leanbow's Avatar
    Join Date
    Feb 2008
    Posts
    5,895
    Thanks given
    1,564
    Thanks received
    2,624
    Rep Power
    5000
    What is this doing?
    Its making it sleep for 100 MS
    Stop smoking weed dude,
    Code:
    Thread.sleep(100 - (System.currentTimeMillis() - curTime));
    Reply With Quote  
     

  6. Thankful users:


  7. #6  
    Registered Member
    Dark Regen's Avatar
    Join Date
    Jan 2009
    Posts
    678
    Thanks given
    184
    Thanks received
    22
    Rep Power
    185
    Quote Originally Posted by Men View Post
    Stop smoking weed dude,
    Code:
    Thread.sleep(100 - (System.currentTimeMillis() - curTime));
    lemme test

    Umm, your the one who should stop smoking weed..

    Starting server on port: 43594
    System.currentTimeMillis() - curTime = 1
    System.currentTimeMillis() - curTime = 1
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 1
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 2
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 1
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 1
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    System.currentTimeMillis() - curTime = 0
    Tested by:

    Code:
    		curMil = System.currentTimeMillis() - curTime;
    		Misc.println("System.currentTimeMillis() - curTime = " + (int) (curMil));
                    Thread.sleep(100 - (curMil));
    Reply With Quote  
     

  8. #7  
    Hi.

    'Mystic Flow's Avatar
    Join Date
    Nov 2007
    Posts
    7,146
    Thanks given
    256
    Thanks received
    1,252
    Rep Power
    3714
    Quote Originally Posted by Men View Post
    Stop smoking weed dude,
    Code:
    Thread.sleep(100 - (System.currentTimeMillis() - curTime));
    It should sleep at a rate of 90 - 100 ms since it takes that long to process anything normally



    Reply With Quote  
     

  9. #8  
    Номер 1


    Leanbow's Avatar
    Join Date
    Feb 2008
    Posts
    5,895
    Thanks given
    1,564
    Thanks received
    2,624
    Rep Power
    5000
    Quote Originally Posted by 'Mystic Flow View Post
    It should sleep at a rate of 90 - 100 ms since it takes that long to process anything normally
    He said it always sleeps for 100MS.
    Reply With Quote  
     

  10. #9  
    Registered Member
    Dark Regen's Avatar
    Join Date
    Jan 2009
    Posts
    678
    Thanks given
    184
    Thanks received
    22
    Rep Power
    185
    Quote Originally Posted by Men View Post
    He said it always sleeps for 100MS.
    btw, the rate so far i've seen was 97-100 ms, it depends what it's processing
    Reply With Quote  
     

  11. #10  
    Номер 1


    Leanbow's Avatar
    Join Date
    Feb 2008
    Posts
    5,895
    Thanks given
    1,564
    Thanks received
    2,624
    Rep Power
    5000
    Quote Originally Posted by Dark Regen View Post
    btw, the rate so far i've seen was 97-100 ms, it depends what it's processing
    mtss
    What is this doing?
    Its making it sleep for 100 MS
    Reply With Quote  
     

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. Replies: 22
    Last Post: 03-19-2011, 11:17 PM
  2. [562] Item Equipping
    By Mr Fox in forum Help
    Replies: 12
    Last Post: 07-01-2010, 04:22 AM
  3. ::god command and more (espeon/codeusa) [517]
    By pure grun in forum Configuration
    Replies: 1
    Last Post: 05-28-2010, 10:09 PM
  4. Item Equipping || iClarity v1.05
    By BenDZN. in forum Help
    Replies: 3
    Last Post: 07-27-2009, 09:45 PM
  5. Packet 187(Item Equipping)
    By Palidino in forum Configuration
    Replies: 13
    Last Post: 07-12-2008, 07:48 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
  •