martysama0134

Developer
  • Content Count

    371
  • Joined

  • Last visited

  • Days Won

    71

martysama0134 last won the day on March 20

martysama0134 had the most liked content!

Community Reputation

970 Unstoppable

About martysama0134

  • Rank
    Noble

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. martysama0134

    open shouder sash problem bonus

    Use imgur.com
  2. martysama0134

    open Dedicated server OVH game - Mysql problem

    your mysql server is getting laggy due to the crappy machine hardware (ram or cpu mostly) or your website is opening lots of connection or your machine network is crap
  3. martysama0134

    WorldEditor ReMIX

    https://github.com/martysama0134/how-to-mt2-general/tree/master/worldeditor-dpi-fix Try either 1) the .manifest or 2) to set the dpi scale to 100%
  4. martysama0134

    c++ Json converter for server data files

    Boost PropertyTree is not a json library (but it uses internally one). It drops tons of functionality from the JSON format. I also think it treats integers as strings. It's 20 times slower than the most used json libraries. Its implementation looks very oldish. It's basically legacy code in its utmost definition. Also, with the new c++ standards, many boost functionality can be replaced quite easily. Boost remains a bloatware for small projects, so I try to avoid it when possible. As for other alternatives, these two are header-only (easily to implement/copy-paste on Extern/include/ or from "pkg install") and much more beautiful: https://github.com/nlohmann/json https://github.com/Tencent/rapidjson
  5. martysama0134

    [EterPack Archiver] PackMakerLite

    UPDATED Fixed another small bug with lowercase paths (GR2 -> gr2)
  6. martysama0134

    [EterPack Archiver] PackMakerLite

    This is an archiver I've created, and it looks quite stable so far. The PackMakerLite (PML) supports type0-1-2-3-4-5 (type4-5 only pack, not unpack). As a summarize, the metin2 types are handled like this: Type 0 - only storage (no encryption/compression; it can be read fully from the .epk) Type 1 - compressed - lzo(file) Type 2 - compressed and encrypted - xtea(lzo(file)) Type 3 - encrypted with Panama - you must save an .iv key server-side in the panama/ folder. (content readable only after auth phase) The official used it only for patch2. Type 4 - encrypted with a mix of ciphers (cshybridcrypt) - you must save a .dat key server-side in the package/ folder. (content readable only after auth phase) Practically all the metin2_patch files. Type 5 - like type 4, but a server-side map/<map_name> is also provided. (content readable only after accessing the <map_name> map as a player) The official used it only for the catacomb data. Usage: Its settings (xtea keys, extensions, pack types to use) can be changed inside PackMakerLite.json: You can actually integrate the tool in the menu context (running the .reg files) for packing folders and unpacking .eix files. (You need to copy .exe, .json, .bat files on "c:\windows\system32\" btw) Remove "--nolog" from the .bat files if you want to see the logs again. Last but not least: since the client handles all the filenames in lowercase, this tools automatically converts them as well. PackMakerLite-20190305-2233.rar
  7. martysama0134

    open Compile client source with vs2015

    remove 'const' from std::vector and std::string (line 746) "auto itor" should be enough.
  8. martysama0134

    open Compile client source with vs2015

    "Target Platform Version" is blank. By the way, vs2015 has mostly the same abi of vs2017, so you can even think to upgrade it.
  9. martysama0134

    python [Py] Metin2 - Color formatter class

    reformatted + passable hex value as arg https://gist.github.com/martysama0134/d35e7354dadb93da6a65948a0d13f341
  10. martysama0134

    [SMALL RELEASE] Same IP Detection

    moved to: https://gist.github.com/martysama0134/806626cbf1ad6dee2a504f8aabbb9677 Added somewhere (even .h) inline bool ch_compare_ip(LPCHARACTER ch1, LPCHARACTER ch2) { if (!ch1 || !ch2 || !ch1->GetDesc() || !ch2->GetDesc()) return false; const std::string ip1 = ch1->GetDesc()->GetHostName(); const std::string ip2 = ch2->GetDesc()->GetHostName(); return (ip1.compare(ip2) == 0); } or if added in char.h inside CHARACTER: inline bool CHARACTER::CompareIP(LPCHARACTER ch2) { if (!ch2 || !this->GetDesc() || !ch2->GetDesc()) return false; const std::string ip1 = this->GetDesc()->GetHostName(); const std::string ip2 = ch2->GetDesc()->GetHostName(); return (ip1.compare(ip2) == 0); }
  11. martysama0134

    c++ Mini dump generator for Windows server

    ah yes, replace Version.h with #pragma once #define VER_FILE_VERSION 1, 0, 40999, 0 #define VER_FILE_VERSION_STR "1.0.40999.1" inline int METIN2_GET_VERSION() { return 40999; } inline and pragma once were missing. I used 40999 but anything is fine. .dmp files can be debugged with visual studio, but the exact .exe, source files and .pdb files are needed, otherwise the result is junk.
  12. martysama0134

    c++ Mini dump generator for Windows server

    moved to: https://gist.github.com/martysama0134/c3644013ec6f2bd361a1c38835f518f0 Few days ago, I did something similar for the client (EterLib\error.cpp) (instead of errorlog): #define ENABLE_CRASH_MINIDUMP #ifdef ENABLE_CRASH_MINIDUMP # include "../UserInterface/Version.h" # include <iomanip> # include <sstream> void make_minidump(EXCEPTION_POINTERS * e) { auto hDbgHelp = LoadLibraryA("dbghelp"); if (hDbgHelp == nullptr) return; auto pMiniDumpWriteDump = (decltype(&MiniDumpWriteDump)) GetProcAddress(hDbgHelp, "MiniDumpWriteDump"); if (pMiniDumpWriteDump == nullptr) return; // folder name std::string folder = "logs"; CreateDirectoryA(folder.c_str(), nullptr); // time format auto t = std::time(nullptr); std::ostringstream timefmt; timefmt << std::put_time(std::localtime(&t), "%Y%m%d_%H%M%S"); // filename std::string filename = fmt::format("{}\\metin2client_{}_{}.dmp", folder, METIN2_GET_VERSION(), timefmt.str()); auto hFile = CreateFileA(filename.c_str(), GENERIC_WRITE, FILE_SHARE_READ, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if (hFile == INVALID_HANDLE_VALUE) return; MINIDUMP_EXCEPTION_INFORMATION exceptionInfo; exceptionInfo.ThreadId = GetCurrentThreadId(); exceptionInfo.ExceptionPointers = e; exceptionInfo.ClientPointers = FALSE; auto dumped = pMiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, MINIDUMP_TYPE(MiniDumpWithIndirectlyReferencedMemory | MiniDumpScanMemory), e ? &exceptionInfo : nullptr, nullptr, nullptr); CloseHandle(hFile); // std::string errMsg = "The application crashed. Send the generated file to the staff: "s + name; // MessageBox(nullptr, errMsg.c_str(), "Metin2Client", MB_ICONSTOP); return; } #endif LONG __stdcall EterExceptionFilter(_EXCEPTION_POINTERS * pExceptionInfo) { #ifdef ENABLE_CRASH_MINIDUMP make_minidump(pExceptionInfo); #else // eterlog trash #endif return EXCEPTION_EXECUTE_HANDLER; } I'm not using it since I'll use crashrpt2 instead. Version without c++17&libfmt: #define ENABLE_CRASH_MINIDUMP #ifdef ENABLE_CRASH_MINIDUMP #include "../UserInterface/Version.h" #include <iomanip> #include <sstream> void make_minidump(EXCEPTION_POINTERS* e) { auto hDbgHelp = LoadLibraryA("dbghelp"); if(hDbgHelp == nullptr) return; auto pMiniDumpWriteDump = (decltype(&MiniDumpWriteDump))GetProcAddress(hDbgHelp, "MiniDumpWriteDump"); if(pMiniDumpWriteDump == nullptr) return; // folder name std::string folder = "logs"; CreateDirectoryA(folder.c_str(), nullptr); // time format auto t = std::time(nullptr); std::ostringstream timefmt; timefmt << std::put_time(std::localtime(&t), "%Y%m%d_%H%M%S"); // filename std::string filename = folder + "\\"s + "metin2client_"s + std::to_string(METIN2_GET_VERSION()) + "_"s + timefmt.str() + ".dmp"; auto hFile = CreateFileA(filename.c_str(), GENERIC_WRITE, FILE_SHARE_READ, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if(hFile == INVALID_HANDLE_VALUE) return; MINIDUMP_EXCEPTION_INFORMATION exceptionInfo; exceptionInfo.ThreadId = GetCurrentThreadId(); exceptionInfo.ExceptionPointers = e; exceptionInfo.ClientPointers = FALSE; auto dumped = pMiniDumpWriteDump( GetCurrentProcess(), GetCurrentProcessId(), hFile, MINIDUMP_TYPE(MiniDumpWithIndirectlyReferencedMemory | MiniDumpScanMemory), e ? &exceptionInfo : nullptr, nullptr, nullptr); CloseHandle(hFile); // std::string errMsg = "The application crashed. Send the generated file to the staff: "s + name; // MessageBox(nullptr, errMsg.c_str(), "Metin2Client", MB_ICONSTOP); return; } #endif LONG __stdcall EterExceptionFilter(_EXCEPTION_POINTERS * pExceptionInfo) { #ifdef ENABLE_CRASH_MINIDUMP make_minidump(pExceptionInfo); #else // eterlog trash #endif return EXCEPTION_EXECUTE_HANDLER; }
  13. martysama0134

    AsyncSQL with std::mutex and std::thread

    > AsyncSQL.h This page is no longer available. It has either expired, been removed by its creator, or removed by one of the Pastebin staff.
  14. martysama0134

    open (GDB) Crash Core

    Check each DBManager::instance().DirectQuery if they are either wrapped in smart pointers (auto_ptr/unique_ptr), or freed using delete. Most of the times, it's this.