xXCapConXx 6 Posted April 17, 2014 Share Posted April 17, 2014 Hello, I hope i'm in the right section. I want to use python2.7 in my binary, but how can i do this? Can someone make a tutorial please? And also i want to use is "RootLib", i hope someone can make a tutorial. sorry for my bad english Regards xXCapConXx 1 Link to comment Share on other sites More sharing options...
Premium Solution Sanchez 2467 Posted April 17, 2014 Premium Solution Share Posted April 17, 2014 1. Overwrite the Python 2.2 files with these 2.7 files: This is the hidden content, please Sign In or Sign Up 2. Open UserInterface.cpp and change #pragma comment( lib, "python22.lib" ) to #pragma comment( lib, "python27.lib" )3. Use CTOA in the client: http://metin2dev.org/board/topic/459-problem-with-clientbinary/?p=3526 7 Link to comment Share on other sites More sharing options...
xXCapConXx 6 Posted April 17, 2014 Author Share Posted April 17, 2014 1. Overwrite the Python 2.2 files with these 2.7 files: This is the hidden content, please Sign In or Sign Up 2. Open UserInterface.cpp and change #pragma comment( lib, "python22.lib" ) to #pragma comment( lib, "python27.lib" ) 3. Use CTOA in the client: http://metin2dev.org/board/topic/459-problem-with-clientbinary/?p=3526 Thank you! I'll try it now! Link to comment Share on other sites More sharing options...
xXCapConXx 6 Posted April 17, 2014 Author Share Posted April 17, 2014 Not work. Binary create is successfully, the binary starts but its close after 1 second and the syserr.txt is clear... Link to comment Share on other sites More sharing options...
Premium Sanchez 2467 Posted April 17, 2014 Premium Share Posted April 17, 2014 Try to use these files: This is the hidden content, please Sign In or Sign Up Link to comment Share on other sites More sharing options...
xXCapConXx 6 Posted April 17, 2014 Author Share Posted April 17, 2014 Try to use these files: This is the hidden content, please Sign In or Sign Up Not work... Traceback Error (Nothing else, the text is only "Traceback:".) Sorry for bad english. Link to comment Share on other sites More sharing options...
Premium Sanchez 2467 Posted April 17, 2014 Premium Share Posted April 17, 2014 Which line do you use? Try out with this lib: https://mega.co.nz/#!Dct1zS5Q!znpHfK5WC4iBl3Nv-TbWWKVCSzdJIRJ4749g76NVe-Q Link to comment Share on other sites More sharing options...
xXCapConXx 6 Posted April 17, 2014 Author Share Posted April 17, 2014 Which line do you use? Try out with this lib: https://mega.co.nz/#!Dct1zS5Q!znpHfK5WC4iBl3Nv-TbWWKVCSzdJIRJ4749g76NVe-Q I'm using standard the devline but i testet it with this and novaline, not works with both. I think i do something wrong in the python files (0xff)... Can you send me working python files? Or the problem is, i using the 2008 Client... I'll try the libs. Link to comment Share on other sites More sharing options...
Premium Sanchez 2467 Posted April 17, 2014 Premium Share Posted April 17, 2014 2008 client? Sure it doesn't work...Use the newest files or use this client: http://metin2dev.org/board/topic/136-40250-test-client/ Link to comment Share on other sites More sharing options...
xXCapConXx 6 Posted April 17, 2014 Author Share Posted April 17, 2014 2008 client? Sure it doesn't work...Use the newest files or use this client: http://metin2dev.org/board/topic/136-40250-test-client/ I have also the Devclient and working 2014 Germany client, but i hate the Dev Client and with the Germany Client few things not work. Can you send me working root, uiscript and locale Python files for the 40250 Dev Client? Please. Link to comment Share on other sites More sharing options...
xXCapConXx 6 Posted April 17, 2014 Author Share Posted April 17, 2014 Ok i've try it with the Dev client and the Client opens and close it after 1 second. Syserr.txt is clear but the ErrorLog.txt contains this: Module Name: C:UsersAdministratorDownloadsMetin2Clientmetin2client.exe Time Stamp: 0x535002bd - (null) Exception Type: 0xc0000005 eax: 0x00000000 ebx: 0x00000000 ecx: 0x002de1a0 edx: 0x00000000 esi: 0x045162d8 edi: 0x01422190 ebp: 0x002de1cc esp: 0x002de084 0x0144ef1d C:UsersAdministratorDownloadsMetin2Clientmetin2client.exe 0x0144e6fb C:UsersAdministratorDownloadsMetin2Clientmetin2client.exe 0x0144ddd5 C:UsersAdministratorDownloadsMetin2Clientmetin2client.exe 0x0144db49 C:UsersAdministratorDownloadsMetin2Clientmetin2client.exe 0x014221d2 C:UsersAdministratorDownloadsMetin2Clientmetin2client.exe 0x1e0a87b7 C:UsersAdministratorDownloadsMetin2Clientpython27.dll Link to comment Share on other sites More sharing options...
Premium Sanchez 2467 Posted April 17, 2014 Premium Share Posted April 17, 2014 I don't really have idea. It works properly for me with novaline binary. Link to comment Share on other sites More sharing options...
xXCapConXx 6 Posted April 17, 2014 Author Share Posted April 17, 2014 I don't really have idea. It works properly for me with novaline binary. I've think my python files are wrong... can you send me your's? please. Link to comment Share on other sites More sharing options...
Premium Sanchez 2467 Posted April 17, 2014 Premium Share Posted April 17, 2014 I don't have original files just modified, sorry. Link to comment Share on other sites More sharing options...
xXCapConXx 6 Posted April 17, 2014 Author Share Posted April 17, 2014 I don't have original files just modified, sorry. Shit ok... I try to fix my error. Thanks always. 1 Link to comment Share on other sites More sharing options...
xXCapConXx 6 Posted April 17, 2014 Author Share Posted April 17, 2014 Ok i've modified my python files and now the client close after 1 second and in the syserr.txt is: LoadScriptFile!!!!!!!!!!!!!! - exceptions.NameError:name 'CTOA' is not defined This is my system.py: import sys import app import dbg sys.path.append("lib") def StringColorToInt(colorstring): import grp colorstring = colorstring.strip() if len(colorstring) != 8: raise ValueError, "input #%s is not in #AARRGGBB format" % colorstring a, r, g, b = colorstring[:2], colorstring[2:4], colorstring[4:6],colorstring[6:8] a, r, g, b = [int(n, 16) for n in (a, r, g, ] return grp.GenerateColor(float® / 255.0, float(g) / 255.0, float( / 255.0, float(a) / 255.0) __builtin__.CTOA = StringColorToInt class TraceFile: def write(self, msg): dbg.Trace(msg) class TraceErrorFile: def write(self, msg): dbg.TraceError(msg) dbg.RegisterExceptionString(msg) class LogBoxFile: def __init__(self): self.stderrSave = sys.stderr self.msg = "" def __del__(self): self.restore() def restore(self): sys.stderr = self.stderrSave def write(self, msg): self.msg = self.msg + msg def show(self): dbg.LogBox(self.msg,"Error") sys.stdout = TraceFile() sys.stderr = TraceErrorFile() # # pack file support (must move to system.py, systemrelease.pyc) # import marshal import imp import pack class pack_file_iterator(object): def __init__(self, packfile): self.pack_file = packfile def next(self): tmp = self.pack_file.readline() if tmp: return tmp raise StopIteration _chr = __builtins__.chr class pack_file(object): def __init__(self, filename, mode = 'rb'): assert mode in ('r', 'rb') if not pack.Exist(filename): raise IOError, 'No file or directory' self.data = pack.Get(filename) if mode == 'r': self.data=_chr(10).join(self.data.split(_chr(13)+_chr(10))) def __iter__(self): return pack_file_iterator(self) def read(self, len = None): if not self.data: return '' if len: tmp = self.data[:len] self.data = self.data[len:] return tmp else: tmp = self.data self.data = '' return tmp def readline(self): return self.read(self.data.find(_chr(10))+1) def readlines(self): return [x for x in self] __builtins__.pack_open = pack_open = pack_file _ModuleType = type(sys) old_import = __import__ def _process_result(code, fqname): # did get_code() return an actual module? (rather than a code object) is_module = isinstance(code, _ModuleType) # use the returned module, or create a new one to exec code into if is_module: module = code else: module = imp.new_module(fqname) # insert additional values into the module (before executing the code) #module.__dict__.update(values) # the module is almost ready... make it visible sys.modules[fqname] = module # execute the code within the module's namespace if not is_module: exec code in module.__dict__ # fetch from sys.modules instead of returning module directly. # also make module's __name__ agree with fqname, in case # the "exec code in module.__dict__" played games on us. module = sys.modules[fqname] module.__name__ = fqname return module module_do = lambda x:None def __pack_import(name,globals=None,locals=None,fromlist=None): if name in sys.modules: return sys.modules[name] filename = name + '.py' if pack.Exist(filename): dbg.Trace('importing from pack %sn' % name) newmodule = _process_result(compile(pack_file(filename,'r').read(),filename,'exec'),name) module_do(newmodule) return newmodule #return imp.load_module(name, pack_file(filename,'r'),filename,('.py','r',imp.PY_SOURCE)) else: dbg.Trace('importing from lib %sn' % name) return old_import(name,globals,locals,fromlist) def splitext(p): root, ext = '', '' for c in p: if c in ['/']: root, ext = root + ext + c, '' elif c == '.': if ext: root, ext = root + ext, c else: ext = c elif ext: ext = ext + c else: root = root + c return root, ext class PythonExecutioner: def Run(kPESelf, sFileName, kDict): if kPESelf.__IsCompiledFile__(sFileName): kCode=kPESelf.__LoadCompiledFile__(sFileName) else: kCode=kPESelf.__LoadTextFile__(sFileName) exec(kCode, kDict) def __IsCompiledFile__(kPESelf, sFileName): sBase, sExt = splitext(sFileName) sExt=sExt.lower() if sExt==".pyc" or sExt==".pyo": return 1 else: return 0 def __LoadTextFile__(kPESelf, sFileName): sText=pack_open(sFileName,'r').read() return compile(sText, sFileName, "exec") def __LoadCompiledFile__(kPESelf, sFileName): kFile=pack_open(sFileName) if kFile.read(4)!=imp.get_magic(): raise kFile.read(4) kData=kFile.read() return marshal.loads(kData) def execfile(fileName, dict): kPE=PythonExecutioner() kPE.Run(fileName, dict) def exec_add_module_do(mod): global execfile mod.__dict__['execfile'] = execfile import __builtin__ __builtin__.__import__ = __pack_import module_do = exec_add_module_do """ # # PSYCO installation (must move to system.py, systemrelease.pyc) # try: import psyco #from psyco.classes import * def bind_me(bindable_list): try: for x in bindable_list: try: psyco.bind(x) except: pass except: pass _prev_psyco_old_module_do = module_do def module_bind(module): _prev_psyco_old_module_do(module) #print 'start binding' + str(module) try: psyco.bind(module) except: pass for x in module.__dict__.itervalues(): try: psyco.bind(x) except: pass #print 'end binding' dbg.Trace("PSYCO installedn") except Exception, msg: bind_me = lambda x:None dbg.Trace("No PSYCO support : %sn" % msg) """ def GetExceptionString(excTitle): (excType, excMsg, excTraceBack)=sys.exc_info() excText="" excText+=_chr(10) import traceback traceLineList=traceback.extract_tb(excTraceBack) for traceLine in traceLineList: if traceLine[3]: excText+="%s(line:%d) %s - %s" % (traceLine[0], traceLine[1], traceLine[2], traceLine[3]) else: excText+="%s(line:%d) %s" % (traceLine[0], traceLine[1], traceLine[2]) excText+=_chr(10) excText+=_chr(10) excText+="%s - %s:%s" % (excTitle, excType, excMsg) excText+=_chr(10) return excText def ShowException(excTitle): excText=GetExceptionString(excTitle) dbg.TraceError(excText) app.Abort() return 0 def RunMainScript(name): try: execfile(name, __main__.__dict__) except RuntimeError, msg: msg = str(msg) import locale if locale.error: msg = locale.error.get(msg, msg) dbg.LogBox(msg) app.Abort() except: msg = GetExceptionString("Run") dbg.LogBox(msg) app.Abort() import debugInfo debugInfo.SetDebugMode(__DEBUG__) loginMark = "-cs" app.__COMMAND_LINE__ = __COMMAND_LINE__ RunMainScript("prototype.py") Link to comment Share on other sites More sharing options...
Premium Sanchez 2467 Posted April 17, 2014 Premium Share Posted April 17, 2014 Please upload your system.py to pastebin or to somewhere, because the code messed up here. Link to comment Share on other sites More sharing options...
xXCapConXx 6 Posted April 17, 2014 Author Share Posted April 17, 2014 Please upload your system.py to pastebin or to somewhere, because the code messed up here. Ok. Here: http://pastebin.com/cZwBc6ze Link to comment Share on other sites More sharing options...
Premium Sanchez 2467 Posted April 17, 2014 Premium Share Posted April 17, 2014 Here it is: This is the hidden content, please Sign In or Sign Up Link to comment Share on other sites More sharing options...
xXCapConXx 6 Posted April 17, 2014 Author Share Posted April 17, 2014 Here it is: This is the hidden content, please Sign In or Sign Up Thanks but not work... Syserr.txt: 0417 19:42:00608 :: Failed to load script file : locale/de/ui/LoginWindow.py 0417 19:42:00610 :: ui.py(line:2773) LoadScriptFile system.py(line:192) execfile system.py(line:163) Run locale/de/ui/LoginWindow.py(line:7) ? LoadScriptFile!!!!!!!!!!!!!! - exceptions.NameError:name 'CTOA' is not defined 0417 19:42:00610 :: ============================================================================================================ 0417 19:42:00610 :: Abort!!!! 0417 19:42:00611 :: introLogin.py(line:499) __LoadScript ui.py(line:2790) LoadScriptFile exception.py(line:36) Abort LoginWindow.__LoadScript.LoadObject - exceptions.SystemExit: 0417 19:42:00611 :: ============================================================================================================ 0417 19:42:00611 :: Abort!!!! Should i input "import CTOA" in the python files? Link to comment Share on other sites More sharing options...
Premium Sanchez 2467 Posted April 17, 2014 Premium Share Posted April 17, 2014 No, upload your LoginWindow.py. Link to comment Share on other sites More sharing options...
xXCapConXx 6 Posted April 17, 2014 Author Share Posted April 17, 2014 No, upload your LoginWindow.py. Here: http://pastebin.com/DEjGkbq5 I think i do something wrong there.. Link to comment Share on other sites More sharing options...
Premium Sanchez 2467 Posted April 17, 2014 Premium Share Posted April 17, 2014 It looks correct. Try this system.py: This is the hidden content, please Sign In or Sign Up Link to comment Share on other sites More sharing options...
xXCapConXx 6 Posted April 17, 2014 Author Share Posted April 17, 2014 It looks correct. Try this system.py: This is the hidden content, please Sign In or Sign Up Same error: 0417 19:51:00610 :: Failed to load script file : locale/de/ui/LoginWindow.py 0417 19:51:00612 :: ui.py(line:2773) LoadScriptFile system.py(line:192) execfile system.py(line:163) Run locale/de/ui/LoginWindow.py(line:7) ? LoadScriptFile!!!!!!!!!!!!!! - exceptions.NameError:name 'CTOA' is not defined 0417 19:51:00613 :: ============================================================================================================ 0417 19:51:00613 :: Abort!!!! 0417 19:51:00613 :: introLogin.py(line:499) __LoadScript ui.py(line:2790) LoadScriptFile exception.py(line:36) Abort LoginWindow.__LoadScript.LoadObject - exceptions.SystemExit: 0417 19:51:00613 :: ============================================================================================================ 0417 19:51:00613 :: Abort!!!! Link to comment Share on other sites More sharing options...
Premium Sanchez 2467 Posted April 17, 2014 Premium Share Posted April 17, 2014 I gave up. Are you sure you packing the new system.py?... Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now