Thread: best way to deal with this

Results 1 to 6 of 6
  1. #1 best way to deal with this 
    Registered Member
    Join Date
    Mar 2012
    Posts
    94
    Thanks given
    4
    Thanks received
    13
    Rep Power
    21
    obviously i want to update quest tab text, but i don't want to send this:
    Code:
    		for (Player p : players) {
    			if ((p != null) && (p.isActive())) {
    				InterfaceHandler.writeText(new QuestTab(p));
    				p.send(new SendMessage("sent quest tab"));
    			}
    		}
    every cycle.

    when would be the best time to send this?
    Reply With Quote  
     

  2. #2  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Make it so when a player logs in that you update the quest tab text for that player only.
    Attached image
    Reply With Quote  
     

  3. #3  
    Registered Member
    Grant_'s Avatar
    Join Date
    Aug 2014
    Posts
    495
    Thanks given
    96
    Thanks received
    109
    Rep Power
    136
    Quote Originally Posted by RememberM3 View Post
    Make it so when a player logs in that you update the quest tab text for that player only.
    It looks like he is wanting to update it constantly though, this would mean the player would have to relog to refresh.

    OT: Make it so everytime a player opens the quest tab it calls the method to update.
    - Grant
    Attached image
    Reply With Quote  
     

  4. #4  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Quote Originally Posted by Grant_ View Post
    It looks like he is wanted to update it contamtly though, this would mean the player would have to relog to refresh.

    OT: Make it so everytime to player opens the quest tab it updates

    - Grant
    Oh okay, then is your suggestion better
    Attached image
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Mar 2012
    Posts
    94
    Thanks given
    4
    Thanks received
    13
    Rep Power
    21
    still need this


    Quote Originally Posted by Grant_ View Post
    It looks like he is wanting to update it constantly though, this would mean the player would have to relog to refresh.

    OT: Make it so everytime a player opens the quest tab it calls the method to update.
    - Grant
    i'm pretty sure i would have to do that client sided
    Reply With Quote  
     

  6. #6  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    Update the entire quest tab for the player logging in (don't loop through the entire player list), this way you can ensure it's only called once. You don't need to loop through all of the players like you're doing, unless you want to have some dynamic feature in the quest tab like a server time that dynamically updates. If you had a kill counter or something, you would update that text for that player when they kill another player. Don't put this in any tick, it doesn't need to be in there. Tick is called every 600 ms, so that's a lot of packets every cycle.
    Attached image
    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. How to deal with this.
    By Oogle in forum Chat
    Replies: 22
    Last Post: 07-10-2013, 09:25 PM
  2. Best way to make money on this account?
    By Dat Guy in forum Chat
    Replies: 1
    Last Post: 02-03-2012, 06:57 PM
  3. Best way to do this?
    By I Am Kacey in forum Help
    Replies: 3
    Last Post: 01-04-2012, 04:00 AM
  4. Best Way to Do This?
    By Vault in forum Requests
    Replies: 1
    Last Post: 12-28-2010, 02:28 AM
  5. best way to fix this dupe.
    By Balla in forum Help
    Replies: 3
    Last Post: 06-22-2010, 09:25 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
  •