Jump to content

Vanilla

Developer
  • Posts

    471
  • Joined

  • Last visited

  • Days Won

    58
  • Feedback

    0%

Everything posted by Vanilla

  1. what is get_time() and how is it defined? Looks like that one is broken. Due to it being broken you may get weird values. Please also check your player.quest table and look for the "regiwait" questflag for this specific player. I'm pretty much sure it's the get_time() function that's wrong here. Maybe you wanted to use get_global_time() instead?
  2. File cannot be downloaded, please post in CODE-tag here so we can help you with it. The problem is just a warning. You have a comparison in this very line that always leads to false. And why is that so? Well, the warning pretty much explains it: Limited range of data types. Since it looks like you tried to upload char_item.cpp I'll give you an example of this error: unsigned int itemid = GetID(); //GetID() is defined in item.h and returns DWORD, which equals unsigned int if(itemid < 0) //Comparison always false due to unsigned int being unable to hold a negative value. { //Will never be executed! } In this example we call GetID() which is defined in item.h and returns a DWORD value. DWORD equals unsigned int. And as we know, unsigned means that this variable cannot contain negative values. If we now try to do the comparison like above (check if it's lower than 0, meaning negative value) then the comparison is always false. You'd cast it to int datatype but that's very tricky and not recommended. Especially since you're dealing with a comparison here... You can also just edit the comparison to be more reasonable with the datatype. If you by any chance get the same problem with with function calls to APIs you may or may not be forced to cast it to int instead. I recommend you reading further information if you wanna do this (for example [Hidden Content]).
  3. Yes, that's absolutely true. You're literally overwriting the current item being hold at this position. This is actually the standard procedure and should be handled like this in every normal case. Like if you wanna upgrade equipment and stuff... But if you're going to do that to stones etc. you might as well just make it a bit different. What you need to do is check for free space in the players inventory and use this instead of the current position. If there is no free space, you may also be able to just drop the item with ownership and let him pick it up one he made some room. You have plenty examples of this procedure, especially in char_item.cpp. Here is one I adapted. Note it's just an example, you may wanna use pkNewItem you have in your code instead for the new item: if(item->GetCount() > 1) { int pos = GetEmptyInventory(item->GetSize()); if (-1 == pos) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소지품에 빈 공간이 없습니다.")); break; } LPITEM newitem = ITEM_MANAGER::instance().CreateItem( item->GetVnum(), 1 ); newitem->AddToCharacter(this, TItemPos(INVENTORY, pos)); } You can even adapt this code to the function you already mentioned, just use the pkNewItem you created instead ? Last but not least here is the code snippet if you wanna issue a drop item with ownership. You can replace the case if the player has no empty cell in inventory left. PIXEL_POSITION pos = GetXYZ(); LPITEM newitem = ITEM_MANAGER::instance().CreateItem( item->GetVnum(), 1 ); newitem->AddToGround(GetMapIndex(), pos); newitem->SetOwnership(this); newitem->StartDestroyEvent(); pos.x += number(-7, 7) * 20; pos.y += number(-7, 7) * 20; This example does issue a drop with ownership, obviously only if you place it within a function inside CHARACTER class (otherwise add LPCHARACTER pointer to it so you can get coordinates and stuff). In the code example you gave me above you're fulfilling that, so you might as well just place in the new code. Just remember: You may wanna use your pkNewItem instead. Note that you may also make a type an subtype check to make sure you're not refining equipment with this. But yeah, as long as you cannot refine a stack of swords it'd just work pretty fine, I just wanted to mention it in case something happens that I did not think of. Just to make sure no one can exploit something.
  4. Attachment is unaccessable. Maybe you'd quote your error in here?
  5. With upgrade you mean refining them? If that's the case than look at the way metin2 handles refining. If I'm not mistaken the item gets removed and then a new, refined one, is given to the player with same attributes/etc.. But it's just from my memory. That'd explain why your stone stack is missing because the refinement shouldn't check for a higher quantity, usually it was just meant for single equipment to be used with.
  6. You can try and add the following to get more debug info on what item you actually have here. Change: sys_err ("WTH! Invalid item owner. owner pointer : %p", item->GetOwner()); to: sys_err ("WTH! Invalid item owner. %d owner pointer : %p", item->GetVnum(), item->GetOwner()); This should print out the vnum that's causing problems. Additionally, if you wanna try to make it crash-safe you'd return the function after it raises such an error. Though that could cause undefined behavior, so be careful with that. Actually a missing owner is not the problem here. I think your core crashes when it tries to access a wrong pointer to your item. In short: It tries to access invalid memory. Thus leading to the crash. Please look at char_item.cpp on line 550 and tell us what this line exactly is, so we can see what's getting called exactly that causes the crash.
  7. No need to pay for a system.. But thanks for advertising your services in a question thread, that will definitely help users. You have many ways of doing it. Some of these may include using lua to code a quest that does the job for you. You can either trigger it yourself or - if you have some stuff like the vanilla source (even old releases should have this) you can even trigger a server_timer to fire off once the boss should spawn. But this is just more convenient, you can also just login or let the quest trigger once a gm/player logs in for the first time. There are many ways to do this. As soon as you trigger spawn you can just re-use the timer. Next you need to check if the mob already exists (not killed, so we won't spawn to instances of the mob). You can just do it via event flag for example but this is prone to err if your server crashes for some reason. So make sure you clear the event flag at the beginning of the quest so it doesn't get stuck. As soon as a player kills the boss, you can change the flag back and thus making it able to respawn it. It's just one of many approaches to do it. Source work should do the magic too, but most people don't know how to do it so maybe lua is the easierst and safest way to go.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. 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.
  15. 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.
  16. 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.
  17. 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
  18. 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.
  19. 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.
  20. 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.
  21. 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.
  22. @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..
  23. 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
  24. 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.
  25. 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
×
×
  • 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.