Search the Community

Showing results for tags 'c++'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community
    • Announcements
    • Feedback
  • Metin2
    • General
    • Questions and Answers
    • Guides & HowTo
    • Design
    • Private Servers
    • Services
    • Videos
  • Releases
    • General
    • Tools
    • Programming / Scripts
    • Quests
    • Binaries & Clients/Serverfiles
    • 3D Models
    • 2D Graphics
    • Operating Systems
  • Safe Zone
    • Offtopic
    • Games Talk
    • Music/Videos/Art
  • D:\YMIR WORK\'s Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Discord


Skype


ICQ


Yahoo


Location

Found 333 results

  1. xP3NG3Rx

    Emoji in TextLine

    Hi, folks! With this guide you will be able to combine textlines with images, like rubinum does. Usage is simple: emojiTextLine.SetText("|Eemoji/key_ctrl|e + |Eemoji/key_x|e + |Eemoji/key_rclick|e - Direct sell") The files are located in the icon pack, so basically the code will load from icon/{GIVEN_PATH}.tga - in the sample the path for the X is: icon/emoji/key_x.tga Here are the images from rubinum client:  Howto: Have fun Sorry for arab players , for sure they have also developers, so let's go guys, finish it If you have problem, maybe I made a mistake in the guide of missed out something, just leave a comment below. PS.: Sometimes the code tag of the board puts an extra invisible character mostly the end of the lines, if your IDE cries for syntax error, but it seems correct, check that part of the file with notepad++, it will show a ?(question mark) where the problem is.
  2. M: https://i.gyazo.com/d84d73b41414acb3e4570fb9ae7fd049.mp4 F: https://i.gyazo.com/b3ae946b25c4b0f81c6d4dcd1a4b9e29.mp4 GitHub repository: https://github.com/Vegas007/Metin2-Extended-Alignment-System 02.03.2019 - Polymorph bug fixed.
  3. Download VirusTotal Metin2 Mini Wiki System
  4. I found this bug at a player on my server and I managed to do some tests in his computer to find the problem. He couldn't open the client because of an error NO_APPROPRIATE_DEVICE To fix the problem comment the lines from below(binary src): If you have a better solution please share it with the community. Note: The player had a laptop with 1360x768 resolution and this was his minimum resolution (he didn't even have 800x600)
  5. https://github.com/blackdragonx61/Metin2-Official-Inventory-Expansion
  6. https://github.com/blackdragonx61/Metin2-Typing-Information--Whisper-
  7. Hello. I saw this stuff on this and on another board also with bugs or it was incomplete, and I made it to myself. Feel free to use it with your brain. Good to know about this: The name of those items which have attributes will be golden. The skillbook and skillforget items will show the name of skill also. If the item isn't yours than the ownership color will be red instead of yellow. * Készségkönyv = Skillbook(id:50300) * Feledés könyve = Skillforget book(id:70037) PS.: If you have problems with the implementation: start to upgrade your programming knowledges and don't disturb me in private message, I won't answer. Thank you for understanding. https://mega.nz/#!KAh3DQqL!yQQX9o4N8sTsS7Woa4W07C8t5jwp0TV5xg7MHLSFz5Y
  8. Hello, I started to convert some server data files from .txt to .json. I intend to convert them more understandable and modern with these changes, also few bugs and a memory leak in the old system has been fixed. Currently only mob_drop_info.txt file is translated, then all .txt files and proto files will be added. Tutorial for mob_drop_info.txt game part: Add to service.h: #define ENABLE_JSON_GAME_FILES Add to stl.h inline std::wstring StringToWstring(std::string input) { std::wstring output(input.begin(), input.end()); return output; } inline std::string WstringToString(std::wstring input) { std::string output(input.begin(), input.end()); return output; } Search in input_db.cpp "%s/mob_drop_item.txt", LocaleService_GetBasePath().c_str()); Change with: #ifdef ENABLE_JSON_GAME_FILES "%s/mob_drop_item.json", LocaleService_GetBasePath().c_str()); #else "%s/mob_drop_item.txt", LocaleService_GetBasePath().c_str()); #endif Search: if (!ITEM_MANAGER::instance().ReadMonsterDropItemGroup(szMOBDropItemFileName)) Change with: #ifdef ENABLE_JSON_GAME_FILES if (!ITEM_MANAGER::instance().ReadMonsterDropItemGroupNew(szMOBDropItemFileName)) #else if (!ITEM_MANAGER::instance().ReadMonsterDropItemGroup(szMOBDropItemFileName)) #endif Search in item_manager.h: bool ReadDropItemGroup(const char * c_pszFileName); Add it under: #ifdef ENABLE_JSON_GAME_FILES bool ReadMonsterDropItemGroupNew(const char * c_pszFileName); #endif Add in item_manager_read_tables.cpp #ifdef ENABLE_JSON_GAME_FILES #include <fstream> #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/json_parser.hpp> #endif Search: bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName) Change like this: https://vgy.me/FC4F2v.png Codes: https://gist.github.com/mq1n/f31e4f1130819c1404b1348c8b28613d Converter: https://github.com/mq1n/M2TxtToJson Note: You need c ++ 11 and boost property tree module to use this configuration.
  9. Description : The mount will follow you. The bonuses is set from item_proto. https://i.gyazo.com/9dac9deaada344672a153f37575d0b13.mp4 https://i.gyazo.com/05713068360a55cbbe25db6761925030.mp4https://i.gyazo.com/de7397f26a0b7aeeb66e1b4ce4af5b0d.mp4 Code is based on default pet code from Ymir, i don't offer support for extra features, details, anyway easy for use. (Sorry for tutorial, not so perfect.) Download: https://mega.nz/#!eMIgVajA!uxIaISsLj3S5BipWsgEHIX4k84AcyGByIcF8DsTfv_E
  10. CxL'Mufuku

    c++ [RLS]RenderTarget

    Hi, I don't think I have to tell much about this. It'll look like the official one, some code is c&p from the official root files. Most of the own written code is NOT like the offical one. I added a new python module ("renderTarget"), so you don't need methods which officials use, like this: "playerm2g2.MyShopDecoShow( True )" You are able to display more than one render target at the same time. If you want to know more, take a look at the code. If there are any bugs, just message me. Download: https://cxl.services/freebies/RenderTarget (CxL).rar Password: Cxl.Services
  11. https://github.com/blackdragonx61/Metin2-SkillBook-Name-Renewal Skill book/polyitem received message: Before: After:
  12. https://github.com/blackdragonx61/Metin2-Official-Block-System
  13. Hello, I have created an automation tool for .core file backtrace analysis, after installing CoreWatcher to monitor a directory, it will automatically analyze when a .core file is created and save its records in a file. Usage: CoreWatcher <target_directory> Notes: You must modify command files according to your own files. File: target server file Core: target server file with .core extension. IMPORANT NOTE: You must put .locked postfix after than .core extension. bt: It's backtrace command. quit: It's required for break gdb dialog. https://github.com/mq1n/CoreWatcher/tree/master Have fun.
  14. Mind Rapist

    open Linker command failed

    When the compiler gets to the game link point, it throws this error: guild.cpp: cipher.cpp: Compiler: c++-devel Crypto++ version: 7
  15. https://github.com/blackdragonx61/Metin2-Sort-Inventory-Items/tree/master/V2
  16. Hello, im looking for someone who can 1.fix country and empire flag by Vegas 2.pvp icons  3.AUCTION HOUSE *if item time expired item going to mailbox if item boughted item going to mailbox if item canceled item going to mailbox...... for more informations msg me Thanks
  17. xP3NG3Rx

    [RLS] Quiver-System

    Hi guys. First of all, I also know this system is public already, but I was boring, so I had to reverse something, so here it is: Quiver System.7z If you have extra systems which might ignore the quivers, you must to extend them by yourself. Just couple of them from the official: acce, costume bonus transfer, change look, skillbook combination, sealbind and so on. Anything is wrong in the guide or missing something let me know, hit a comment below.
  18. Lets do ex: 16x9. I dont know if i something forgot, but its little tutorial how do it, im tired af so sorry for errors THANKS // tables.h #define SAFEBOX_MAX_NUM 135 to #define SAFEBOX_MAX_NUM 432 // Packet.h typedef struct command_safebox_checkout { BYTE bHeader; BYTE bSafePos; TItemPos ItemPos; } TPacketCGSafeboxCheckout; typedef struct command_safebox_checkin { BYTE bHeader; BYTE bSafePos; TItemPos ItemPos; } TPacketCGSafeboxCheckin; // Like that typedef struct command_safebox_checkout { BYTE bHeader; UINT bSafePos; TItemPos ItemPos; } TPacketCGSafeboxCheckout; typedef struct command_safebox_checkin { BYTE bHeader; UINT bSafePos; TItemPos ItemPos; } TPacketCGSafeboxCheckin; // Safebox.cpp if (m_iSize) m_pkGrid = M2_NEW CGrid(5, m_iSize); else m_pkGrid = NULL; // if (m_iSize) m_pkGrid = M2_NEW CGrid(16, m_iSize); else m_pkGrid = NULL; // ------------------------------ if (pkOldGrid) m_pkGrid = M2_NEW CGrid(pkOldGrid, 5, m_iSize); else m_pkGrid = M2_NEW CGrid(5, m_iSize); // if (pkOldGrid) m_pkGrid = M2_NEW CGrid(pkOldGrid, 16, m_iSize); else m_pkGrid = M2_NEW CGrid(16, m_iSize); // ---------------------------------- if (bCell >= 5 * m_iSize) // if (bCell >= 16 * m_iSize) // ---------------------------- int max_position = 5 * m_iSize; // int max_position = 16 * m_iSize; //Search for: LPITEM CSafebox::GetItem(BYTE bCell) //Replace with: LPITEM CSafebox::GetItem(UINT bCell) //Search for: bool CSafebox::MoveItem(BYTE bCell, BYTE bDestCell, BYTE count) //Replace with bool CSafebox::MoveItem(UINT bCell, UINT bDestCell, DWORD count) // Safebox.h //Search for: LPITEM CSafebox::GetItem(BYTE bCell) //Replace with: LPITEM CSafebox::GetItem(UINT bCell) //Search for: bool CSafebox::MoveItem(BYTE bCell, BYTE bDestCell, BYTE count) //Replace with bool CSafebox::MoveItem(UINT bCell, UINT bDestCell, DWORD count) Client/ // Packet.h typedef struct command_safebox_checkout { uint8_t bHeader; BYTE bSafePos; TItemPos ItemPos; } TPacketCGSafeboxCheckout; typedef struct command_safebox_checkin { uint8_t bHeader; BYTE bSafePos; TItemPos ItemPos; } TPacketCGSafeboxCheckin; // -------------- typedef struct command_safebox_checkout { uint8_t bHeader; UINT bSafePos; TItemPos ItemPos; } TPacketCGSafeboxCheckout; typedef struct command_safebox_checkin { uint8_t bHeader; UINT bSafePos; TItemPos ItemPos; } TPacketCGSafeboxCheckin; // PythonNetworkStream.h //Search for: bool SendSafeBoxCheckinPacket(TItemPos InventoryPos, BYTE bySafeBoxPos); //edit: bool SendSafeBoxCheckinPacket(TItemPos InventoryPos, UINT bySafeBoxPos); //Search for: bool SendSafeBoxCheckoutPacket(BYTE bySafeBoxPos, TItemPos InventoryPos); //edit: bool SendSafeBoxCheckoutPacket(UINT bySafeBoxPos, TItemPos InventoryPos); // search for: bool SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, uint8_t byCount); //edit: bool SendSafeBoxItemMovePacket(UINT bySourcePos, UINT byTargetPos, uint8_t byCount); // Python****PhaseGameItem.cpp //Search for: bool CPythonNetworkStream::SendSafeBoxCheckinPacket(TItemPos InventoryPos, BYTE bySafeBoxPos) //edit bool CPythonNetworkStream::SendSafeBoxCheckinPacket(TItemPos InventoryPos, UINT bySafeBoxPos) //Search for: bool CPythonNetworkStream::SendSafeBoxCheckoutPacket(BYTE bySafeBoxPos, TItemPos InventoryPos) //edit bool CPythonNetworkStream::SendSafeBoxCheckoutPacket(UINT bySafeBoxPos, TItemPos InventoryPos) // bool CPythonNetworkStream::SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, uint8_t byCount) // edit bool CPythonNetworkStream::SendSafeBoxItemMovePacket(UINT bySourcePos, UINT byTargetPos, uint8_t byCount) // PythonSafebox.h enum { SAFEBOX_SLOT_X_COUNT = 5, SAFEBOX_SLOT_Y_COUNT = 9, SAFEBOX_PAGE_SIZE = SAFEBOX_SLOT_X_COUNT * SAFEBOX_SLOT_Y_COUNT }; // edit enum { SAFEBOX_SLOT_X_COUNT = 16, SAFEBOX_SLOT_Y_COUNT = 9, SAFEBOX_PAGE_SIZE = SAFEBOX_SLOT_X_COUNT * SAFEBOX_SLOT_Y_COUNT };
  19. FreeWar_official

    [SYSTEM] Controller Mode

    Premise:The system in question is integrated into the client through the use of existing libraries! it was enough to enable it through some modifications of the source and to define the various commands, make the installation very simple and intuitive I assure you! What can i do?It is expected that by the end of the realization of this system you can fully use the client "PG, game windows and maybe even chat", at the moment you can use the PG. Have you a release date?At the moment no, the work still requires the care of many details.Have a video about this system?This V 0.1 Alpha "DirectInput" This V 0.2 Alpha "XInput" This V 0.3 Alpha "New Functions" FEATURES: * Migration to XInput and abandonment of DirectInput support * Adding vibration vibration & low life "PS and Xbox Controller" * QuickSlot that can be recalled by pressing the O (PSX) or B (X360) button * Defined DeadZone "Analog" * Added Settings window "Under construction" * Added virtual keyboard to write in chat and more; * Added character selection via controller; * Addition of Auto-Select NPC / MOB / PG and with the pressure of X (PS) A (XBOX) its relative function; * Added quest and selection navigation; System out now! Contact me! WebSite
  20. masodikbela

    [C++]Expand maximum level

    Hi there Devs, I have published a tutorial yesterday on a Hungarian forum, and I decided to share it here, too. So... I chose int type for the level variables (originally its unsigned char) because: its more than enough maximum level 2147483647the damage done by the characters (and much more thing) is calculated via they levels, and the type of this variables is intThis is why I recommend to use int type game/src char.cpp Search this: void CHARACTER::SetLevel(BYTE level)Then replace to this: void CHARACTER::SetLevel(int level)char.h Search this: void SetLevel(BYTE level);Then replace to this: void SetLevel(int level);Then search: BYTE level; (its under this: typedef struct character_point) And replace to this: int level;party.cpp Search this one: void CParty::P2PSetMemberLevel(DWORD pid, BYTE level)Then replace to this: void CParty::P2PSetMemberLevel(DWORD pid, int level)Then replace this: BYTE CParty::GetMemberMaxLevel() { BYTE bMax = 0;To this: int CParty::GetMemberMaxLevel() { int bMax = 0;Find this one: BYTE CParty::GetMemberMinLevel() { BYTE bMin = PLAYER_MAX_LEVEL_CONST;And replace to this: int CParty::GetMemberMinLevel() { int bMin = PLAYER_MAX_LEVEL_CONST;And then this: void CParty::RequestSetMemberLevel(DWORD pid, BYTE level)To this: void CParty::RequestSetMemberLevel(DWORD pid, int level)party.h Search this: BYTE bLevel; (its under typedef struct SMember)And replace to this: int bLevel;Then this ones: BYTE GetMemberMaxLevel(); BYTE GetMemberMinLevel();To this: int GetMemberMaxLevel(); int GetMemberMinLevel();And these: void RequestSetMemberLevel(DWORD pid, BYTE level); void P2PSetMemberLevel(DWORD pid, BYTE level);To: void RequestSetMemberLevel(DWORD pid, int level); void P2PSetMemberLevel(DWORD pid, int level);char_battle.cpp Find: struct FPartyTotaler { int total;And replace to: struct FPartyTotaler { long total;And this: struct FPartyDistributor { int total; LPCHARACTER c; int x, y; DWORD _iExp; int m_iMode; int m_iMemberCount; FPartyDistributor(LPCHARACTER center, int member_count, int total, DWORD iExp, int iMode) To this: struct FPartyDistributor { long total; LPCHARACTER c; int x, y; DWORD _iExp; int m_iMode; int m_iMemberCount; FPartyDistributor(LPCHARACTER center, int member_count, long total, DWORD iExp, int iMode) config.h Find this: extern BYTE PK_PROTECT_LEVEL;And replace to this: extern int PK_PROTECT_LEVEL;locale_service.cpp Change: BYTE PK_PROTECT_LEVELTo this: int PK_PROTECT_LEVELconstants.cpp Well, here you should decide how much is the maximum level you want. You should fill these tables with as much records, as the maximum level. (e.g if you want to have maximum level 300, you need to put 300 records to these tables) const DWORD exp_table_euckr[PLAYER_EXP_TABLE_MAX + 1] const DWORD exp_table_common[PLAYER_EXP_TABLE_MAX + 1] const DWORD exp_table_newcibn[PLAYER_EXP_TABLE_MAX + 1 ] const DWORD party_exp_distribute_table[PLAYER_MAX_LEVEL_CONST + 1] const int aiExpLossPercents[PLAYER_EXP_TABLE_MAX + 1]log.h Edit this: void LoginLog(bool isLogin, DWORD dwAccountID, DWORD dwPID, BYTE bLevel, BYTE bJob, DWORD dwPlayTime);To this: void LoginLog(bool isLogin, DWORD dwAccountID, DWORD dwPID, int bLevel, BYTE bJob, DWORD dwPlayTime);log.cpp Replace this: void LogManager::LoginLog(bool isLogin, DWORD dwAccountID, DWORD dwPID, BYTE bLevel, BYTE bJob, DWORD dwPlayTime)To this: void LogManager::LoginLog(bool isLogin, DWORD dwAccountID, DWORD dwPID, int bLevel, BYTE bJob, DWORD dwPlayTime)guild.h Replace this: typedef struct SGuildMemberPacketData { DWORD pid; BYTE grade; BYTE is_general; BYTE job; BYTE level; DWORD offer; BYTE name_flag; char name[CHARACTER_NAME_MAX_LEN+1]; } TGuildMemberPacketData;To this: typedef struct SGuildMemberPacketData { DWORD pid; BYTE byGrade; BYTE byIsGeneral; BYTE byJob; int byLevel; DWORD dwOffer; BYTE byNameFlag; } TGuildMemberPacketData;Then this: void ChangeMemberData(DWORD pid, DWORD offer, BYTE level, BYTE grade);To this: void ChangeMemberData(DWORD pid, DWORD offer, int level, BYTE grade);Then SGuildMember(DWORD pid, BYTE grade, BYTE is_general, BYTE job, BYTE level, DWORD offer_exp, char* name);To this: SGuildMember(DWORD pid, BYTE grade, BYTE is_general, BYTE job, int level, DWORD offer_exp, char* name);And this: DWORD pid; // player Ĺ×ŔĚşíŔÇ id; primary key BYTE grade; // ±ćµĺ»óŔÇ ÇĂ·ąŔĚľîŔÇ °č±Ţ 1 to 15 (1ŔĚ ÂŻ) BYTE is_general; BYTE job; BYTE level; DWORD offer_exp; // °řÇĺÇŃ °ćÇčġ BYTE _dummy;To this: DWORD pid; // player Ĺ×ŔĚşíŔÇ id; primary key BYTE grade; // ±ćµĺ»óŔÇ ÇĂ·ąŔĚľîŔÇ °č±Ţ 1 to 15 (1ŔĚ ÂŻ) BYTE is_general; BYTE job; int level; DWORD offer_exp; // °řÇĺÇŃ °ćÇčġ BYTE _dummy; And then this: void LevelChange(DWORD pid, BYTE level);To this: void LevelChange(DWORD pid, int level);guild.cpp Find this: BYTE level = (BYTE)strtoul(row[4], (char**) NULL, 10);Replace to this: int level = (int)strtoul(row[4], (char**) NULL, 10); Then this: sys_log(0, "GUILD: AddMember PID %u, grade %u, job %u, level %u, offer %u, name %s ptr %p",To this: sys_log(0, "GUILD: AddMember PID %u, grade %u, job %u, level %d, offer %u, name %s ptr %p",Then replace the whole function: void CGuild::ChangeMemberData(DWORD pid, DWORD offer, BYTE level, BYTE grade)To this: void CGuild::ChangeMemberData(DWORD pid, DWORD offer, int level, BYTE grade) { TGuildMemberContainer::iterator cit = m_member.find(pid); if (cit == m_member.end()) return; cit->second.offer_exp = offer; cit->second.level = level; cit->second.grade = grade; cit->second._dummy = 0; TPacketGCGuild pack; TGuildMemberPacketData mbData; pack.header = HEADER_GC_GUILD; pack.subheader = GUILD_SUBHEADER_GC_LIST; pack.size = sizeof(TPacketGCGuild); pack.size += sizeof(TGuildMemberPacketData); for (TGuildMemberOnlineContainer::iterator it = m_memberOnline.begin(); it != m_memberOnline.end(); ++it) { LPDESC d = (*it)->GetDesc(); if (d) { TEMP_BUFFER buf; buf.write(&pack, sizeof(pack)); mbData.byNameFlag = 0; mbData.byGrade = cit->second.grade; mbData.byIsGeneral = cit->second.is_general; mbData.byJob = cit->second.job; mbData.byLevel = cit->second.level; mbData.dwOffer = cit->second.offer_exp; mbData.pid = cit->second.pid; buf.write(&mbData, sizeof(TGuildMemberPacketData)); d->Packet(buf.read_peek(), buf.size()); } } }And replace this function too: void CGuild::LevelChange(DWORD pid, BYTE level)To this: void CGuild::LevelChange(DWORD pid, int level) { TGuildMemberContainer::iterator cit = m_member.find(pid); if (cit == m_member.end()) return; cit->second.level = level; TPacketGuildChangeMemberData gd_guild; gd_guild.guild_id = GetID(); gd_guild.pid = pid; gd_guild.offer = cit->second.offer_exp; gd_guild.grade = cit->second.grade; gd_guild.level = level; db_clientdesc->DBPacket(HEADER_GD_GUILD_CHANGE_MEMBER_DATA, 0, &gd_guild, sizeof(gd_guild)); TPacketGCGuild pack; TGuildMemberPacketData mbData; pack.header = HEADER_GC_GUILD; pack.subheader = GUILD_SUBHEADER_GC_LIST; pack.size = sizeof(TPacketGCGuild); pack.size += sizeof(TGuildMemberPacketData); cit->second._dummy = 0; for (TGuildMemberOnlineContainer::iterator it = m_memberOnline.begin(); it != m_memberOnline.end(); ++it) { LPDESC d = (*it)->GetDesc(); if (d) { TEMP_BUFFER buf; buf.write(&pack, sizeof(pack)); mbData.byNameFlag = 0; mbData.byGrade = cit->second.grade; mbData.byIsGeneral = cit->second.is_general; mbData.byJob = cit->second.job; mbData.byLevel = cit->second.level; mbData.dwOffer = cit->second.offer_exp; mbData.pid = cit->second.pid; buf.write(&mbData, sizeof(TGuildMemberPacketData)); d->Packet(buf.read_peek(), buf.size()); } } }Then this function: bool CGuild::OfferExp(LPCHARACTER ch, int amount)To this: bool CGuild::OfferExp(LPCHARACTER ch, int amount) { TGuildMemberContainer::iterator cit = m_member.find(ch->GetPlayerID()); if (cit == m_member.end()) return false; if (m_data.exp+amount < m_data.exp) return false; if (amount < 0) return false; if (ch->GetExp() < (DWORD) amount) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±ćµĺ> Á¦°řÇĎ°íŔÚ ÇĎ´Â °ćÇčġ°ˇ ł˛Ŕş °ćÇčġş¸´Ů ¸ą˝Ŕ´Ď´Ů.")); return false; } if (ch->GetExp() - (DWORD) amount > ch->GetExp()) { sys_err("Wrong guild offer amount %d by %s[%u]", amount, ch->GetName(), ch->GetPlayerID()); return false; } ch->PointChange(POINT_EXP, -amount); TPacketGuildExpUpdate guild_exp; guild_exp.guild_id = GetID(); guild_exp.amount = amount / 100; db_clientdesc->DBPacket(HEADER_GD_GUILD_EXP_UPDATE, 0, &guild_exp, sizeof(guild_exp)); GuildPointChange(POINT_EXP, amount / 100, true); cit->second.offer_exp += amount / 100; cit->second._dummy = 0; TPacketGCGuild pack; TGuildMemberPacketData mbData; pack.header = HEADER_GC_GUILD; pack.subheader = GUILD_SUBHEADER_GC_LIST; pack.size = sizeof(TPacketGCGuild); pack.size += sizeof(TGuildMemberPacketData); for (TGuildMemberOnlineContainer::iterator it = m_memberOnline.begin(); it != m_memberOnline.end(); ++it) { LPDESC d = (*it)->GetDesc(); if (d) { TEMP_BUFFER buf; buf.write(&pack, sizeof(pack)); mbData.byNameFlag = 0; mbData.byGrade = cit->second.grade; mbData.byIsGeneral = cit->second.is_general; mbData.byJob = cit->second.job; mbData.byLevel = cit->second.level; mbData.dwOffer = cit->second.offer_exp; mbData.pid = cit->second.pid; buf.write(&mbData, sizeof(TGuildMemberPacketData)); d->Packet(buf.read_peek(), buf.size()); } } SaveMember(ch->GetPlayerID()); TPacketGuildChangeMemberData gd_guild; gd_guild.guild_id = GetID(); gd_guild.pid = ch->GetPlayerID(); gd_guild.offer = cit->second.offer_exp; gd_guild.level = ch->GetLevel(); gd_guild.grade = cit->second.grade; db_clientdesc->DBPacket(HEADER_GD_GUILD_CHANGE_MEMBER_DATA, 0, &gd_guild, sizeof(gd_guild)); return true; }And this function: void CGuild::SendListPacket(LPCHARACTER ch)To this: void CGuild::SendListPacket(LPCHARACTER ch) { /* List Packet Header Count (byte) [ ... name_flag 1 - Ŕ̸§Ŕ» ş¸ł»´ŔłÄ ľČş¸ł»´ŔłÄ name CHARACTER_NAME_MAX_LEN+1 ] * Count */ LPDESC d; if (!(d=ch->GetDesc())) return; TPacketGCGuild pack; pack.header = HEADER_GC_GUILD; pack.size = sizeof(TPacketGCGuild); pack.subheader = GUILD_SUBHEADER_GC_LIST; pack.size += sizeof(TGuildMemberPacketData) * m_member.size(); pack.size += (CHARACTER_NAME_MAX_LEN + 1) * m_member.size(); TEMP_BUFFER buf; TGuildMemberPacketData mbData; buf.write(&pack,sizeof(pack)); char c[CHARACTER_NAME_MAX_LEN+1]; for (TGuildMemberContainer::iterator it = m_member.begin(); it != m_member.end(); ++it) { it->second._dummy = 1; mbData.byNameFlag = 1; mbData.byGrade = it->second.grade; mbData.byIsGeneral = it->second.is_general; mbData.byJob = it->second.job; mbData.byLevel = it->second.level; mbData.dwOffer = it->second.offer_exp; mbData.pid = it->second.pid; buf.write(&mbData, sizeof(TGuildMemberPacketData)); strlcpy(c, it->second.name.c_str(), MIN(sizeof(c), it->second.name.length() + 1)); buf.write(c, CHARACTER_NAME_MAX_LEN+1 ); if ( test_server ) sys_log(0 ,"name %s job %d ", it->second.name.c_str(), it->second.job ); } d->Packet(buf.read_peek(), buf.size()); for (TGuildMemberOnlineContainer::iterator it = m_memberOnline.begin(); it != m_memberOnline.end(); ++it) { SendLoginPacket(ch, *it); } for (TGuildMemberP2POnlineContainer::iterator it = m_memberP2POnline.begin(); it != m_memberP2POnline.end(); ++it) { SendLoginPacket(ch, *it); } }Then this function: void CGuild::SendListOneToAll(DWORD pid)To this: void CGuild::SendListOneToAll(DWORD pid) { TPacketGCGuild pack; pack.header = HEADER_GC_GUILD; pack.size = sizeof(TPacketGCGuild); pack.subheader = GUILD_SUBHEADER_GC_LIST; pack.size += sizeof(TGuildMemberPacketData); TGuildMemberPacketData mbData; char c[CHARACTER_NAME_MAX_LEN+1]; memset(c, 0, sizeof(c)); TGuildMemberContainer::iterator cit = m_member.find(pid); if (cit == m_member.end()) return; for (TGuildMemberOnlineContainer::iterator it = m_memberOnline.begin(); it!= m_memberOnline.end(); ++it) { LPDESC d = (*it)->GetDesc(); if (!d) continue; TEMP_BUFFER buf; buf.write(&pack, sizeof(pack)); cit->second._dummy = 1; mbData.byNameFlag = 1; mbData.byGrade = cit->second.grade; mbData.byIsGeneral = cit->second.is_general; mbData.byJob = cit->second.job; mbData.byLevel = cit->second.level; mbData.dwOffer = cit->second.offer_exp; mbData.pid = cit->second.pid; //buf.write(&(cit->second), sizeof(DWORD) * 3 +1); buf.write(&mbData, sizeof(TGuildMemberPacketData)); buf.write(cit->second.name.c_str(), cit->second.name.length()); buf.write(c, CHARACTER_NAME_MAX_LEN + 1 - cit->second.name.length()); d->Packet(buf.read_peek(), buf.size()); } }Then find this: SGuildMember::SGuildMember(DWORD pid, BYTE grade, BYTE is_general, BYTE job, BYTE level, DWORD offer_exp, char* name)And replace to this: SGuildMember::SGuildMember(DWORD pid, BYTE grade, BYTE is_general, BYTE job, int level, DWORD offer_exp, char* name)common tables.h Find this: BYTE byLevel;Replace to this: int byLevel;Then this: BYTE level;To this: int level;And this: BYTE level;To this: int level;Then this: BYTE bLevel;(under typedef struct SPacketPartySetMemberLevel) To this: int bLevel;And then this: BYTE bLevel;(under typedef struct SPacketDGGuildMember) To this: int bLevel;lenght.h Then here set the maximum level: PLAYER_EXP_TABLE_MAX = 120, PLAYER_MAX_LEVEL_CONST = 120,db/src ClientManager.h Find this: struct TPartyInfo { BYTE bRole; BYTE bLevel;Replace to this: struct TPartyInfo { BYTE bRole; int bLevel;ClientManager.cpp Search this: pkPeer->Encode(&it_member->second.bLevel, sizeof(BYTE));(its in the void CClientManager::SendPartyOnSetup(CPeer* pkPeer) function) and replace with this: pkPeer->Encode(&it_member->second.bLevel, sizeof(int));ClientManagerPlayer.cpp Find this: "PLAYER_DELETE FAILED LEVEL %u >= DELETE LIMIT %d"Then replace to this: "PLAYER_DELETE FAILED LEVEL %d >= DELETE LIMIT %d"And find this: "PLAYER_DELETE FAILED LEVEL %u >= DELETE LIMIT %d"You will find it 2 times, replace both to this: "PLAYER_DELETE FAILED LEVEL %d >= DELETE LIMIT %d"client packet.h Find this: BYTE byLevel;Then replace to this: int byLevel;And this: BYTE byLevel;To this: int byLevel;PythonGuild.h Find this: BYTE byLevel;And replace to this: int byLevel;And finally, edit the level colum in the player table in the player database. Set its type from tinyint to smallint (or int, it depends how high is the maximum level) and expand its size to 3 (or higher). And then, here you are I also made a video while I made this, if you have free 42 minute, maybe worth to watch it (if you do, you are my guest for a beer (or something liquid :D)) https://www.youtube.com/embed/NTN5mwEeEv8 If you have question(s)/problem(s)/remark(s), feel free to post it here, or send me a PM. Have a nice day, ~masodikbela
  21. Hi everyone, I would like to share a memory leak fix about pack type Hybrid, Hybrid with SDB and panama. I saw it while analyzing Webzen's new pack type. EterPack.cpp Search this: if( !m_pCSHybridCryptPolicy->DecryptMemory(std::string(filename), static_cast<const BYTE*>(*data), index->data_size, *zObj) ) { return false; } Replace with this if( !m_pCSHybridCryptPolicy->DecryptMemory(std::string(filename), static_cast<const BYTE*>(*data), index->data_size, *zObj) ) { delete zObj; return false; } Search this: if( !m_pCSHybridCryptPolicy->GetSupplementaryDataBlock(std::string(filename), pSDBData, iSDBSize) ) { return false; } Replace with this if( !m_pCSHybridCryptPolicy->GetSupplementaryDataBlock(std::string(filename), pSDBData, iSDBSize) ) { delete zObj; return false; } Search this: else if (COMPRESSED_TYPE_PANAMA == index->compressed_type) { CLZObject * zObj = new CLZObject; __Decrypt_Panama(filename, static_cast<const BYTE*>(*data), index->data_size, *zObj); out_file.BindLZObjectWithBufferedSize(zObj); *data = zObj->GetBuffer(); } Replace with this: else if (COMPRESSED_TYPE_PANAMA == index->compressed_type) { CLZObject * zObj = new CLZObject; if (!__Decrypt_Panama(filename, static_cast<const BYTE*>(*data), index->data_size, *zObj)) { delete zObj; return false; } out_file.BindLZObjectWithBufferedSize(zObj); *data = zObj->GetBuffer(); } Best Regards Ken
  22. Hello, I want share a simple addon for more effective debugging crashes and exceptions on Windows. Technical details about mini dump: https://docs.microsoft.com/en-us/windows/desktop/debug/minidump-files winminidump.c #define __LIBTHECORE__ #include "stdafx.h" #include "winminidump.h" #ifdef __WIN32__ #include <DbgHelp.h> #pragma comment(lib, "dbghelp.lib") // Custom minidump callback BOOL CALLBACK MiniDumpCallback(PVOID pParam, const PMINIDUMP_CALLBACK_INPUT pInput, PMINIDUMP_CALLBACK_OUTPUT pOutput) { BOOL bRet = FALSE; if (!pInput || !pOutput) return FALSE; switch (pInput->CallbackType) { case IncludeModuleCallback: { bRet = TRUE; } break; case IncludeThreadCallback: { bRet = TRUE; } break; case ModuleCallback: { if (!(pOutput->ModuleWriteFlags & ModuleReferencedByMemory)) { pOutput->ModuleWriteFlags &= (~ModuleWriteModule); } bRet = TRUE; } break; case ThreadCallback: { bRet = TRUE; } break; case ThreadExCallback: { bRet = TRUE; } break; case MemoryCallback: { bRet = FALSE; } break; case CancelCallback: break; } return bRet; } bool CreateMiniDump(EXCEPTION_POINTERS* pExceptionInfo) { fprintf(stderr, "Exception handled: %p", pExceptionInfo); if (IsDebuggerPresent()) DebugBreak(); char szProcessName[MAX_PATH]; GetModuleFileNameA(NULL, szProcessName, MAX_PATH); std::string strFileName = std::string(szProcessName); if (strFileName.size() > 0) { size_t iLastSlash = strFileName.find_last_of("\\/"); strFileName = strFileName.substr(iLastSlash + 1, strFileName.length() - iLastSlash); } time_t t; time(&t); struct tm *tinfo; tinfo = localtime(&t); char szDumpName[128]; strftime(szDumpName, sizeof(szDumpName), "dump%Y%m%d_%H%M%S.dmp", tinfo); char szDumpPath[256]; sprintf(szDumpPath, "%s_%s", strFileName.c_str(), szDumpName); HANDLE hFile = CreateFileA(szDumpPath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if (!hFile || hFile == INVALID_HANDLE_VALUE) { fprintf(stderr, "Exception dump file is not created. Error code: %u Path: %s", GetLastError(), szDumpPath); return false; } // Create the minidump MINIDUMP_EXCEPTION_INFORMATION mdei; mdei.ThreadId = GetCurrentThreadId(); mdei.ExceptionPointers = pExceptionInfo; mdei.ClientPointers = FALSE; MINIDUMP_CALLBACK_INFORMATION mci; mci.CallbackRoutine = (MINIDUMP_CALLBACK_ROUTINE)MiniDumpCallback; mci.CallbackParam = 0; MINIDUMP_TYPE mdt = (MINIDUMP_TYPE)(MiniDumpWithIndirectlyReferencedMemory | MiniDumpScanMemory); BOOL rv = MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, mdt, (pExceptionInfo != 0) ? &mdei : 0, 0, &mci); if (!rv) { fprintf(stderr, "Exception dump can not created. Error code: %u", GetLastError()); } else { fprintf(stderr, "Exception dump successfully created."); } // Close the file CloseHandle(hFile); return true; } LONG WINAPI ExceptionFilter(EXCEPTION_POINTERS * pExceptionInfo) { if (pExceptionInfo && pExceptionInfo->ExceptionRecord) { if (pExceptionInfo->ExceptionRecord->ExceptionCode == EXCEPTION_STACK_OVERFLOW) { HANDLE hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CreateMiniDump, pExceptionInfo, 0, NULL); if (hThread && hThread != INVALID_HANDLE_VALUE) { WaitForSingleObject(hThread, INFINITE); CloseHandle(hThread); } } else { CreateMiniDump(pExceptionInfo); } } return EXCEPTION_EXECUTE_HANDLER; } bool setup_minidump_generator() { if (SetUnhandledExceptionFilter(ExceptionFilter)) { fprintf(stderr, "Mini dump generator succesfully created!"); return true; } fprintf(stderr, "Mini dump generator can NOT created! Error code: %u", GetLastError()); return false; } #else bool setup_minidump_generator() { return true; } #endif winminidump.h #ifndef __INC_LIBTHECORE_WINMINIDUMP_H__ #define __INC_LIBTHECORE_WINMINIDUMP_H__ #ifdef __cplusplus extern "C" { #endif extern bool setup_minidump_generator(); #ifdef __cplusplus }; #endif #endif Copy .c file to ServerSrc\libthecore\src and .h file to ServerSrc\libthecore\include. Define new files to your Makefile or CMakeLists.txt, and to libthecore project from your server's visual studio solution Open game\src\main.cpp and call new header file #include "../../libthecore/include/winminidump.h" Now search for your entrypoint int main(int argc, char **argv) Add new lines at the beginning of the function if (setup_minidump_generator() == false) return 1; Open your db\src\main.cpp and call new header file #include "../../libthecore/include/winminidump.h" Now search for your entrypoint int main() Add new lines at the beginning of the function if (setup_minidump_generator() == false) return 1; If you are using rubinum's auth core you can implement same routine to "int main(int argc, char** argv)" function from auth\src\main.cpp If you take any exceptions after making these edits, The core will create a memory dump with the file name like CORE_FILE_NAME_dump_DATE.dmp and you can easily analyze this file via visual studio just like freebsd ".core" files.
  23. birender

    c++ NUL NUL in syserr

    I am getting a very very strange error which I have not seen in metin2 history My client crashes and when I check in syserr I get this data. In my syserr I get a lot of NUL NUL NUL along with unknown packet header. I searched on google but couldn't find anything about this on NUL Can anyone explain my syserr on the screenshot below and even I have attached the file. http://prntscr.com/mkdo4m syserr Log below syserr2_strange.txt syserr4_strange.txt
  24. If you have GCC>5 version, you'll see this error when the linking src: Open (libpoly&libsql)/MAKEFILE and add to CFLAGS; -D_GLIBCXX_USE_CXX11_ABI=1 Do not forget to rebuild libpoly!
  25. Informations about system : When you will open a chest with drop , will appear this window. In this window you can preview drop of chest and you can make a setting how many chests you want open. Image:https://gyazo.com/866f9c8b3cf7f495642139b61e01bf4f.gif DL Link : https://mega.nz/#!yUwxVSbZ!Kbo00sVG8suCK0PCtrcVAW9I63Xt98DNHAiKMAoqaOY