|
so my knowledge in java is fluent and i thought i''d start working on my own lite framework, anyway here's my looping method for my server.java i was woundering if you guys could help me improve it a bit with player saving and such.
Code:package rs; import java.io.BufferedReader; import java.io.FileReader; public class Server { private boolean serverOn = false; private static short[] loop = new short[1]; public static void main(String[] args) { for(int i = 0; i < loop.length; i++) try { Thread.sleep(600); } catch (InterruptedException e) { e.printStackTrace(); System.out.println("Looping"); } } public boolean isServerOn() { return serverOn; } public boolean setServerOn(boolean serverOn) { this.serverOn = serverOn; return serverOn; } public void HandlePlayerSaving(int i) { if(setServerOn(true)) { saveAllPlayers(); } else { } } private void saveAllPlayers() { short[] pc = new short[2000]; for(int i = 0; i < pc.length; i++) try { Thread.sleep(600); System.out.println("Players Saved Success!"); } catch (InterruptedException e) { e.printStackTrace(); } } }
i disagree
i mean
Code:short[] pc = new short[2000]; for(int i = 0; i < pc.length; i++)wtf is thatCode:private static short[] loop = new short[1]; public static void main(String[] args) { for(int i = 0; i < loop.length; i++) try {
strong conventionsCode:public void HandlePlayerSaving(int i) {
i can't even decipher what your trying to do in this code, sleeps for 600ms then shuts down...
This is beautiful.
nice framework will use rep++
how use i get 100 errors help plzzzzzzzzzzz
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |