Vanilla

Developer
  • Content Count

    388
  • Joined

  • Last visited

  • Days Won

    51

Everything posted by Vanilla

  1. Welcome to the second part of my guide series. This time I'll tell you how you can compile with gcc48 or even gcc49 like it's the case in vanilla and how you can use c++11 which will allow much more and faster instructions than the old one. At first we need to have a look at our Makefile. Make sure you edited the Line SVN_VERSION so you won't receive any errors. Try it e. g. to SVN_VERSION = mt2 Next, you'll have to declare what compiler you want to use. Of course you first need to install the compiler, but I guess it's clear (if you haven't done so, just use cd /usr/ports/lang/gcc49 or even 48 and use make install clean). The line normally say: CC = g++ This is the standard compiler. You may want to change this line to: CC = g++49 Or if you're using 48, change it to CC = g++48 Now before you compile it, you'd recompile all needed libs with gcc48/gcc49 too! So change the compiler in the makefile and recompile the sources in the following directories: libgame/src libpoly libserverkey libsql libthecore/src And then you need to recmopile cryptopp with the newer gcc version too! It's located in the Extern/cryptopp-directory. Now you can compile your game and even your db source with the newer gcc version. You may experience a much smaller file size. The newer compilers will produce an even more faster and smaller gamefile than before. Oh and if you want to carry out the lib-files you're using on your compiling machine (to make sure everything runs smoothly) you may use the following CFLAG: -Wl,-rpath,/usr/local/lib32/metin2 You can change the path to whatever you want! If you specify this, you instruct the linker to use this path so whenever you start your game/dbcache it'll first look in the given directory for the right libs and then, if it can't find the libs there, it'll look elsewhere. Using c++11 is a must-have if you want to make new statements. The source code how to load the database without txt-files needs the newer c++ version, so you'll have to upgrade at least the dbcache for it. But you'll experience even more smaller file sizes with this change so it keeps up with more and more advantages. First you may want to specify the new CFLAG. It's called: -std=c++11 This tells the compiler to use c++11. Keep in mind that not every compiler can use c++11! The newer gcc version can deal with it without any problems. If you compile your source then, you may find a new error occuring! Open every .cpp and .h-file in Notepad++ and do the following things (you can use the mass replacement of Notepad++): replace typeof with __typeof replace auto_ptr with unique_ptr Watch out for the common-directory too! Then you can recompile the source and it's done! Oh and for this you don't need to compile every other sourcecode with c++11. You can e. g. only compile the dbcache with it. Last small hint: You can play with the tuning flags to get even more optimization. -O2 can sometimes be good, but sometimes it's better to use others flags. You can even use -O3 or -Ofast. But be careful with this and consider using -fstrict-aliasing so the compiler won't optimize instructions that'd lead into a crash if it'd optimize them. And always: Pay attention to the warnings your compiler throws at you! They aren't there to just "hang out". They'd lead into crashes, so care about them. Lastly I hope you enjoyed the guide. As in the last one, please tell me if it's good or not and if you have any questions: Feel free to ask.
  2. Greetings! The new beta is finished! I'm proud to present r71480. This time a few things have changed. And in this revision, we have a lot of new stuff. In the following I'll provide the download link along with the things I'd love you to test. *** DISCLAIMER *** The core is marked as stable. Anyway, I'll make it clear that I'm not responsible if you use this core since I can't give a warranty that I fixed every single security breach that potentially could happen - that's totally impossible. But we all together made the source great and secure so every public issue is fixed by now. You can use it in production environments now. So... What's new? boot-trigger for quests With this you can execute commands, timers, and all the stuff you'd like to have just on boot-time! revisioning of the 'unique class' (+ a ton of posibilities) added the functionality to create unique-groups temp-Variables for quests upgraded all libs moved completely to the newest clang version fixed some big security issues in the source code fixed the ingame ban and unban commands unified tables and gave them a new way: unify! file clean-up revisioned the makefiles gave the source a new, easier structure removed all external dependencies just install them by ports.. No external-folder necessary! removed 'boost' dependency (no boost lib needed yay) partial implementation of the wolfman (claws etc. are added, needs review) And basically everything that has been offered in the earlier versions of the vanilla core. Nothing should be missing. And if you miss something, just feel free to tell me! What needs testing? There are few things I'd love you to test out: Please check if the core is vulnerable to any security breaches you may know (also the public ones, don't know if I missed something) Please test out the new features! I'd really love to know if the new unique-functions and the boot-trigger does the job. Explanation to new features: Unique with container support Unique has evolved! This time you have a few new possibilities. Don't know what unique is? Here's a short explanation: With the unique-questfunctions you can spawn or set mobs, npcs and now even players to have a unique name. This name is stored into a unique-container. You can access this container and get all the vid's by their unique name (also called: the key) So for example you can spawn a boss with a key. Later on you can check if this specific mob has been killed or not. Or you can set his hp on-the-fly. There's basically no limits! And now with the revised system you'll have even more options. The new unique system works with containers. By default there are two containers reserved: __DEFAULT__ and __CHARACTER__. The first one is for all the basic stuff. And the second one is reserved for players. Now, as you may have noticed, there's a default one which means that the container-stuff is optional. If you just use the unique functions without specifying a container, it'll just use the default stuff. But you CAN use your own containers just as you want to. You can create, delete and list all the containers running. There is a list with all the quest-functions down below. boot-trigger This is pretty self-explanatory. With this release you can use "when boot begin" to specify a block of code that will be executed once the core has been booted. temp-variables With the new temp-variables you can set and remove player-specific variables. They are stored in the core and not written to disk or database. So be careful because they might get dropped once the core shutdowns. It's just a quick storage for people who want to have something like a cache for quick access. new quest functions nil unique.spawn_unique(string key, int vnum, string pos=unused, string container=optional) nil unique.set_unique(string key, int vid, string container=optional) nil unique.purge_unique(string key, string container=optional) nil unique.kill_unique(string key, string container=optional) bool unique.is_unique_dead(string key, string container=optional) int unique.get_hp_perc(string key, string container=optional) nil unique.set_def_grade(string key, int def, string container=optional) nil unique.set_hp(string key, int hp, string container=optional) nil unique.set_max_hp(string key, int maxhp, string container=optional) int unique.get_vid(string key, string container=optional) bool unique.exists(string key, string container=optional) table unique.get_container_list() this prints out all the unique containers table unique.get_container_list(string key) this prints out all the vids in the unique-container "key" nil unique.remove_container(string key) removes a whole container (flushes it when called on standard containers) nil pc.temp_var_set(string key, string value) string pc.temp_var_get(string key) nil pc.temp_var_delete(string key) Thanks a lot for participating! If there are any questions, this is the topic related to it. Further releases will be made public here too! If you'd like to contribute, just post code additions here. Changelog older changelogs Download Useful information: All necessary libs are included. If you're building your own vanilla binary you'll first have to move into every project of the Internal directory and rebuild the libs. The main makefile is not adapted yet, I was too lazy (ps: Still too lazy!) rev 71480 see this post: rev 70220 STABLE Core Sourcecode rev 70140 BETA Core Sourcecode Password for the archive is: vanilla Password for older source archives: vanillamt2 Best Regards Vanilla
  3. I think there's a difference. Gameforge actually did something bigger this time, they're clearly against it and trying to pursue those who participate in illegal actions regarding metin2. For the most time I've been here I didn't see something like this. Yes, sometimes a server got knocked down, but that'd actually be a hoax too. This time they indeed did take action in pursuing it. So I have no interest in getting my hands dirty with a project I'd like to share just because it's my hobby. I'm not doing that. If anyone still wishes to continue this project he may do so, I don't care, but note that it's Gameforge that actually cares. And since there's been some speculation about why and what happened: NO, I did NOT get any message from Gameforge etc... And I'm not in legal trouble. I want to keep it that way, that's the reason I stopped the project. Though I definitely know that some people got RC-versions before this happened. So if they share it, you'd get the most recent version. But that's up to them, not me. Btw. a moderator should probably close this thread. There's no reason to keep it open.
  4. Hello everyone, A lot of people might already know the issue. If you choose Arial as Font for Metin2, texts will be displayed in a weird way and with dots. There are a few reasons for this to happen and increasing font size fixes it, but no one wants huge texts everywhere and obviously, we wannt a nice font. Not a trial and error. So here's a partial fix for it. If you choose very small font sizes (e. g. font size 9px) in locale_game.txt it'll still look a bit off but it's definitely readable. With these changes, you'll have no problem with font sizes 14px and higher. Maybe someone wants to share different approaches or ideas. I think with these changes the problem is almost entirely fixed, no one needs size 9 especially with Arial.. First open your Binary source and search for "LOGFONT" (without "" of course). You'll find two matches where it's being used for initialization of new fonts: One in TextBar.cpp(CTextBar::__SetFont) and one in GrpFontTexture(CGraphicFontTexture::GetFont). And these are the two functions where we need to make some changes first. Under the line where LOGFONT is used, you're gonna add the following code: HDC hDC = m_dib.GetDCHandle(); if (hDC) { auto px = fontSize * 72 / 96; fontSize = -MulDiv(px, GetDeviceCaps(hDC, LOGPIXELSY), 72); } This code segment does two things: First it converst px -> pt, since LOGFONT expects pt. And on second, it calculates the correct displaying size according to the ppi and the cell height. This leads to the variable we need: The point size. Note that there's a minus, which means that we'll automatically choose the nearest possible size according to the specified font size. So everything's good here. Als note that you need add this segment to BOTH places where LOGFONT is being used for initialization. You have to change the name fontSize according to the files you edit. In TextBar.cpp the example above fits, for GrpFontTexture you just need to change fontSize to m_fontSize. Now change the following parts in both functions: logFont.lfOutPrecision = OUT_TT_ONLY_PRECIS; logFont.lfClipPrecision = CLIP_DEFAULT_PRECIS; logFont.lfQuality = NONANTIALIASED_QUALITY; logFont.lfPitchAndFamily = VARIABLE_PITCH; Note: You can also change logFont.lfWeight from FONT_NORMAL to FONT_MEDIUM or any other font weight if you wanna add up a mit more strength to your fonts. I just left it to FONT_NORMAL, which is fine. Also note that I chose NONANTIALIASED_QUALITY since anti-aliasing didn't make any change (not sure if Arial is even compatible, at least not those small font sized that I tested it with..). You can also change them to something like ClearType to do the job, that's up to you. I wanted to display the fonts just like they are, no mangling with them. But depending on your needs you can tweak a bit here. that's almost it! Last but not least, we have to change the way our adapter hDC does it's job. Especially since the above calculation for point size is only 100% true for MapMode MM_TEXT. And that's what we're gonna establish now. If you are in CGraphicFontTexture::GetFont, you can just scroll a bit higher. You'll see the initialization of hdC (function CGraphicFontTexture::Create). just below SetBkColor(hDC, 0); you can add these two lines: SetGraphicsMode(hDC, GM_ADVANCED); SetMapMode(hDC, MM_TEXT); Aaand you're done! That's it! Compile and enjoy! Best Regards Vanilla
  5. Since things changed and I do not wish to get into legal trouble I decided not to continue this project. I don't mind anyone reuploading or sharing the RC build. That's up to you guys, you'd know what you're doing. Thanks to those who helped me and sorry for those I may have disappointed.
  6. Vanilla

    Gameforge sucks

    Eren is that you? But leaked is not open source. It's not allowed. You can't say drugs are legal by magic just because people use them either way. And since YMIR/WEBZEN/whatever now did not decide to make it open source, it just isn't. It's only leaked, even though many people contributed their thoughts on it. It's still protected by copyright and I don't see that they released any license that allows people to use it as an open source project. So yeah, if they wanna sue people, they'll definitely have all the legal rights on their side. You'd have to write everything on your own and still that won't change a single thing since you'd only copycat their ideas and work which means you're still infringe copyright. Let alone that you'd still be using their graphical stuff (client item icons etc.). So no matter what you do, you'll always break the law if you're running a server. But I think the government is more concerned about those who do not pay taxes.
  7. Vanilla

    Gameforge sucks

    No. Just no. If someone leaves a bomb in a park you aren't planning to use it, too. At least I hope so. It's definitely not allowed and Gameforge has the right to take legal action if someone uses their source. The resource is not free, afaik it got leaked back then.
  8. Vanilla

    Gameforge sucks

    Every single one of us works in their free time on something, otherwise we wouldn't develop stuff.. And yes, you're right with what you said. I played official and I dislike it. I think it's just as you described it - they fear that they'll loose money due to private servers, but they forget that if those servers don't exist, the money wouldn't magically transfer into their pocket. Because those people who spent their money on private servers (and you can argue if that's actually worth it or not) wouldn't just spend it on their official server instead. They are here for a reason. I do not think they're crushing the private server stuff. They can't do it everywhere. Some people host outside. It's just getting.. different I guess. But, yeah, those who still want to open a server will have it much harder if they keep the pressure up. And more importantly - they're ruining the game. If they remove everything that actually attracts people to metin2, then there's no wonder no one wants to play it. For example, who would want to play a game with shitty graphics, unbalance, pay-to-win like a maniac in 2019? Most people demand it to have at least fancy graphics and stuff. Rarely will someone scroll through steam and think "oh that game looks interesting, I might just play it." The people are being attracted because there are private servers. Servers which offer you to fell absolutely powerful without having to pay half your monthly income in order to at least be someone people might notice. In Private servers the community is different, everyone is somewhat valued because everyone is strong just by the game mechanic itself. Guilds invite you because you can be of help, even if you aren't on the top 10 tier list of the most imbalanced badasses around. And that's the problem. It's not about efficiently killing the servers though they wish they'd do that. All they do is plug some holes into their sinking ship. Maybe, if one day Metin2 ultimately has it's end, they'll have their goal achieved. No one wants to open a private server if there are no players who are even the slightest bit interested in metin2. So yeah, I don't think they'll kill all servers. Either they stop pursuing it, like they did before, or they'll continue and ruin their own game further which will sooner or later initiate it's end. At least, those are all possibilities that might or might not be true.
  9. Vanilla

    Gameforge sucks

    If they really pursue this route I'm positive metin2 will be dead soon. In my opinion the game lived from the private servers and their development. If they purge it, they'll loose their player base sooner or later. But it's their decision and we'd respect that. I for myself don't want to get into legal trouble because of a hobby of mine. I don't want to ruin the fun or sound like a end-time preacher but sometimes it's better to let it go and move an.
  10. Vanilla

    [RLS]Improving: Loading about players

    I heard someone mention my name? I'm not a good dev but, for sure, I can take a look at it. Would be a nice project to work on.
  11. There are many ways on how to start being a "developer". But first, you need to understand what you're doing. Do you have any experience with programming so far? Do you know the difference between procedural and object-oriented programming? Do you understand the language that's behind it? If not, you'd start there. No one will write guides about how to develop your own systems in metin2 since... yeah, if you know what you're doing, then there's no need for it. And if you don't know what you're doing, you'd start learning programming. And there are tons of good guides about that. If you encounter any trouble or problem while coding, you can ask this board. But why should anyone reinvent the wheel? You can't start programming if you don't know what to do and if you do know, you won't need a guide. So at first if you don't have any knowledge about programming you'd start with procedural programming. This helps you understand how the machine works through each line of code. You can start with simple quests for metin2 and go into more advanced techniques. After that, take a step further into object oriented programming. Read about it, understand what it means and read a bit about c++, progress will come sooner or later and you'll start to understand what the code in these sources actually mean. As soon as you understand it, you can modify and even create your own code. But first you'd understand it. This is mandatory. Please DON'T copy paste stuff from boards. Understand it and write your own.
  12. New build is up, this time we're hitting RC. I fixed a few code issues with the new commands and checking elevation status. Now /promote always elevates the target (before it just ranked up the target, but no elevation, only if you leave the target rank blank). /su command now also utilizes custom MySQL Password function! There's a check on boot when you're trying to boot with Mysql 8.x and still have not specified a custom password function. If the check fails, you're getting an error message and the core crashes immediately. This is due to the fact that the function PASSWORD has been deleted with MySQL 8.x release. This means that you have to rehash your passwords and use a custom password function. If you don't to it, the game will not boot successfully and logging in will not work under mysql 8.x. That's why. If you still use the older version or mariadb versions which still have PASSWORD function, you can still use the core just like before. It's only if you uprade it. Long story short: If you are on mysql 8.x you HAVE TO specify a custom password. For running servers, this means that players also have to create a new password. This is only because PASSWORD function got deleted in most recent versions. If you are on older mysql versions, you can continue like before. But the core warns you about it. If everything boots, you're ready to go.
  13. you can use gdb with symlinks, too. You can also cd to the directory you assume the faulty core is inside and run gdb "gamefilename". Then issue "run" and it'll start the game core while the debugger is attached to it and wait for the crash to happen. But as long as everything runs smoothly now, your core didn't crash at all and only the hoster went down. So yeah, keep observing it and watch yours logs. There's no need to debug if no crash happens
  14. what they mean with "fake core" is that you're having a symbolic link to another file. This is a feature that allows you to access the same file on different locations without having to copy it. I do like to copy the game and use a script for updating, it's more convenient for me. But that's personal preference, it's not an error if you have symlinks.. .core files are a memory dump so you can backtrace the error. This only happens if the core crashes. If it does a graceful shutdown (like when you exit the process properly due to shutdown scripts etc.) it does not create a core file. Also, if the core recognises a fatal error and shuts itself down, a core file will not be created. It only happens it if "crashes" which means that an instruction could not be processed. I think something else crashed or shut the game down. You'd check syslog and other cores, especially the dbcache which is often the reason your whole server shuts down.
  15. Vanilla

    open Error Client

    app is a module that's being built inside the binary. So you have to edit the client source, probably you're missing something. So you have two options: Either you remove it, which is not what you may want. Or you add the function to your binary. For further information: You can create modules in c++ and add them to the python via it's c-api. This is happening with modules like player, net, etc.... and also app. So the error tells you that the function ENABLE_DEWS_PLUS does not exist. According to the name I think it's more or less a bool variable that either enables the system or not. So even if this function is unknown, you'd try to just return true in this function. You have to edit it. WeedHex mentioned PythonApplicationModule. You can add more functions to the app module in this file. Note that you also have to add it to the module_list at the end of the file, otherwise the function will not be loaded into the app module.
  16. I don't see any reason for his posting either. So let's just keep him talk. Would be sad if anyone buys it and we have a fix that's about to be published. If anyone still buys his "easy fix" for money, then this person might not be the smartest one out there considering the fact that we're gonna fix this. As I said, on my client it works perfectly fine without any dots. So I only have to find the stuff I did on it and didn't mention.. Then we're good to go.
  17. If it's so easy, why don't you mind sharing it with the community instead of telling everyone how good you are? As I said, on my client it's fixed, but I don't remember every change I've made on it, so that's why I asked for the functions and will review them now. If you have a fix and wanna share it, post it, if not, please do not spam this topic with showing yourself off.
  18. @Sumnix did you try and change font_small to 14? Does it work then? Please send me those 3 functions you edited via pm so I can see how they look on your build. Maybe I missed to mention something I've done on my source since the characters are being displayed correctly there..
  19. I can probably write a guide on how to do that. But as I said, if you use the correct binary version (40k is best), you'd all be set up for it. No need to adapt packets since they already match The new beta is now finished and can be tested. I've sent the link to those wo pm'd me. A few things changed from the original list. Here's a quick overview: * corrected some errors with config that might lead into not correctly breaking into new line * Fixed GM logo. It's now visible for everything higher than GM_PLAYER, which means even GM_LOW_WIZARD should get a sign. * Fixed pc.is_gm() from Quest. Before it only triggered when GM_HIGH_WIZARD or higher. Now also triggers at GM_LOW_WIZARD. If you wanna restrict to higher gm classes, use pc.is_gm_safe() * Fixed a few coding issues * /reload a does now only for GM_SUPERADMIN. No one else can reload the admin table. Superadmins will be reloaded with reload a, too! Note that you can still use the API if it's enabled, there you can reload a. * Using restricted commands (kick, ban, exile, demote, etc..) on players with higher rank than yours or on players with GM_SUPERADMIN will now push a notice message to the target, informing him/her about the attempt to use this command. AND it informs about the player that issued the command. How can you use GM_SUPERADMIN in the most recent build? Just edit your common.gmlist table. There you can find the column mAuthority . Just add SUPERADMIN as a new entry. Now you can use it to define characters as GM_SUPERADMIN.
  20. Thank you for your interest. I'm glad that someone can still learn from an amateur like me. I'll gladly share the core with you once it's ready, I'm still ironing out some bugs and make some last final changes. Just drop me a pm and I'll add you to the list of testers. Vanilla Core is compatible with either clients with 34k or 40k binary. 40k is highly recommended. The links are down but you can test the new release once it's ready for testing
  21. Vanilla

    open Lua return from select

    I'm not 100% sure if you can do this on Metin2, but lua has a goto statement too. http://lua-users.org/wiki/GotoStatement If that's possible there you can just use it and "return" back to the prior code. But I absolutely hate goto stuff... So use it at your own risk, I'm not even sure if Metin2 can handle it
  22. Vanilla

    open Lua return from select

    There are many options how to approach this. You'd write this stuff into a function and just call it again once the player chooses "Close". Note that you'd at least give the player an option to properly exit the function, otherwise you're calling it recursive with no getting out, trapping the player in an endless loop of hopelessness. People start to forget the player's name as they're fading into oblivion, down the spiral of endless torture as they loose their understanding of time and space and their existence enters nothingness. tl;dr: Recursive function is the key, but make sure you let the player exit it somewhere.
  23. I'm sorry for the inconvenience. I'll definitely make one new rev and upload it. If there's more interest, I'll make further development. This new release focuses on another security batch and more stability since the last release indeed had some problems. I've fixed the query stuff and changed a bit here and there... I also added a new GM Rank that will help server admins keep control over the environment even if things are going bad (like e. g. some GM/Admin going crazy and stuff..) For now the new featureset looks like this: * c++2a compatibility * cryptopp 8.2.0 * boost 1.7.0 * changed DirectQuery implementation to always return unique pointers * DirectQuery: dropped variables for proper deallocation once they are no longer needed * Some minor and major code fixes (new rev was in development for a long time, couldn't get all the stuff that I changed) * Changed warning "not in unify mode" to just a small attention on boot-up. This makes it less "Oh no please stop!" and more like a hint * New GM Mode SUPERADMIN * Added compatibility to MySQL 8.0 which will be used in the future. * Removed unnecessary library dependencies * Changed Makefile to now compile and include debug/release libraries correctly SUPERADMIN is a new keyword. You can add it to your gmlist. It has all the privileges IMPLEMENTOR has but it has some protections to make sure you keep access. SUPERADMIN is protected against demotion for example. He does not have to elevate and can use GM powers without limitation. Additionally, the /promote command can not promote someone to SUPERADMIN. The only way to add it is via gmlist. Also /reload a does not affect Superadmin, only a server restart can promote/demote a super admin. SUPERADMIN cannot be /dc and have a godmode, so they can't be killed. Also they'll have all IMMUNE flags no matter what. Note that players with SUPERADMIN status should only be used as an emergency account. It is not meant to prevent damage when an Admin goes rampage. It's meant to be used as a counter-measurement to take back control of the server if something really goes bad or maybe demote admins Quest functions: + bool is_superadmin() returns true or false depending if the player has the SUPERADMIN rank or not. Commands: + /demote [PlayerName] Removes and deactivates elevation for the target user. Does not work on players with higher rank and does not work against SUPERADMIN. Demotion also applies a status that prevents the player from elevating again unless he relogs + /exile [PlayerName] Revokes elevation and strikes him from the gmtable+gmlist thusrendering him unable to elevate again. This comand does not work against SUPERADMIN. Also, this command does not work against players with higher rank and minium rank IMPLEMENTOR is needed. * /ban /dc /kill /warp /transfer These commands do not work on players with SUPERADMIN status. Note that players with SUPERADMIN can still use these commands. So this is the changelog for now. This is planned and I need some people to test it. Just drop me a pm and I'll gladly send you a test build within the next few days. Also, if you have any thoughts/suggestions/ideas I'd love to hear them.