Thread: Server Already in Use

Results 1 to 8 of 8
  1. #1 Server Already in Use 
    Banned

    Join Date
    May 2008
    Posts
    2,327
    Thanks given
    55
    Thanks received
    67
    Rep Power
    0
    is it possible to make it so that if u have the server running on 43594 already

    then it trys to run it again, it cancles out the other 1 and runs off the new 1, as if it was a restart? :3

    anyone got any clues? rep++





    example:
    server is running 10 players online
    opens run.bat
    server with 10 players, everyone is logged out, and logged in on the new batch window thats opened


    understand?
    Reply With Quote  
     

  2. #2  
    iHax
    Guest
    Why couldn't you just use your own auto restarter?
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    May 2008
    Posts
    2,327
    Thanks given
    55
    Thanks received
    67
    Rep Power
    0
    thats not wat im asking about....
    i have a restarter running, but sometimes lots of ppl online, so when it restarts, it lags and ends up saying that the server already in use... so yah....
    Reply With Quote  
     

  4. #4  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    hmm make a timer so that it runs one of the batch files and that after like...60 minutes or whatever it closes and then opens another batch file like runserver.bat insted of run.bat and just make it so that if runserver is already in use then diconnect and use the other one. Just switch through them. Good idea though, i like it.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Alec_'s Avatar
    Join Date
    Aug 2009
    Posts
    274
    Thanks given
    3
    Thanks received
    9
    Rep Power
    111
    Impossible, a java program can't close the bat file running it, then open a new one.


    Quote Originally Posted by i say smd k View Post
    How about you stop flaming and understand the concept, my isp stops rsbot from working over here, when i go to my dad's house i bring my computer, and it works fine there, so..., if you have no fucking idea whats going on, and still talk shit, gtfo.
    Reply With Quote  
     

  6. #6  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    You've tried? Support your theory
    Reply With Quote  
     

  7. #7  
    Banned

    Join Date
    Mar 2009
    Age
    27
    Posts
    970
    Thanks given
    22
    Thanks received
    29
    Rep Power
    0
    Place this into notepad and save as Restart.bat

    Also rename you run batch file to Run.bat

    Code:
    @echo off
    @title Restart
    echo Closing server...
    killtask java.exe
    echo.
    ping 127.0.0.1 -n 15
    start Run.bat
    Reply With Quote  
     

  8. #8  
    Registered Member
    PSNB's Avatar
    Join Date
    Aug 2009
    Posts
    885
    Thanks given
    8
    Thanks received
    103
    Rep Power
    590
    Quote Originally Posted by Alec++ View Post
    Impossible, a java program can't close the bat file running it, then open a new one.
    Believe it or not, this is not the first time I've seen you comment on something you've not a clue about.

    This is definitely possible...

    -------------------------------------------------

    I can't quite recall exactly how to do it, but I know that you can execute an external file using
    Code:
    Runtime.getRuntime().exec("COMMAND LINE ARGUMENTS");
    As I said, I can't quite recall how you do it (A quick google search or two should help).

    What you're going to have to do is something like this

    Code:
    private static void restartServer() throws IOException {	
    		savePlayers(); //Save all connected players and disconnect them.
    		serverSocket.close(); //Close the ServerSocket (So it's no longer occupying the port).
    		Runtime.getRuntime().exec("COMMANDS"); //Start a new instance of the Server.
    		System.exit(0); //Close this program.
    	}
    Sorry I couldn't be of more help, I'm kind of busy working on other things at the moment, so I can't be arsed to do all of the research on my own. Sorry.
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •