Make a referance to an object

Discussion in 'Archives' started by xk1llxk1llx, Aug 3, 2010.

Make a referance to an object
  1. Unread #1 - Aug 3, 2010 at 9:21 PM
  2. xk1llxk1llx
    Joined:
    Apr 13, 2008
    Posts:
    212
    Referrals:
    2
    Sythe Gold:
    0
    Tier 1 Prizebox

    xk1llxk1llx awesomeness lurks within this playa ;)
    $100 USD Donor New

    Make a referance to an object

    Okay, well in java if you want faster preformance mostly in RSPS, or if you want to keep down the load in your vps, you have to use last used/system's last checked so a cached (x).

    X - the object you want to cache/use last one server had.

    Well, I've seen a bunch of server's without cached stuff so it made them laggy.

    This is java btw, for all the beginners.

    A few thing you will need to know,

    Your java repository ;) ,
    how your system works.

    Let's do an example with RSPS.

    We have a failed coded RSPS so let's use a PI.

    So... Let's say you wanted to use the last time system caught this as a timer?

    Let's make a timer.java and let's put this:
    Code:
    public class timer {
    
    public timer(int timers) {
        timers = System.currentMilliS;
    }
    
    }
    
    now use that as a referance.

    public long omglong;
    omgnewb = new timer(omglong);

    so it will start up timer and put the last sytem found for omglong.

    so let's do a more advanced one, caching your update block.

    You know this will take a load off the server and speed up server processing but not that much tho.

    Stream usually handles our update blocks.

    appendPlayerUpdateBlock hold our update blocks.

    so we simply make a method:
    Code:
    public Stream cachedupdateblock;
    
    public Stream hascachedupdateblock() [
        cachedupdateblock != null;
    }
    
    so now in appendPlayerUpdateBlock we make it check

    Code:
    if(hascachedupdateblock() && !updateRequired) {
       getcachedupdateblock();
    }
    
    again this is sample code.

    anyways, just make a referance to the object you want to have a referance to in the future, then make it check/use it.

    This is basic and simple. ^_^
     
  3. Unread #2 - Aug 3, 2010 at 11:14 PM
  4. Karl
    Joined:
    Jul 17, 2010
    Posts:
    5,755
    Referrals:
    11
    Sythe Gold:
    110

    Karl Devils Advocate
    Do Not Trade

    Make a referance to an object

    Even though this is useful to some RSPS programmers or Java Programmers that could possibly be at Sythe, The area that this would appeal to is too small, and isnt really a guide, more of a Snippet Tutorial.
     
  5. Unread #3 - Aug 3, 2010 at 11:38 PM
  6. xk1llxk1llx
    Joined:
    Apr 13, 2008
    Posts:
    212
    Referrals:
    2
    Sythe Gold:
    0
    Tier 1 Prizebox

    xk1llxk1llx awesomeness lurks within this playa ;)
    $100 USD Donor New

    Make a referance to an object

    It is a guide, because I show them how to make and use the referance, it would make more sence in programming sections here tbh, so it does not have to be moved, it is very usuful to not just RSPS also to java programmers.
     
  7. Unread #4 - Aug 5, 2010 at 1:36 AM
  8. db0winsanity
    Joined:
    Dec 28, 2008
    Posts:
    109
    Referrals:
    0
    Sythe Gold:
    0

    db0winsanity Active Member

    Make a referance to an object

    I think its a guide, but thats just imo
     
< Guide on changing username markup on vBulletin | ImPrettyCool's MM Application: Getting Proofs >

Users viewing this thread
1 guest


 
 
Adblock breaks this site