[508][Tut - A] Monitoring

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    The next don TheAJ is offline
    DeveloperRank
    May 2007 Join Date
    Toronto, CanadaLocation
    3,946Posts

    [508][Tut - A] Monitoring

    This will restart your server is you have 0 players online.

    It is cached at start up and it is static, so it has a low priority towards lagg etc. It will monitor the server every 5 minutes to check the users online, if theres 0 users, it'll suspect that the server is crashed. And will restart

    When it restarts, aslong as your server machine is fast, it'll restart almost instantly after it's monitoration

    new class ( ../net/> Monitor.java )
    PHP Code:
    package palidino76.rs2.net;

    import palidino76.rs2.Engine
      
      public class 
    Monitor implements Runnable 
      
    /* Varibles */
           
    public static final boolean restart true
           public static final 
    int timer 120;
     
        public 
    Restarter() { 
     if(
    Engine.getPlayerCount() == 0) { 
               (new 
    Thread(this)).start(); 
     } 
        } 
      
        public 
    void run() { 
            try { 
                 
    Thread.sleep(timer 300000); 
                 } catch (
    Exception e) {} 
                 
    System.out.println("[SERVER] 0 Users online. The server has suspected a server Crash."); 
                 
    System.out.println("[SERVER] Server restarted."); 
               try { 
                    
    Thread.sleep(2000); 
                    } catch (
    Exception e) {} 
                  try {  
                       
    Thread.sleep(2000); 
                       } catch (
    Exception e) {} 
                     try { 
                          
    Thread.sleep(2000); 
                          } catch (
    Exception e) {} 
                          
    System.exit(0); 
     }  
        } 
    Change imports though


    In your Server.java 'main' method
    PHP Code:
        if (Minitor.restart) {
        new 
    Restarter();
        } 
    Add to run.bat under @echo off
    Code:
     cls
    and under the userver thing (palidino/server 43597)
    Code:
    goto main

    Add imports and done
    Last edited by GhostSnyper; 16-01-09 at 05:44 AM.


  2. #2
    right + down + X GhostSnyper is offline
    MemberRank
    May 2006 Join Date
    AZ, USALocation
    2,818Posts

    Re: [508] monitoring

    Smooth, AJ. Glad this was released :)

    To all who are unfamiliar with paladino's server, it has a tendency to error and kick all players out, even though the server doesn't fully crash. this addresses the issue, and restarts the server

  3. #3
    I am THE DON Joe9099 is offline
    MemberRank
    Jan 2007 Join Date
    England, UkLocation
    3,655Posts

    Re: [508] monitoring

    O_o finally something decent is released?

    After around 5 fucking months, nothing as good as this has actually been released in the RS section.
    I actually need this, ty

  4. #4
    The next don TheAJ is offline
    DeveloperRank
    May 2007 Join Date
    Toronto, CanadaLocation
    3,946Posts

    Re: [508] monitoring

    Sorry if something i messed up
    had to convert to palidino's framework

  5. #5
    I am THE DON Joe9099 is offline
    MemberRank
    Jan 2007 Join Date
    England, UkLocation
    3,655Posts

    Re: [508] monitoring

    packet palidino.rs2.net;

    yeh u guys are gonna have to change palidino.rs2 to palidino76.rs2 BECAUSE some of you havnt renamed most of your shit

  6. #6
    Apprentice Lakegatman is offline
    MemberRank
    Apr 2007 Join Date
    18Posts

    Re: [508] monitoring

    Very Nice!
    Thanks much!

  7. #7
    I am THE DON Joe9099 is offline
    MemberRank
    Jan 2007 Join Date
    England, UkLocation
    3,655Posts

    Re: [508][Tut - A] Monitoring

    2 Errors o_o

    .\palidino76\rs2\net\Monitor.java:10: invalid method declaration; return type re
    quired
    public Restarter() {
    ^
    .\palidino76\rs2\Server.java:56: cannot find symbol
    symbol : class Restarter
    location: class palidino76.rs2.Server
    new Restarter();
    ^

  8. #8
    There's no RL just AFK -fedexer- is offline
    MemberRank
    May 2006 Join Date
    ScotlandLocation
    1,632Posts

    Re: [508][Tut - A] Monitoring

    that's caused because it seems you have a class file called monitor, but for some reason it's then known as restarter, and this is causing problems, change public restarter to monitor, and same with the new restarter.

  9. #9
    ThuGie.NL - Webmaster ThuGie is offline
    MemberRank
    Apr 2006 Join Date
    NetherlandsLocation
    1,131Posts

    Re: [508][Tut - A] Monitoring

    Just wondering,
    If the server just started,
    The usercount will be 0,

    So if nobody logs in within 5min wont it restart ?
    So shouldnt you like set a boolean if the server has accepted at least 1 connection ?

  10. #10
    I am THE DON Joe9099 is offline
    MemberRank
    Jan 2007 Join Date
    England, UkLocation
    3,655Posts

    Re: [508][Tut - A] Monitoring

    Thanks fedex, worked great.

  11. #11
    The next don TheAJ is offline
    DeveloperRank
    May 2007 Join Date
    Toronto, CanadaLocation
    3,946Posts

    Re: [508][Tut - A] Monitoring

    Quote Originally Posted by ThuGie View Post
    Just wondering,
    If the server just started,
    The usercount will be 0,

    So if nobody logs in within 5min wont it restart ?
    So shouldnt you like set a boolean if the server has accepted at least 1 connection ?
    Why would it matter?
    Restart process is instant, so really no point, if user isn't login in 5 minutes after start, and server restarts theres really no harm for the player, as hes not logged in, and since restart is instant, if a player is connecting to the server he'll still be able to

  12. #12
    ThuGie.NL - Webmaster ThuGie is offline
    MemberRank
    Apr 2006 Join Date
    NetherlandsLocation
    1,131Posts

    Re: [508][Tut - A] Monitoring

    Yeah i understand that restarting it doesnt take alot of time,
    But still normaly you wouldnt want your server to restart 6 times in 30minutes.

    Just because nobody is connected to it,
    And as a simple boolean could probably fix this problem,
    I dont see a reason why not to add it.

  13. #13
    I am THE DON Joe9099 is offline
    MemberRank
    Jan 2007 Join Date
    England, UkLocation
    3,655Posts

    Re: [508][Tut - A] Monitoring

    Quote Originally Posted by ThuGie View Post
    Yeah i understand that restarting it doesnt take alot of time,
    But still normaly you wouldnt want your server to restart 6 times in 30minutes.

    Just because nobody is connected to it,
    And as a simple boolean could probably fix this problem,
    I dont see a reason why not to add it.
    I dont see a reason why it should be added..
    Whats the difference going to make if no one is online?
    If its a instant restart, and i didnt even know it had restarted, why wud i care?

    Humm, i know what ur saying, but its not needed...

  14. #14
    Novice Mainhyipcom is offline
    MemberRank
    Dec 2009 Join Date
    1Posts

    Welcome to Mainhyip.com Monitor Site

    Welcome to Mainhyip.com Monitor Site

    http://www.mainhyip.com

    WE PAY YOU BACK UP TO 130% REFERRAL COMMISSION FOR LIFE (For example, if you upgraded $1000 in a program and the referral commission is 5% ($50), we will give you $65 if you signup thru our links.)
    We have the best hyip monitoring system to provide you the fastest and the most reliable information about high yield investments programs. We do not endorse or own any of listed programs. Before investing, you should thoroughly study and understand the information provided by programs owner. Always remember: do not spend what you cannot afford to lose.

    You can ask: why your monitoring better than others, why we have to trust you? We answer: our monitoring
    Mainhyip.com successfully working on this market from 2007 year - for this time we accumulate great
    experience and make original and practical script. We are take care of our reputation and don't squander
    talents on trifles. We are paying to our referrals up to 150 of our ref. commission. We were one of first at
    all territory of ex-USSR and we can talk with confidence, that we become best. Professionals working with us -
    join as well!

    Mainhyip monitor will help you to secure yourself and to find a worthy partner. They provide full and updated hyip list. However, you should be competent in choosing hyip monitors. Links to funds provided by monitors shall not be referral links. Otherwise, you will never get impartial assessment. This is when a monitor can become your friend and investment can be a good profit source!

  15. #15

    Adriana Lima Megan Fox on youtube

    [nomedia]http://www.youtube.com/watch?v=r9lz7zQRp0I[/nomedia]
    HEHE you should see this on youtube
    Leaked private tapes with adriana lima and megan fox



Page 1 of 2 12 LastLast

Advertisement