Thread: will this work

Results 1 to 9 of 9
  1. #1 will this work 
    Banned
    Join Date
    Feb 2012
    Posts
    584
    Thanks given
    0
    Thanks received
    13
    Rep Power
    0
    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();
    	}
    			
    		
    	}
    }
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    q.q


    Join Date
    Dec 2010
    Posts
    6,519
    Thanks given
    1,072
    Thanks received
    3,535
    Rep Power
    4752
    Quote Originally Posted by Flavorless Fab View Post
    so my knowledge in java is fluent
    i disagree

    i mean

    Code:
    short[] pc = new short[2000];
    		for(int i = 0; i < pc.length; i++)
    Code:
    private static short[] loop = new short[1];
    	
    	public static void main(String[] args) {
    		for(int i = 0; i < loop.length; i++)
    			try {
    wtf is that

    Code:
    public void HandlePlayerSaving(int i) {
    strong conventions

    i can't even decipher what your trying to do in this code, sleeps for 600ms then shuts down...
    Reply With Quote  
     

  4. Thankful user:


  5. #3  
    plz dont take my wizard mind bombs Women's Avatar
    Join Date
    Mar 2010
    Posts
    1,881
    Thanks given
    724
    Thanks received
    1,162
    Rep Power
    4763
    yes that will work gj
    Reply With Quote  
     

  6. Thankful user:


  7. #4  
    Apocalyptism
    Harry's Avatar
    Join Date
    Apr 2007
    Posts
    3,783
    Thanks given
    594
    Thanks received
    1,834
    Rep Power
    2934
    This is beautiful.
    ~ Harry
    Please bear this in mind when hearing the word 'soon' from a software programmer.

    As coding software generally takes thousands of years, software programmers have developed a natural adaptation to this in the form of an altered perception of the flow of time.

    Due to this, the word 'soon' when uttered by a programmer should be taken to mean 'a very, very long time from now' in the terminology used by common human specimens who have not developed such an adaptation.
    knowledge can be taught, but passion cannot.
    It's better to create something that others criticise than to create nothing and criticise others.
    Attached image
    Reply With Quote  
     

  8. Thankful user:


  9. #5  
    Banned
    Join Date
    Feb 2012
    Posts
    584
    Thanks given
    0
    Thanks received
    13
    Rep Power
    0
    Quote Originally Posted by Harry View Post
    This is beautiful.
    i cant tell if you're trolling, or being serious.
    Reply With Quote  
     

  10. Thankful user:


  11. #6  
    plz dont take my wizard mind bombs Women's Avatar
    Join Date
    Mar 2010
    Posts
    1,881
    Thanks given
    724
    Thanks received
    1,162
    Rep Power
    4763
    Quote Originally Posted by Flavorless Fab View Post
    i cant tell if you're trolling, or being serious.
    i was being serious
    Reply With Quote  
     

  12. #7  
    Registered Member
    danimals br0's Avatar
    Join Date
    Aug 2010
    Posts
    885
    Thanks given
    64
    Thanks received
    94
    Rep Power
    109
    Quote Originally Posted by Flavorless Fab View Post
    so my knowledge in java is fluent
    Sorry but i agree with harlan, kept practising and messing with some other stuff, cause you are still not ready for this.
    Reply With Quote  
     

  13. #8  
    only shallow

    Join Date
    Apr 2011
    Age
    26
    Posts
    1
    Thanks given
    2,907
    Thanks received
    413
    Rep Power
    0
    nice framework will use rep++
    Reply With Quote  
     

  14. #9  
    Member
    Join Date
    Jun 2013
    Posts
    31
    Thanks given
    1
    Thanks received
    9
    Rep Power
    0
    how use i get 100 errors help plzzzzzzzzzzz
    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. Will this work?
    By Fredo Santana in forum Help
    Replies: 0
    Last Post: 04-29-2013, 03:46 AM
  2. Will this work?
    By Fredo Santana in forum Help
    Replies: 0
    Last Post: 04-29-2013, 03:45 AM
  3. Will this work?
    By DesolaceRSPS in forum Help
    Replies: 16
    Last Post: 03-21-2013, 10:32 PM
  4. will this work?
    By Idk How To Code in forum Help
    Replies: 4
    Last Post: 01-06-2012, 05:12 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •