metin2united

Vanilla

Developer
  • Content Count

    376
  • Joined

  • Last visited

  • Days Won

    51

Everything posted by Vanilla

  1. 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
  2. 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
  3. 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.
  4. 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.
  5. @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..
  6. 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.
  7. 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
  8. 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
  9. 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.
  10. 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.
  11. You're the only one that actually replied here to this. No PMs, nor anything else. I can do another build but as I said, the effort is not worth it if there's only 3-4 people using it... If there are more people interested, please let me know.. At least a pm or something so I can see that there's still interest in this project.
  12. Vanilla

    Please nooooooo

    Yes, because critics about a logo and it's meaning == homophobia I already said in the shoutbox that I dislike it. The community is about metin2, not about gay pride and stuff... And I highly dislike how companies try to shove the "you have to like them!" in our faces. Yes, we'd all tolerate different sexuality, but please, can we not be forced into seeing it around every corner because it's soooo super important to show the world how much of a superior moral standard we have? Can't we just leave everyone be and focus on the things that are actually the core theme of this board and the very reason it exists in the first place? At least that's my cricits. You can call me homophobic if you want but I see it nothing less than just avoiding critics and blaming everyone else. And even if it was homophobic, would it take the arguments against it magically away? I think not...
  13. There's almost none interest in the project from the community so I stopped releasing a new build. If there's enough interest, I'll make another release but as things stand right now the time and effort put into this project just isn't worth it if only 3-4 people really use it..
  14. Vanilla

    open No .core BSD/top game %100 Used

    Did you change anything on the source? Do you have logs from syserr/log at the time the CPU ramps up? If there's an operation that triggers such a behavior there's a chance it's written to the logs.
  15. Vanilla

    open No .core BSD/top game %100 Used

    most likely a faulty quest that keeps the cpu in a loop. Check your quests, you can also run the server without having any single quest so you can see if the core still gets stuck.
  16. Hello everybody, since I've heard that a lot of servers (and even the most recent vanilla source release) have no fix for this hack I decided to release this. It's not too big, but I really would like to make it visible for everybody. I highly dislike hacks in every form and I'll gladly develop such fixes. So, the fix is quite easy. It's a bug from metin2. They decided to add a check if the target is too far away to be attacked and yeah, that works. Targets only receive damage once they're within range. But the problem is that modern moblock tools do that a different way. They send attack packets to every mob in the near surrounding which triggers aggr towards the player. You may ask: Why does it trigger aggr and let the mobs move to the player? Well, as mentioned, the source has a fix for that - but it's implemented too late. 1. Open char_battle.cpp and search for this function: CHARACTER::Attack First you may notice that there's literally no check for distance. The distance check is implemented in battle.cpp in the function battle_melee_attack. That's fine and we don't need to modify anything about this. 2. If you scroll down you'll see the following lines: pkVictim->SetSyncOwner(this); if (pkVictim->CanBeginFight()) pkVictim->BeginFight(this); Noticed something? Yeah, the check is - as mentioned before - in the function battle_melee_attack. The problem is, that these lines are executed before the check happens. So hackers will be visible in logfiles (syslog should spam distance errors) but they're still free to hack like they want to. 3. Move the lines below the battle type segment So, how do we fix this? We'd simply move it down below the battle type functions. So you'd move it just before the line "if (iRet == BATTLE_DAMAGE || iRet == BATTLE_DEAD)". But still that won't be enough since these lines would still be executed. We don't want them to be executed. So we wrap a condition around it. 4. modify these lines so they look like this: if(iRet != BATTLE_NONE) { pkVictim->SetSyncOwner(this); if (pkVictim->CanBeginFight()) pkVictim->BeginFight(this); } If we take a look on the battle type functions we'll notice that they return the BATTLE_NONE if something goes wrong - for example the distance is invalid. 5. you're done! The fix pretty much solves this issue. If you still know hacks that work feel free to write in this topic, I'll gladly share solutions once I've developed them. Enjoy!
  17. Hey there, I've got a critical error which leads into a trash gamefile if not solved. I don't know when exactly it happened (I reverted the last changes I made to the source code but still the error occurs). That's why I'm asking here. It stops me from finishing vanilla 2.2 so help could be great for everyone. Now to my problem: It seems the gamecore can't read the coordinates where players are located. When I log in (after char creation or simply using an existing character) I get disconnected shortly at the beginning of the loading screen. The following syserr occurs: The problem is: these are NOT the coordinates I have. My character stands at x=469300 y=964200 map_index=1 which should clearly be the red empire. Coordinates are valid too (if I used another gamecore everything works well). I also made a "prevent-this-bug" with adding an error handler which resets your x,y and map_index if you land on coordinates you shouldn't land (which would cause disconnects, you may know this). But still after resetting the coordinates the error is still there. Additionally when I use another core, I can log in AND see that the caracter is completely messed up. Some Stats are totally weird (somewhere over 9000) and I can distribute a stat point even if I'm level 1 with no exp. So I guess there's a problem with handling player information (reading and writing). Maybe someone could help me if you got the same problem once or maybe know where it'd be located (since the source is huge and I'm already looking into the connection game<->db without success) €: Problem solved. Shouldn't edit the length.h so careless.
  18. Vanilla

    open freebsd 13.0 source compile

    You can safely remove the source files but you need to keep the header files inside the include folder. Otherwise your source won't compile. And, obviously, you need the built libraries.
  19. Vanilla

    open freebsd 13.0 source compile

    yep this looks like it. CryptoPP utilizes c++17 which you don't use. I've had the same issue. You need to add -std=c++17 to your compiler flags, linking should work then. But you're probably gonna end up having another issue because compiling will fail on some files due to removed functions (std::mem_fun for example).
  20. Vanilla

    open freebsd 13.0 source compile

    Are you using a more recent std? Probably c++17? Because cryptopp 7.0 is meant to be used with that and it'd explain an issue I've got when upgrading this stuff.. I can't see the screenshots you posted. Could you please reupload?
  21. I did not abandon the project but due to personal rl issues I wasn't able to do much. I'm sorry for the lack of updates. Things will change starting next year. So stay tuned, I'm gonna release a new version once I'm done with the rl stuff.
  22. 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.
  23. Vanilla

    c++ Fix Moblock/bravery cape hack

    Thanks for testing it. Can you send me a syslog snippet? You can also play with the values and adjust them to your needs. The fix for bravery cape hack doesn't involve a kick. The kick is only triggered by the speedhack detection, so there's either something wrong with it or the values need to be adjusted.
  24. Vanilla

    c++ Fix Moblock/bravery cape hack

    Care to enlighten me then?
  25. Vanilla

    c++ Fix Moblock/bravery cape hack

    I don't even remember doing this It'd be, but I honestly have no idea. @_Sielu Why so complicated? We already have a working solution and this is the speedhack check. It's working fine and I think a counter is better to store than walking through a vector every time a damage packet goes it's way.