Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2
You last visited: Today at 08:47

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement
Bitcoin Dice Game


Python API and Deallocation

Discussion on Python API and Deallocation within the Metin2 forum part of the Popular Games category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2009
Posts: 12
Received Thanks: 1
Python API and Deallocation

Hi, im courrently making a bot just for fun in C++, althought for sake of compatibility, im calling the CFunctions that the client exports to the python interpreter.
But i can't understand if i need to do Py_DECREF after calling a function, or if there is somesort of garbage collector, i find this Python API a bit confusing.
This is my code:


Are this Py_DECREF really necessary?
And please note that im calling a CFunction not the python function from the interpreter, in those examples im calling these 2 functions:


Thanks in advance



martinx1 is offline  
Old 08/01/2019, 18:34   #2
 
elite*gold: 400
Join Date: Dec 2007
Posts: 6,602
Received Thanks: 6,331
Not sure if this is an option for you: The exported python functions are just wrappers around C++ functions. You could call the inner C++ function instead, then you don't have to handle the unnecessary Python additions.


Mi4uric3 is offline  
Old 08/01/2019, 20:54   #3
 
elite*gold: 0
Join Date: Jun 2009
Posts: 12
Received Thanks: 1
Quote:
Originally Posted by Mi4uric3 View Post
Not sure if this is an option for you: The exported python functions are just wrappers around C++ functions. You could call the inner C++ function instead, then you don't have to handle the unnecessary Python additions.
Yes I know, the problem is that I want it to be compatible with most servers without the need to reverse every function again and some servers modify the code of some of those functions. I even have a system in my bot where it first try to search for each function using a pattern, and if not found, uses the python functionif there is one.
And on python documentation, it says nothing about how PyObject are created and deallocated, they just say that buffers need to be manually freed. I just would like to know if there is some connection between the PyObject and the interpreter where it takes care of freeing the PyObject. I just hate this API.
martinx1 is offline  
Reply



« M2bob | Metin2 Grafikbug nach ca 15 Minuten »

Similar Threads Similar Threads
Public War Rock Stats API / Öffentliche War Rock Stats API
10/16/2013 - WarRock - 11 Replies
Hallo, hier eine Kleinigkeit die ihr für euren Clan benutzen könnt: http://wa-sta.net/other/api/ Damit könnt ihr z.B. auf eurer Clanseite einbinden, ob eure Member online sind, die Statistiken von ihnen etc.
API Error Code: 100 API Error Description: Invalid parameter Error Message: redirect_
04/08/2012 - elite*gold Trading - 2 Replies
API Error Code: 100 API Error Description: Invalid parameter Error Message: redirect_uri URL is not properly formatted Das bekomme ich wenn ich ne App installiere... ich habe schon 3 Apps richtig installiert, danach kam immer das bei anderen Apps die ich installiert habe.. was heisst das? redirect_uri URL is not properly formatted
[GUIDE]Api Sheild to be against API Tools!
10/15/2011 - Metin2 PServer Guides & Strategies - 8 Replies
I got lot's of pm's from people asking me about api tool shield , so i decided to make a guide to show ya all how to get rid of the nowadays hackers in your servers ... First ... Open CONFIG of each channel , set pk_server:0 to pk_server:1 then in set adminpage_ip1 with adminpage_ip1: 192.168.2.(write yur real ip here) without quotes or space , just write it after the 192.168.2 directly like this .. example : adminpage_ip1: 192.168.2.ip And keep doing that for all CONFIG of all...
[ ALL IN ONE ] Lizenserver 7120 | API Server | API Tools
07/07/2011 - Metin2 PServer Guides & Strategies - 45 Replies
Hallo @all ServerAdmins! Hier möchte ich euch ein Projekt von mir vorstellen der vieles einfacher macht. Was ist das? Ein Arbeitsplatz für Administratoren von Mt2 Server. Was kann es? behebt das Problem socket_connect: HOST 220.95.239.40:7120, could not connect.
[HELP] Api tool v2 and other api's
05/28/2011 - Metin2 Private Server - 0 Replies
Hi, can someone tell me where i can find the api tool v2 fix? and if there are other types of API tools Thank you very much



All times are GMT +2. The time now is 08:47.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

BTC: 33E6kMtxYa7dApCFzrS3Jb7U3NrVvo8nsK
ETH: 0xc6ec801B7563A4376751F33b0573308aDa611E05

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2020 elitepvpers All Rights Reserved.