Jump to content

Takuma

Developer
  • Posts

    23
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Takuma

  1. It's been years since I touched Metin2. You're using the pc.count_item function, right? If so, try to look in the questlua_pc (I don't remember the name exactly), and look at the count_item method. Try to see what it refer to.. It seems to me it's CountSpecifyItem. Did you modify the INVENTORY_MAX_NUM constant? Show us this function if it is used, we might be able to help you...
  2. ASIKOO gave you PHP code to generate a password like MySQL 5.2, and I gave you the code to generate it with MySQL as well. We can't do more...
  3. Maybe I'm going to ask a stupid question, but if the hash function hasn't been changed, why not directly use the MySQL PASSWORD() function? $sql = "INSERT INTO account (login, password, social_id, email) VALUES (?, PASSWORD(?), ?, ?)"; $stmt = $pdo1->prepare($sql); $stmt->execute([$login, $password, $social_id, $email]); PASSWORD('123456789') give you *CC67043C7BCFF5EEA5566BD9B1F3C74FD9A5CF5D. Edit : or this if you're on MySQL 8 (ty Gurgarath) CONCAT('*', UPPER(SHA1(UNHEX(SHA1(?))))); or -- not tested CREATE FUNCTION PASSWORD(input VARCHAR(255)) RETURNS CHAR(41) BEGIN DECLARE output CHAR(41); SET output = CONCAT('*', UPPER(SHA1(UNHEX(SHA1(input))))); RETURN output; END;
  4. All available bonuses need to be in item_attr table no? If you find another bonus it's a modded item. Unless specifically modified in the sources*
  5. Hi! Thanks for sharing. I have a couple of questions: Why use a JSON file when the bonuses are already stored in the database? Why pull all the data from PHP and then process it? I believe it would be more efficient (and maybe better for your learning ? if you're trying to) to try joining the item and item_attr tables to perform this processing entirely in the database. Then, you could simply retrieve the result to display it.
  6. Actually, what I was saying is that you can do all the queries with the player name at the source level and your DBMS will store IDs for it. You just have to adapt a little bit the queries in your player_block.cpp. Example to insert new line in the player_block_list table : INSERT INTO player_bloc_list (id1, id2) SELECT p1.id, p2.id FROM player p1 JOIN player p2 ON p1.name = 'Kio' AND p2.name = 'Takuma'; Same way for select etc.. By doing this, indeed, you add an additional join during insertion (though considering the capabilities of the DBMS compared to the current Metin2 servers, it may be negligible). However, on the other hand, storing IDs is easier, and it aligns a bit more with standards.
  7. Actually, I don't understand the problem. You can store the id very well, but still ask your DBMS to return the player name to you without creating new queries. This takes up less space, it ensures that you don't keep data that doesn't correspond to anything, etc. Gurgarath told me that friends management was a real disaster. And I think we don't have to start again on this bad basis. You can keep your internal operation with loading the nicknames into memory (for displaying the list), but store the IDs in the database. You just need to change your queries (not adding new queries) to support it
  8. Hey! Thanks for sharing. Why store in database player name and not foreign keys on player IDs? As these are direct queries it could made them lighter a little no? There may be a constraint that I don't understand. This can even be problematic for servers where you can change your player name.
  9. Just a few details... Because when addressing beginners (the target audience for this post), it's important to lay a solid foundation: No. It depends on the paradigm. It should be emphasized that the entirety of C is supported in C++. In fact, C++ is just an extensions of C with a vast number of libraries. Well, then I am a liar. Not learning C to understand what C++ does under the hood is like saying you know how a car works because when you turn the key, it starts. And in terms of courses (for English spearks), I also recommend [Hidden Content]. It's comprehensive and well-explained.
  10. My opinion is that I didn't even know about the ast module; I've never really had the opportunity to use it. I'll be back to work on Monday and will be less available. However, if you find that this improvement is beneficial and necessary, I invite you to make a pull request on GitHub so that you can be directly listed as a contributor. As soon as I have some time, I'll study the matter. Thank you!
  11. Hi devs ! I was getting bored during my vacation, so i had to keep myself occupied... At the request of @ Gurgarath :3, I created a small Python script that allows you to clean up unused lines from your locale_game.txt and locale_interface.txt. It is coded with Python 3.11, compatibility with earlier versions is not guaranteed. It also uses the chardet module, which is specified in the requirements.txt. For any additional information (such as the How To), please refer to the README.md. This script currently does not support imports like import LocaleInfo as li. It also does not support dynamically constructing variable names. It only detects raw constants like localeInfo.MY_CONSTANT. Downloads : Download Find this tool on my Github or M2DL Exemple of output : Takuma.
  12. It tries to look for ENABLE TRANSMUTE SYSTEM in app module. But it seems to doesn't exist. Check if you haven't ENABLE_TRANSMUTE_SYSTEM with an other name. Else, remove this : if app.ENABLE_TRANSMUTE_SYSTEM: data["look"] = int(d[c.inc("look")])
  13. Hi. I'm a little bit busy now. Could you maybe make a pull request on github ? I'll check this. Thanks you !
  14. For those who are in the same case, I made a pull request with a version that seems to support .txt
  15. I cannot edit my subject, so... I'll write the changes here. Now you no longer need to use bin and src folders mandatorily. [changes] Please, read README.md file to know how to use the script. A example of use could be : to use src and bin folders as before. Thank to NewWars
  16. Hi devs ! So, I just pushed a commit. It's a an uptdate : I refactored all the code (not in only one file); Tools can know support many modules in same file; Some parameters, such as the use of the snake_case for the arguments, can be configured in the CONSTANTS.py file No modification to use the script. Do as before. (Sorry for my bad english) Takuma.
  17. Thanks for the feedback. I update the repo, sorry for be late ! I also add you to Thanks part in README.MD, I can put your GitHub profile if you want. I was wrong on the NoReturn, it is actually intended for a code that exits the program (Source). Takuma.
  18. Hey ! Sorry, i'm late, but I just tought about it because I'm upgradding my client to Py3. I think you fourgot something (And I have one in my system.py). In python2 you can specifie a numeric type for numer like : my_numeric = 0L But it is no longer supported in Python3, and we need juse use : my_numeric = 0 Same with 0j. (Source: PEP 237)
  19. Hi ! Thanks for your feedback ! I added the two functions. I did as they took an int as parameter. I will think about how to properly model these objects in Python automatically.
  20. Hi ! Use Python3 with the client can be very interesting.. For use UTF-8 everywhere for example (Unicode...). i tried to do this before, but my client crashed when I created empty tuple... xd if someone want share a client with Python3.. I take it ! I just specify that i updated the code for two errors that were reported to me : Tuple in return; GetWindow() method.
  21. I've already thought about converting the docstrings, but I don't know the sources well enough to comment everything... But when I have some time I will do the docstrings converter. Thanks for the idea ! I will add the method to use venv with Visual Studio Code too. Added.
  22. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) Hi ! First: sorry. My code is not clean, I am not a developer or anything, I am just a math student. I am just trying to do my best. And my skills in English are… non-existent. So, be nice please. Using very often PyCharm, I wanted to be able to use it on Metin2, but PyCharm (or another IDE) hit me hard with baseball bat because he could not find the modules. So, I have made this tool to create module’s python skeleton and use autocompletion with IDE. The biggest flaw is that you must have Python3 installed on your machine to use typing. Example of result with PyCharm: And you can't find an exemple of output here. To follow this tutorial, you must have: Python3 (i'm using Python3.8) PyCharm or other IDE, but in this tutorial, I will use PyCharm (from JetBrains). Tools to make skeletons. I – Generate your module skeleton. You can find just upper, a link to download my script. It is easy to use. You can find all the manipulations in README.md file, but I will explain it here too: Move all your client’s .cpp file (with module) in src folder. Just use now main.py with Python3 (I developed it with Python3.8) You will see many files in bin folder. II – Make a virtual environment of Python3 for IDEs We will have to create a virtual environment for our IDEs to do not dirty our real Python installation. To do that, you can use the command : python3 -m venv /path/to/new/virtual/environment Find all information on the doc : [Hidden Content] I will show you how to do that with PyCharm: And with Visual Studo Code: III - Add our skeletons to virtualenv For that, you just must move all your .py file in bin folder to venv/Lib/site-packages. Example : This manipulation is a little dirty ... But I couldn't find anything better so as not to have too much change to make. If you have a better one, I take... Don't forget to configure your IDE to use new virtualenv. IV - Known issues: Script cannot predict value of the constants; It does not yed manage structures of this type: V - Debug: Script now support Tuple in functions' returns; Add the method GetWindow for arguments. With using Python3 IDE, he will consider print without parentheses and except bloc as error... Thanks to @Gurgarath for his help Github Takuma.
×
×
  • 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.