Jump to content

FreeWar_official

Inactive Member
  • Posts

    14
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by FreeWar_official

  1. M2 Download Center

    This is the hidden content, please
    ( Internal )

    Hello community and happy new year!!

     

    I will release a panel written to waste of time that will allow you to start, turn off, perform backups, compile quests or clean the syserr in a very fast and all in one interface and thus eliminating the classic bash file " start.sh, close.sh etc ...!

    I wrote the script very "easy" to be understandable for anyone who has a minimum of Python knowledge and also I put the most important variables immediately after import!

    The script works on Python 2.7 with FreeBSD 9.7 machine.

    Well make good use 

     

    ##FreeWar Panel
    import os
    import subprocess
    import time
    
    TO_DELETE = ["syserr", "syslog", "cartof.core", "db.core"]
    CORE_NAME = "cartof"
    BACKUP_PATH = "/usr/game/backup"
    SERVER_PATH = "/usr/game/server/"
    LOCALE_SERVICE_QUESTS = "/usr/game/share/locale/romania/quest"
    
    def main():
        print('''
    \033[1;32;40m___________                     __      __               
    \_   _____/______   ____   ____/  \    /  \_____ _______ 
     |    __) \_  __ \_/ __ \_/ __ \   \/\/   /\__  \\_  __  \ 
     |     \   |  | \/\  ___/\  ___/\        /  / __ \|  | \/
     \___  /   |__|    \___  >\___  >\__/\__/  (____  /__|   
         \/                \/     \/  \/  \/       
             __________                      .__             
             \______   \_____    ____   ____ |  |            
              |     ___/\__  \  /    \_/ __ \|  |            
              |    |     / __ \|   |  \  ___/|  |__          
              |____|    (____  /___|  /\___  >____/          
                     \/     \/     \/ 
    Press Key:
    1) Start Server
    2) Close Server
    3) Clean SYSERR, SYSLOG, CoreDump
    4) Compile all or one quest
    5) Backup Server
    0) Close        
    \033[0;37;40m             
        ''')
    
        while True:
            a = raw_input("Value between 0 and 5:")
            try:
               a = int(a)
            except ValueError:
               print "Valid number, please"
               continue
            if 0 <= a <= 5:
               break
            else:
               print "Valid range, please: 0-5"
           
        if a == 1:
            print("\033[1;36;40mPlease enter number of CH(1-4): \033[0;37;40m")
            while True:
                chn = raw_input("Digit 0 to break start operation! ")
                try:
                   chn = int(chn)
                except ValueError:
                   print "Valid number, please"
                   continue
                if 0 <= chn <= 4:
                   break
                else:
                   print "Valid range, please: 0-4"
                   
                   
            if chn == 0:
                return
            os.chdir(SERVER_PATH + "db_auth/db")
            subprocess.Popen("./db")
            time.sleep(2)
            os.chdir(SERVER_PATH + "db_auth/auth")
            subprocess.Popen("./auth")
            time.sleep(2)
            for x in range(1, (chn + 1)):
                folderlink = (SERVER_PATH + "ch" + str(chn))
                for y in range(1, 5):
                    os.chdir(folderlink + "/core_" + str(y))
                    subprocess.Popen("./core_" + str(y))
                    time.sleep(2)
    
            print("\033[1;32;40m ++Server Online++ \033[0;37;40m")
            return
            
        elif a == 2:
            Alive = ""
            ps = subprocess.Popen("pgrep " + CORE_NAME, shell=True, stdout=subprocess.PIPE)
            Alive = ps.stdout.read()
            ps.stdout.close()
            ps.wait()
            if len(Alive) > 0:
                subprocess.Popen("pkill " + CORE_NAME, shell=True, stdout=subprocess.PIPE)
                print("Metin2 server closed!")
            
            elif len(Alive) == 0:
                print("Metin2 Server is already Offline!")
            return
            
        elif a == 3:
            for x in range(0, len(TO_DELETE)):
                print "Deleting " + TO_DELETE[x]
                ps = subprocess.Popen("find . -name " + TO_DELETE[x] + " -delete", shell=True, stdout=subprocess.PIPE)
            print("Clean!1")
        
        elif a == 4:
            print("Digit the name of the quest or digit 'ALL' to compile all quests: ")
            name = raw_input()
            os.chdir(LOCALE_SERVICE_QUESTS)
            if name == "ALL":
                os.system("for f in *.quest; do ./qc $f; done")
                os.system("for f in *.lua; do ./qc $f; done")
            else:
                os.system("./qc " + name)
                
        elif a == 5:
            from datetime import datetime
            Time = str(datetime.now())
            print "Backup on the way..."
            if not os.path.exists(BACKUP_PATH):
                os.makedirs(BACKUP_PATH)
            os.chdir(BACKUP_PATH)
            os.makedirs(Time)
            os.chdir(Time)
            os.system("tar cfzv GAME_" + Time + ".tar.gz /usr/game")
            os.system("tar cfzv MySQL_" + Time +".tar.gz /var/db/mysql")
            
            
        elif a == 0:
            os.system("clear")
            return
            
        
        time.sleep(1)
        main()
            
    main()

     

    • Metin2 Dev 1
    • Smile Tear 1
    • Love 2
  2. Hello everyone! I'm working on source to change the python lib from 2.2 to 3.7.1!
    Now i have changed every single deprecated function and checked if the function return the same result and until now everything is ok!

    Now i can't understand why visual studio give me the external symbol error. This is 1 of 40 errors:

    GameLib.lib(MapOutdoor.obj) : error LNK2001: unresolved external symbol "public: void __thiscall CScreenFilter::SetBlendType(char,char)" (?SetBlendType@CScreenFilter@@QAEXDD@Z)
    

     

    and this is where the function is called

    m_ScreenFilter.SetBlendType((char)mc_pEnvironmentData->byFilteringAlphaSrc, (char)mc_pEnvironmentData->byFilteringAlphaDest);

     

    anyone have idea about this problem?

  3. 4 hours ago, Exygo said:

    I had a case when a player couldn't start the client because on his laptop he didn't have 800x600 resolution as minimum, he had something like 1360x1024.

    So as I said above, the best solution is to remove it completely.

    If you change the size from metin2.cfg and put a invalid size metin2 can go outside of display or cause crash for you pc "If it is old"! 
    With this method we check if the resolution of metin2.cfg exist in our resolutions!

     

  4. 2 hours ago, Cyber36 said:

    Yeah anyways, he just showed how to "fix" this issue. But you have to care about the resolutions, which your config.exe allows. For ex. if you set it to 1360x700 and your system doesn't have this resolution you will get the error anyways, becore he trys to create the client with this "set".

     

    I guess YMIR just wanted to check the "minimum resolution" to play metin2, because anything under this resolution looks terrible :D

    Exactly!

    Ymir looking for 800 x 600 for the best graphics details!

    • Love 1
  5. How many people found this error on pserver or Official Metin2? With Windows >= 8 we found this problem and we have fixed with the compatibility checker but this is not the best way!

    The real problem is this string on the source of client

    EterLib/GrpDevice.cpp

    if (!ms_kD3DDetector.Find(800, 600, 32, TRUE, &ms_iD3DModeInfo, &ms_iD3DDevInfo, &ms_iD3DAdapterInfo))

     The application go to find the default resolution "800x600" but this is not the correct way! With new generation some computer have deleted the 800x600 resolution and this cause problems!

    to solve this we change previous line with this:

    if (!ms_kD3DDetector.Find(iHres, iVres, 32, TRUE, &ms_iD3DModeInfo, &ms_iD3DDevInfo, &ms_iD3DAdapterInfo))

    We force the application to find the resolution we have set up with config.exe "I remind you that config.exe get the possible resolutions automatically"!

    With this method the application always start without problem and compatibility setting.

     

    And if you have a Metin2 Official?

    if you have intel chip with the intel control panel you can add personal resolution

    if not you can add the resolution with edit some things in the registry but i not suggest it if you not know how registry work!

     

    Hope can i help someone!

    • Love 5
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.