Jump to content

Mind Rapist

Active Member
  • Posts

    548
  • Joined

  • Last visited

  • Days Won

    6
  • Feedback

    0%

Everything posted by Mind Rapist

  1. F5 - At least give me something to start looking for a fix... Anything useful.
  2. Please do this I'm looking for it. I'm also looking for the Guild window update. Thanks!
  3. Hi, I noticed a strange bug about level updates so I thought to post here. I followed this guide: but this is just for the text above the character's head. I have recorded the bug in this video: I believe the video is pretty explainatory but for those who fail to see it in a clear resolution, the GM levels-up the character 'Claniaris' (Lv. 40) to Lv. 50. Then, she adds him into her Guild. When Claniaris opens the Guild utility window and navigates to Guild members, you can see that the displayed level is still 40. Also, in the GM client, his level is also still 40. Is there a guide or something that can help with this bug? Thank you for your time.
  4. Excuse me for bringing up this old topic but how do I add support for Unicows in a source that has nothing about this lib?
  5. Thanks for the response, the errors are gone! I believe leaving everything at MyISAM will work for the time being.
  6. Hi, I updated my Storage Engine as 'Aria' and now I'm getting this syserr: So far, I experience enviromental update problems (the character moves to it's own window, but other people see them sitting in the spot they were before they moved). Is there something missing from the guide? I also followed this thread: to convert my source. XtraDB is not available in Navicat->Design table->Options->Storage Engine. Query returns Unknown storage engine 'XtraDB'. Does someone know how to fix this?
  7. Hi, first of all, you need to be ready to experiment in order to deal with this source. This is not a source for the dev type of "I want a full working source, 1-click installable", NO! This source is a maze, you have to find your way inside it in order to make it work. Before I begin explaining the basics about Vanilla Core, read this comment of mine if you have no idea what Serverfiles, source code, client and binary source is. When you do so, read the rest of this post if you wish to undestand the basics of the Vanilla core. Firstly, by choosing to spend your time and energy on this source I assume you are a person that likes evolution and the motto New is always better suits to your needs. If this is the case, congratulations, this is a powerful mindset for a developer, young or experienced. New is indeed always better (unless talking about beta, unstable versions) because new = updated and updated = more stable, more secure, more featured. I advice you to upgrade your software to FreeBSD 12, either by installing a fresh VM, or executing those commands under your current version: # freebsd-update fetch # freebsd-update install # reboot Second thing: FreeBSD >= 10 has libc++ and libxxrt pre-installed, you won't find them in ports, so there goes that. Now you need to install: devel/clang-devel lang/lua53 security/cryptopp archivers/lzop graphics/devil and maybe archivers/zip,unzip,rar,unrar, as well as devel/boost-all devel/googletests sysutils/htop (requires FreeBSD sources build) your database by cding into the appropriate directories and using make install clean, do not install through ports. Ports install a pre-compiled, more generic version of the port, while make compilers the port at your system, according to your system specific needs, so it's like the port was designed for this specific machine to work in. The only esception is DevIL, in which you only need the JPEG parts, so you can install it by pkg install devil. This assumes you have already installed: devel/gmake lang/python devel/makedepend which are required for all source builts. Now, your database. In order to run your server you need the database server port, but to compile a source, you also need client or connector-c, one of them should be enough. The default Metin2 source works on MySQL, but if you want something more stable and fast, go with MariaDB. To convert your source to MariaDB, follow this topic and maybe this one as well. To install MySQL 5.7: # cd /usr/ports/databases/mysql57-server # make BUILD_OPTIMIZED=yes BUILD_STATIC=yes # make WITH_XCHARSET=all install clean # ee 'mysql_enable=YES' >> /etc/rc.conf # cd /usr/ports/databases/<mysql57-client OR mysql-connector-c> # make install clean To install MariaDB 10.3, follow the instructions above and replace mysql-57 with mariadb103. Note: When you install the server, make sure you run service mysql-server start weither it's mariadb or mysql, the command is the same. When you do that, reboot before unpacking anything in /var/db/mysql. Once you complete all these there are some source modifications Vanilla didn't make, but are required in order to compile in C++17. This source compiles only in C++17, as it uses port libs, and cryptopp (700) which is installed from ports, compiles only in the specific C++ version. If you attempt to compile the game in any other C++ version, you will get a linking error in the end, which will suck bananas Before compiling game and db, make sure you compile the sources in the Internal folder first, and move the compiled files into /usr/local/lib (unless you sprcify a different LIBDIR in your game/db Makefiles). The Internal projects' outputs will be located in the corresponding project/lib directory. For example, the output for libgame is Internal/libgame/lib/libgame.a, that libgame.a, must be copied in /usr/local/lib. Every project outputs a *.a file in the lib folder, except liblua, which outpus 2 files (lib/liblua.a and lib/liblualib.a). Once you're done with all Internal projects, proceed to vanilla_source folder projects. Note: game does not compile in C++17 by default, in order to do so, go in your Makefile and change the -std CFLAG into: -std=c++1z and that should do it. If you need any tips and advices on how to convert your source into C++17, I haven't solved all the bugs yet, but my game and db runs, so feel free to contact me in the Messenger, but for both our sakes, please do a research in this forum first. I hope these are clear enough for averyone with the question "How to start with Vanilla Core r_71480" and "How do I use the latest FreeBSD features to compile Metin2 source code" Best regards
  8. Hey, welcome to the forum. I tried your idea but I got the same. Thanks for trying anyway
  9. Fun fact, exp works normally What doesn't work is making the guild...
  10. Since I haven't got much experience (yet) with C++, dealing with more modern source structures can be really challenging for me, especially in Linux enviroments, where virtual help like Visual Studio and Intellisence are not available. It's been 2 months since I started discovering C++17 and with the help of the community (that's you guys) I learned a lot! One of the most challenging parts were converting an old-written source into a C++17 compilable project and some of the most struggling moments I had was converting the old function FuncQuery(std::bind1st(std::mem_fun(code...), this), "QUERY FOR DATABASE"); into something acceptable towards the compiler. I ended up with the new bind from the std library: FuncQuery(std::bind(std::mem_fn(code), this, std::placeholders::_1), "QUERY FOR DATABASE"); and lambda functions: FuncQuery([this](auto&& data) { return MyClass::MyVoid(data); }, "QUERY FOR DATABASE"); Those conversions took place in a few files of the game source, but most of them were needed in guild.cpp. So my question is this: Is there something wrong with this conversion? Is there a more stable way for the specific game? And most important: Could this conversion be the reason for core/query/other errors or bugs? Let me know what you think! Best regards
  11. Your multiple commented lines confused even you! What you have here basically is this: void CInstanceBase::SetAcce(DWORD eAcce) { if (IsPC() == false) return; if (pItemData->GetType() == CItemData::ITEM_TYPE_COSTUME && pItemData->GetSubType() == CItemData::COSTUME_ACCE) m_awPart[CRaceData::PART_ACCE] = eAcce; m_GraphicThingInstance.SetAcce(eAcce); } So what you need to do is: Uncomment the second if statement. Define pItemData in InstanceBase.h (don't ask how or what type, I only see this part of the source, no idea of what you're trying to accomplish) As I see you should probably go with the first option, but again, I don't know what you are doing with this so you know better which one is your solution. Best regards
  12. This is the most awesome release I saw today. It would be very cool if mob_proto related source was released as well... I would do it but it's a bit above my expertese since I just started developing (more professionally) for Metin2 and I'm missing a lot of information like the constructional idea of the new proto, what should be added, how they should function, etc... But I believe for someone who know their way around those sources and have an idea of what they try to achieve, this project shouldn't be hard. Thank you so much for the release Best regards
  13. As you can see in the photo below, I noticed that my costumes and hair costumes are very blurry. I did a little research but I couldn't find anything useful, so I thought asking here. Anyone dealt with similar problems in the past?
  14. Thanks, it worked. Although I found something else. Seems like what I was trying to do was to copy these lines for every command that the player gives to the game (horse riding for example): if (ch->m_pkTimedEvent) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("취소 되었습니다.")); event_cancel(&ch->m_pkTimedEvent); } Is there a more generic way of doing this for all of the commands and for [SPACE] pressing, equipment change/remove, item moving, etc?
  15. Thanks, packets became very clear now. It worked so I added that to a few packets but for some reason I cannot logout now. Just sitting there, hitting logout and the countdown never starts. I reviewed the affected packets but I don't seem to understand why this is happening. Here is a list of the packets I edited: HEADER_CG_CHAT HEADER_CG_WHISPER HEADER_CG_ITEM_USE HEADER_CG_ITEM_DROP HEADER_CG_ITEM_DROP2 HEADER_CG_ITEM_MOVE HEADER_CG_ITEM_PICKUP HEADER_CG_ITEM_USE_TO_ITEM HEADER_CG_ITEM_GIVE HEADER_CG_EXCHANGE HEADER_CG_ATTACK HEADER_CG_SHOOT HEADER_CG_USE_SKILL HEADER_CG_SHOP HEADER_CG_MESSENGER HEADER_CG_SAFEBOX_CHECKIN HEADER_CG_PARTY_INVITE HEADER_CG_PARTY_ANSWER HEADER_CG_PARTY_USE_SKILL HEADER_CG_ANSWER_MAKE_GUILD HEADER_CG_FISHING HEADER_CG_MYSHOP HEADER_CG_REFINE HEADER_CG_DRAGON_SOUL_REFINE Each time, I added the timed_event_cancel right above break;
  16. You need a third argument for these. You can make a research of what exactly this argument is or use mine here. template <typename T> T MIN(T a, T b) { return a < b ? a : b; } template <typename T> T MAX(T a, T b) { return a > b ? a : b; } template <typename T> T MINMAX(T min, T value, T max) { T tv; tv = (min > value ? min : value); return (max < tv) ? max : tv; } I hope it helps.
  17. Replace MIN, MAX, MINMAX with std::min, std::max, std::minmax, you don't need those functions from stl.h. Don't forget to #include <algorithm>
  18. Exactly. Might seem a small system at first, but if you think about it many languages could use this to develop systems for better dialogs or information. GJ man
  19. Thanks, well I got this: error: use of undeclared identifier 'timed_event_cancel'; did you mean 'event_cancel'? I searched for the function but I couldn't find it in any header file (*.h) to include, so I thought asking here before I mess this up. Also a few questions came up. Is there a generic file which handles sent packets (like input_main.cpp for received packets) and 2nd: timed_event_cancel is only about the logout event, or there are more timed events handled by this? EDIT: I also tried event_cancel(&m_pkDisconnectEvent); and included desc.h of course but I'm still getting compiling errors: error: use of undeclared identifier 'm_pkDisconnectEvent'
  20. I'm having a problem creating guilds. When I type the name and continue, the guild is created, everything is normal in the database, but the character does not update at all. My db syserr has this: GuildAddMember: Query failed when getting guild member data SELECT `pid`, `grade`, `is_general`, `offer`, `level`, `job`, `name` FROM guild_member, player WHERE `guild_id` = 432 and `pid` = `id` and `pid` = 191 I checked the source, there is no difference from other files, but here is the function anyway: void CClientManager::GuildAddMember(CPeer* peer, TPacketGDGuildAddMember * p) { CGuildManager::instance().TouchGuild(p->dwGuild); sys_log(0, "GuildAddMember %u %u", p->dwGuild, p->dwPID); char szQuery[512]; snprintf(szQuery, sizeof(szQuery), "INSERT INTO guild_member%s VALUES(%u, %u, %d, 0, 0)", GetTablePostfix(), p->dwPID, p->dwGuild, p->bGrade); CDBManager::instance().AsyncQuery(szQuery); snprintf(szQuery, sizeof(szQuery), "SELECT `pid`, `grade`, `is_general`, `offer`, `level`, `job`, `name` FROM guild_member%s, player%s WHERE `guild_id` = %u and `pid` = `id` and `pid` = %u", GetTablePostfix(), GetTablePostfix(), p->dwGuild, p->dwPID); std::unique_ptr<SQLMsg> pmsg(CDBManager::instance().DirectQuery(szQuery)); if (pmsg->Get()->uiNumRows == 0) { sys_err("Query failed when getting guild member data %s", pmsg->stQuery.c_str()); return; } MYSQL_ROW row = mysql_fetch_row(pmsg->Get()->pSQLResult); if (!row[0] || !row[1]) return; TPacketDGGuildMember dg; dg.dwGuild = p->dwGuild; str_to_number(dg.dwPID, row[0]); str_to_number(dg.bGrade, row[1]); str_to_number(dg.isGeneral, row[2]); str_to_number(dg.dwOffer, row[3]); str_to_number(dg.bLevel, row[4]); str_to_number(dg.bJob, row[5]); strlcpy(dg.szName, row[6], sizeof(dg.szName)); ForwardPacket(HEADER_DG_GUILD_ADD_MEMBER, &dg, sizeof(TPacketDGGuildMember)); } EDIT: I just remembered that when I was starting with this source I had to edit the guild.cpp file in order to be compatible with C++17, so I changed some of the bind1st(mem_fun(...)) into std::bind(...). The error is referring at the db query but here are the changes in guild.cpp in case it helps: void CGuild::Load(DWORD guild_id) { Initialize(); m_data.guild_id = guild_id; DBManager::instance().FuncQuery(std::bind(&CGuild::LoadGuildData, this, std::placeholders::_1), "SELECT master, level, exp, name, skill_point, skill, sp, ladder_point, win, draw, loss, gold FROM guild%s WHERE id = %u", get_table_postfix(), m_data.guild_id); sys_log(0, "GUILD: loading guild id %12s %u", m_data.name, guild_id); DBManager::instance().FuncQuery(std::bind(&CGuild::LoadGuildGradeData, this, std::placeholders::_1), "SELECT grade, name, auth+0 FROM guild_grade%s WHERE guild_id = %u", get_table_postfix(), m_data.guild_id); DBManager::instance().FuncQuery(std::bind(&CGuild::LoadGuildMemberData, this, std::placeholders::_1), "SELECT pid, grade, is_general, offer, level, job, name FROM guild_member%s, player%s WHERE guild_id = %u and pid = id", get_table_postfix(), get_table_postfix(), guild_id); } void CGuild::P2PChangeGrade(BYTE grade) { DBManager::instance().FuncQuery(std::bind(&CGuild::__P2PUpdateGrade, this, std::placeholders::_1), "SELECT grade, name, auth+0 FROM guild_grade%s WHERE guild_id = %u and grade = %d", get_table_postfix(), m_data.guild_id, grade); } void CGuild::AddComment(LPCHARACTER ch, const std::string& str) { int player_id = ch->GetPlayerID(); if (str.length() > GUILD_COMMENT_MAX_LEN) return; char text[GUILD_COMMENT_MAX_LEN * 2 + 1]; DBManager::instance().EscapeString(text, sizeof(text), str.c_str(), str.length()); DBManager::instance().FuncAfterQuery([this, player_id] { return this->RefreshCommentForce(player_id); }, "INSERT INTO guild_comment%s(guild_id, name, notice, content, time) VALUES(%u, '%s', %d, '%s', NOW())", get_table_postfix(), m_data.guild_id, ch->GetName(), (str[0] == '!') ? 1 : 0, text); } void CGuild::SkillLevelUp(DWORD dwVnum) { DWORD dwRealVnum = dwVnum - GUILD_SKILL_START; if (dwRealVnum >= GUILD_SKILL_COUNT) return; CSkillProto* pkSk = CSkillManager::instance().Get(dwVnum); if (!pkSk) { sys_err("There is no such guild skill by number %u", dwVnum); return; } if (m_data.abySkill[dwRealVnum] >= pkSk->bMaxLevel) return; if (m_data.skill_point <= 0) return; m_data.skill_point --; m_data.abySkill[dwRealVnum] ++; ComputeGuildPoints(); SaveSkill(); SendDBSkillUpdate(); for_each(m_memberOnline.begin(), m_memberOnline.end(), std::bind(&CGuild::SendSkillInfoPacket, *this, std::placeholders::_1)); sys_log(0, "Guild SkillUp: %s %d level %d type %u", GetName(), pkSk->dwVnum, m_data.abySkill[dwRealVnum], pkSk->dwType); } void CGuild::GuildPointChange(BYTE type, int amount, bool save) { switch (type) { case POINT_SP: m_data.power += amount; m_data.power = MINMAX(0, m_data.power, m_data.max_power); if (save) { SaveSkill(); } for_each(m_memberOnline.begin(), m_memberOnline.end(), std::bind(&CGuild::SendSkillInfoPacket, *this, std::placeholders::_1)); break; case POINT_EXP: if (amount < 0 && m_data.exp < (DWORD) - amount) { m_data.exp = 0; } else { m_data.exp += amount; while (m_data.exp >= __guild_levelup_exp(m_data.level)) { if (m_data.level < gguild_max_level) { m_data.exp -= __guild_levelup_exp(m_data.level); ++m_data.level; ++m_data.skill_point; if (m_data.level > gguild_max_level) m_data.level = gguild_max_level; ComputeGuildPoints(); GuildPointChange(POINT_SP, m_data.max_power-m_data.power); if (save) ChangeLadderPoint(GUILD_LADDER_POINT_PER_LEVEL); // NOTIFY_GUILD_EXP_CHANGE for_each(m_memberOnline.begin(), m_memberOnline.end(), std::bind(&CGuild::SendGuildInfoPacket, this, std::placeholders::_1)); // END_OF_NOTIFY_GUILD_EXP_CHANGE } if (m_data.level == gguild_max_level) { m_data.exp = 0; } } } TPacketGCGuild pack; pack.header = HEADER_GC_GUILD; pack.size = sizeof(pack)+5; pack.subheader = GUILD_SUBHEADER_GC_CHANGE_EXP; TEMP_BUFFER buf; buf.write(&pack,sizeof(pack)); buf.write(&m_data.level,1); buf.write(&m_data.exp,4); for (TGuildMemberOnlineContainer::iterator it = m_memberOnline.begin(); it != m_memberOnline.end(); ++it) { LPDESC d = (*it)->GetDesc(); if (d) d->Packet(buf.read_peek(), buf.size()); } if (save) SaveLevel(); break; } }
  21. Thanks, but I guess the problem was fixed after changing the encoding in the locale_string.txt... Again... It's kinda like trying to plug-in a USB I guess...
×
×
  • 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.