summaryrefslogblamecommitdiff
path: root/npc/functions/clientversion.txt
blob: 6fb7d012c851fbe2d96f279d7742e79f48fba30e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
               


                  
               

                                                                        
                                                               

                                                 



                                    

                                                         






                                                                                                        




















                                                                                                                                                     
                                                                                                                                                                                                                                                 




                                                               
     



                                                                                                       
 
                                    

                    

                           

                                                        
                                                                                                       
         

                                                                                           
         

                                      

           
// TMW2 Scripts
// Evol functions.
// Author:
//    4144
//    Jesusalva
// Description:
//    Function checking the client version and reports if it is too old.
//    This also handles all updates, and usually have priority.

function	script	checkclientversion	{
    // Skip any update for newcomers
    if (isin("000-0", 0, 0, 40, 40))
        UPDATE=gettimetick(2);

    // Update handler (use `date +%s` for this)
    // Current UPDATE value: Qui Jun  7 08:10:55 -03 2018
    if (Lang > 5 && UPDATE < 1528369855) {
        UPDATE=gettimetick(2);
        Lang=0;
        mesn "Jesus Saves";
        mes col("Oh, noes! Due lack of translators, some languages were removed from this project.", 9);
        mes col("You might have been affected. Please, select your desired language.", 9);
        asklanguage(LANG_IN_SHIP);
        if (!#ADD_LVL)
            close;
    }
    // #ADD_LVL means the user have to right to get some levels. This is a sketch. The code might be deleted.
    if (#ADD_LVL) {
        mesn "Jesus Saves";
        mes col("Oh - Welcome to TMW2: Moubootaur Legends!", 3);
        next;
        mesn "Jesus Saves";
        mes col("Please, fell at home. You can use ##B#world##b channel to speak to everyone on Discord, IRC and ingame.", 3);
        next;
        mesn "Jesus Saves";
        mes col("Our mission statement is to bring fun to all players. You'll get some levels automatically. We advise you to join a guild.", 3);
        next;
        mesn "Jesus Saves";
        mes col("If you have any trouble or doubt, don't hesit to call us. There are some cooperative quests, and more of them are being added.", 3);
        next;
        mesn "Jesus Saves";
        mes col("Anyway, ##Bwelcome##b, and have fun! If you need anything, we are a keypress from distance!", 3);
        atcommand "@blvl "+#ADD_LVL;
        #ADD_LVL=0;
        rodex_sendmail(getcharid(0), "TMW2 Team", "Welcome to Moubootaur Legends", "Hey, thanks for believing on us! We hope to have a great time togheter. Any problem, ask for help in #world - the Discord bridge! And take this change!", 20)
        if (ClientVersion >= 24) close;
        next;
        mesn "Failsafe Mechanism";
        mes col("Ah... You must update your client first.", 1);
        next;
    }
    if (is_admin() && UPDATE < 1528369855) {
        UPDATE=gettimetick(2); // Perhaps we should use above number, and leave all UPDATE fields here?
        dispbottom l("Client Version: @@", ClientVersion); // This is to debug UPDATE system.
    }

    if (ClientVersion >= 24) return;

    mesn "Narrator";
    mes col("Warning.", 1);
    mes col("Warning.", 1);
    mes col("Warning: You are using an old client.", 9);
    next;
    mes col("Please install the new client from [@@https://manaplus.org/|https://manaplus.org/@@]", 9);
    next;
    if (ClientVersion >= 22) return;
    mes col("You won't be allowed to play this game until you have an updated client.", 9);
    next;
    // Force user to disconnect
    atcommand "@kick "+strcharinfo(0);
    return;
}