Jump to content

flygun

Former Staff
  • Posts

    729
  • Joined

  • Last visited

  • Days Won

    7
  • Feedback

    0%

Everything posted by flygun

  1. very nice one question ... open source ??
  2. hello guys i wrote this script to help using makepack import glob, os , shutil, sys from os import path , system executefile = "execute.cmd" logfolder = "logs" packfile = "D:\Husam\Client\pack/" packedfolder = "packed/" text = ".txt" ivfilename = "" type = "" comptype = "" file_list = [] def yes_no(question, default="yes"): valid = {"yes": True, "y": True, "ye": True, "no": False, "n": False} if default is None: prompt = " [y/n] " elif default == "yes": prompt = " [Y/n] " elif default == "no": prompt = " [y/N] " else: raise ValueError("invalid default answer: '%s'" % default) sys.stdout.write(question + prompt) choice = raw_input().lower() if default is not None and choice == '': return valid[default] if choice in valid: return valid[choice] else: sys.stdout.write("Please respond with 'yes' or 'no' ", "(or 'y' or 'n').\n") def get_size(dirname): total_size = 0 for dirpath, dirnames, filenames in os.walk(dirname): for f in filenames: fp = os.path.join(dirpath, f) total_size += os.path.getsize(fp) return total_size def createpack(filename, dirname): if get_size(dirname) == 0: print("This is an empty folder [%s]"% (dirname)) exit() print("Please Chose the type of pack you want to create\n") print("1:CompressExtNameList --> type 1") print("2:SecurityExtNameList --> type 2") print("3:panamaextnamelist --> type 3") print("4:cshybridencryptexenamelist --> type 4\n") type = raw_input("Your Choice:") type = int(type) if type < 0 or type > 4: print ("Please Type one number Bettwen 1 - 5") if type == 1: comptype = "CompressExtNameList"; if type == 2: comptype = "SecurityExtNameList"; if type == 3: comptype = "panamaextnamelist"; if type == 4: comptype = "cshybridencryptexenamelist"; makeit = filename + text check(makeit,1,"no") x = open(makeit, 'w') x.write("FolderName\t\"%s\"\nPackName\t\"%s\"\n"% (packedfolder, filename)) if type == 3: pack = os.path.join(packfile,filename) check(pack,0,"yes") x.write("IV\t\"%s\"\n"% (pack)) x.write("\nList\t%s\n{\n" % (comptype)) chkdict = {} setdef = chkdict.setdefault for root, dirs, files in os.walk(dirname): for file in files: ext = path.splitext(file)[1] if not ext in chkdict: x.write("\t\"%s\"\n" % setdef(ext,ext)) del chkdict x.write("}\n") x.write("\nList\tFilelist\n{\n") for root, dirs, files in os.walk(dirname): for filesname in files : filepath = os.path.join(root,filesname) if os.stat(filepath).st_size==0: continue x.write("\t\"%s\"\n" %(filepath)) x.write("}\n") def extract_writer(type, iv): global ivfilename , file_list check("",0,"no") if not os.listdir(packfile): print("Error: %s folder is empty \nsystem will close the script now"%(packfile)) system("pause")# this is an optinal command if you want to see what is going on return listofpacks() pack = raw_input("Pack Number:") pack = int(pack) file = file_list[pack] index = file + ".eix" y = check(index,0,"no") if y == True: file2 = os.path.join(packfile,file) if iv == True: ivfilename = file2 x = open(executefile, 'a') #open extract.cmd x.write("MakePack.exe --%s %s %s\t> logs/%s_log.txt\t 2> logs/%s_error.txt\n" % (type,file2, ivfilename, file, file)) print("MakePack.exe --%s %s %s\n" % (type,file2, ivfilename)) #show you on screen what are the file else: return x.close() executeMakePackfiles(executefile) def check(filename,remove,IVa="no"): if filename == "" and remove == 0: if os.path.isfile(executefile): os.remove(executefile) if not os.path.isdir(logfolder): os.system("mkdir %s" % (logfolder)) if not os.path.isdir(packfile): os.system("mkdir pack") return True elif os.path.splitext(filename)[1] == ".eix": filename = os.path.join(packfile,filename) if os.path.isfile(filename): return True print("[%s] Is missing"%(filename)) return False if filename != "": if os.path.isfile(filename) or os.path.isdir(filename): if remove == 1: os.remove(filename) if IVa == "yes": os.system("MakePack.exe --createiv %s"%(filename)) #run extract.cmd to execute the commands def executeMakePackfiles(filename): answer = yes_no("Do you Want to run %s?" %(filename),"yes") if True == answer: if filename == executefile: os.system(executefile) else: os.system("MakePack.exe %s" %(filename)) else: system("pause")# this is an optinal command if you want to see what is going on main() def listofpacks(): global file_list i = 0 file_count = len(glob.glob("%s*.epk"%(packfile))) for file in glob.glob("%s*.epk"%(packfile)): #search for any file with the (.epk) extention file = path.basename(file) file = path.splitext(file)[0] #removeing extention [xxx.epk ---> xxx (without (.epk))] file_list.append(file) # while i < file_count: filo = file_list[i] filo = ("%d:%s" % (i,filo)) print filo i += 1 def cls(): os.system("cls") def main(): print ("Hello This is Make Pack pythn tool") print ("type the number of the command you want to execute") print ("1:Create-iv\n2:Open-iv\n3:Extract\n4:Extract With Iv\n5:Make Pack\n6:Exit") choice = raw_input("Your Choice:") choice = int(choice) if choice < 1 or choice > 6: print ("Please Type one number Bettwen 1 - 6") if choice >= 1 and choice <= 4: if choice == 1: executetype = "createiv" iv = bool(False) elif choice == 2: executetype = "openiv" iv = bool(False) elif choice == 3: executetype = "extract" iv = bool(False) elif choice == 4: executetype = "extract" iv = bool(True) cls() extract_writer(executetype, iv) if choice == 5: packname = raw_input("Pack Name:") path = raw_input("Path:") createpack(packname,path) packname2 = packname + text executeMakePackfiles(packname2) system("pause")# this is an optinal command if you want to see what is going on main() if choice == 6: exit() main() now I'm not a python expert so if any expert here can tell me some notes on how to write better code it would very nice plus if any one want my version of make pack just tell me to upload it now my only problem here is that thae script writes only one type of compressing types using by the binary i you can't use the script to write something like this fro example YET List SecurityExtNameList { ".dds" ".tga" ".jpg" } List Panamaextnamelist { ".msenv" ".sub" } but anyway the script generates something look like this FolderName "packed" PackName "etc" List SecurityExtNameList { ".msenv" ".dds" ".tga" ".sub" ".jpg" } List Filelist { "ymir work\environment\a1.msenv" "....." } #Updated with IV file check for panama type .. thanks to metin2team for noticing the mistake #updated with file size check ... ---> make pack wont pack 0 sized file so the script ignores the 0 file #updated ... now after any command you do the script restarts from the beginning ...because the python window closes after the code is done #update --> now you can specify the pack
  3. i use GCC (much much better) but i think he don't want to use the solution .. so ... plus he is using 10.1 freebsd which i think that clang is the default c compiler
  4. the build-in GCC compiler (i think 4.x) uses '-mcpu' Flag but GCC 48+ uses '-mtune' or '-march' Flags but i don't know why he is using GCC he can use Clang
  5. open makefile in libpoly folderr and change -mcpu=i686 with this -mtune=i686
  6. hello guys ... i'm asking if there is a function which generate the index content at the moment i'm using MakePack (own compiled) with some python scripts to help me but my point is i've created a new function in makepack project... i called it "MakePackFile" to be more specific void MakePackFile(const char * filename, int type) { if (type < COMPRESSED_TYPE_COMPRESS || type > COMPRESSED_TYPE_HYBRIDCRYPT) type = COMPRESSED_TYPE_SECURITY; const char* comptype; if (type == 1) comptype = "CompressExtNameList"; if (type == 2) comptype = "SecurityExtNameList"; if (type == 3) comptype = "panamaextnamelist"; if (type == 4) comptype = "cshybridencryptexenamelist"; boost::filesystem::path p(filename); string extension = ".txt"; std::string path = p.stem().string(); ofstream myfile((path + extension).c_str()); myfile << "FolderName\t\"packed\"\n"; myfile << "PackName\t" << p.stem() << "\n"; myfile << "\nList\t" << comptype << "\n{\n"; myfile << "\t\"" << "\"\n"; // <--- type all extinsion included in thje pack myfile << "}\n\n"; myfile << "\nList\tFilelist\n{\n"; myfile << "\t\"" << "\"\n"; myfile << "}\n"; myfile << "List\tFileList\n{\n"; myfile << "\t\"" << "\"\n";// <--- type file name .. try to take it from "CEterPack::Extract()" function } now my goal is to check the type of the pack and send it to this function like this else if (!strcmp(argv[1], "--extract")) { // .exe --extract <packname> [<IV filename>] if (argc < 3) { printf("Usage: %s --extract <packname> [<IV filename>]\n", argv[0]); return 1; } CMappedFile file; const BYTE* iv = NULL; if (argc >= 4) { if (!file.Create(argv[3], (const void**)&iv, 0, 32)) { printf("Cannot load IV file %s\n", argv[3]); return 1; } } CEterPack pack; CEterFileDict dict; if (pack.Create(dict, argv[2], "", true, iv)) { pack.Extract(); MakePackFile(argv[2], X);//argv[2] = name of the pack //x = type of pack return 0; } printf("Cannot extract pack %s\n", argv[2]); return 1; }
  7. enter ps ... and see if the server is working and enter the game
  8. lol this error appears when a core or channel turns off ... he got 6 errors that means 6 cores closed at the same time
  9. you get this error before or after turning off the channels ?
  10. because int rang is from –2,147,483,648 to 2,147,483,647 and unsigned int is from 0 to 4,294,967,295 so you wont get exp in minus
  11. OMG i'm soo stupid ... i forgot that this topic i about infinity arrows i just saw night's comment so it can be written like this void CHARACTER::UseArrow(LPITEM pkArrow, DWORD dwArrowCount) { DWORD dwVnum = pkArrow->GetVnum(); }
  12. btw this : if (iCount == 0) { LPITEM pkNewArrow = FindSpecifyItem(dwVnum); sys_log(0, "UseArrow : FindSpecifyItem %u %p", dwVnum, get_pointer(pkNewArrow)); if (pkNewArrow) EquipItem(pkNewArrow); } is basicly mmmmmmm useless yeah it/s useless but this is not useless if (pkNewArrow) EquipItem(pkNewArrow); it'll attach new group of arrows when the first count to 0 so it can be written like this void CHARACTER::UseArrow(LPITEM pkArrow, DWORD dwArrowCount) { int iCount = pkArrow->GetCount(); DWORD dwVnum = pkArrow->GetVnum(); LPITEM pkNewArrow = FindSpecifyItem(dwVnum); if (iCount == 0) if (pkNewArrow) EquipItem(pkNewArrow); }
  13. open "char_battle.cpp" from game folder in server source and search for void CHARACTER::UseArrow(LPITEM pkArrow, DWORD dwArrowCount) it'll be like this void CHARACTER::UseArrow(LPITEM pkArrow, DWORD dwArrowCount) { int iCount = pkArrow->GetCount(); DWORD dwVnum = pkArrow->GetVnum(); iCount = iCount - MIN(iCount, dwArrowCount); pkArrow->SetCount(iCount); if (iCount == 0) { LPITEM pkNewArrow = FindSpecifyItem(dwVnum); sys_log(0, "UseArrow : FindSpecifyItem %u %p", dwVnum, get_pointer(pkNewArrow)); if (pkNewArrow) EquipItem(pkNewArrow); } } make it look like this void CHARACTER::UseArrow(LPITEM pkArrow, DWORD dwArrowCount) { int iCount = pkArrow->GetCount(); DWORD dwVnum = pkArrow->GetVnum(); if (iCount == 0) { LPITEM pkNewArrow = FindSpecifyItem(dwVnum); sys_log(0, "UseArrow : FindSpecifyItem %u %p", dwVnum, get_pointer(pkNewArrow)); if (pkNewArrow) EquipItem(pkNewArrow); } }
  14. Hidden Content i know how to do it but for people who doesn't know
  15. nice idea ... but like this you can't attach the horse with any of this effects .
  16. and attack must be with A not with space ... my point it's doesn't matter P ~ Q ~ R ... or whatever
  17. <project> property page --> Linker --> advance ->>>>search for "Image Has safe exception handlers" and change it to No (/SAFESEH:NO)
×
×
  • 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.