• Log in or sign up for an account here: https://www.sythe.org/login

Make a referance to an object

xk1llxk1llx

awesomeness lurks within this playa ;)

$100 USD Donor New
Joined
Apr 13, 2008
Sythe Gold
0
Messages
212
Tier 1 Prizebox
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. ^_^
 
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.
 
Tier 1 Prizebox
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.
 
duelarena.gg
Back
Top