Jump to content

arves100

Former Staff
  • Posts

    620
  • Joined

  • Last visited

  • Days Won

    18
  • Feedback

    100%

Everything posted by arves100

  1. @PACI best 4 seconds of my life 10/10
  2. I thought the same then someone asked to keep all the skills in one slots (remove the three skill thing) and rather than changing all the crap relative to that I decided to keep the three slots in the same position (kinda lazy but it was the quickiest fix I could think of)
  3. It's one of those ultra specific changes that you only need when you need to have 3 slots on the same position and it's easier to make a quick patch than fixing the reason you why can't use one slot, which has the 0.00000000000000000000001% chance of happening but I decided to release it anyway perhaps someone can find a reason to use it
  4. Have you ever got in the situation that you had 2 or more slots in the same position? If so, you have noticed that the client always jumps to the first slot even if you want the slot deactivated. This little change was created to handle this particular situation. The root cause comes from the function GetPickedSlotPointer, which iterates all the slots appended to the slotwindow and doesn't know if a slot should be used or not. root/ui.py: # Add before def SetSkillSlot(self, renderingSlotNumber, skillIndex, skillLevel) this lines: if app.SLOT_WINDOW_PICKABLE: def SetPickableSlot(self, slotIndex, value): wndMgr.SetPickableSlot(self.hWnd, slotIndex, value) def SetUnpickableSlotAll(self): wndMgr.SetUnpickableSlotAll(self.hWnd) EterBase/ServiceDefs.h: #define SLOT_WINDOW_PICKABLE EterPythonLib/PythonSlotWindow.cpp // Add after this: ClearSlot(&Slot); Slot.dwSlotNumber = dwIndex; Slot.dwCenterSlotNumber = dwIndex; Slot.ixPosition = ixPosition; Slot.iyPosition = iyPosition; Slot.ixCellSize = ixCellSize; Slot.iyCellSize = iyCellSize; // this: #ifdef SLOT_WINDOW_PICKABLE Slot.bPickable = TRUE; #endif // --------------------------------------------------- // Add after this: pSlot->isItem = FALSE; pSlot->dwState = 0; pSlot->fCoolTime = 0.0f; pSlot->fStartCoolTime = 0.0f; pSlot->dwCenterSlotNumber = 0xffffffff; // this: #ifdef SLOT_WINDOW_PICKABLE pSlot->bPickable = TRUE; #endif // --------------------------------------------------- // Add after this: if (iyLocal >= rSlot.iyPosition) if (ixLocal <= rSlot.ixPosition + ixCellSize) if (iyLocal <= rSlot.iyPosition + iyCellSize) // this: #ifdef SLOT_WINDOW_PICKABLE if (rSlot.bPickable) #endif // --------------------------------------------------- // Add this at the end of the file: #ifdef SLOT_WINDOW_PICKABLE void CSlotWindow::SetPickableSlot(DWORD dwSlotNumber, BOOL bFlag) { TSlot* pSlot; if (!GetSlotPointer(dwSlotNumber, &pSlot)) return; pSlot->bPickable = bFlag; } void CSlotWindow::SetUnpickableSlotAll() { for (TSlotListIterator itor = m_SlotList.begin(); itor != m_SlotList.end(); ++itor) { TSlot& rSlot = *itor; rSlot.bPickable = FALSE; } } BOOL CSlotWindow::IsPickableSlot(DWORD dwSlotNumber) { TSlot* pSlot; if (!GetSlotPointer(dwSlotNumber, &pSlot)) return FALSE; return pSlot->bPickable; } #endif EterPythonLib/PythonSlotWindow.h // Add after this: CAniImageBox * pFinishCoolTimeEffect; // this: #ifdef SLOT_WINDOW_PICKABLE BOOL bPickable; #endif // -------------------------------------------------------------------------------------------- // Add after this: // For Usable Item void SetUseMode(BOOL bFlag); void SetUsableItem(BOOL bFlag); // this: #ifdef SLOT_WINDOW_PICKABLE void SetPickableSlot(DWORD dwSlotNumber, BOOL bFlag); void SetUnpickableSlotAll(); BOOL IsPickableSlot(DWORD dwSlotNumber); #endif EterPythonLib/PythonWindowManagerModule.cpp // Add before this: PyObject * wndMgrShowRequirementSign(PyObject * poSelf, PyObject * poArgs) // this: #ifdef SLOT_WINDOW_PICKABLE PyObject* wndMgrSetPickableSlot(PyObject* poSelf, PyObject* poArgs) { UI::CWindow* pWindow; if (!PyTuple_GetWindow(poArgs, 0, &pWindow)) return Py_BuildException(); int iSlotNumber; if (!PyTuple_GetInteger(poArgs, 1, &iSlotNumber)) return Py_BuildException(); BOOL bFlag; if (!PyTuple_GetInteger(poArgs, 2, &bFlag)) return Py_BuildException(); UI::CSlotWindow* pSlotWin = (UI::CSlotWindow*)pWindow; pSlotWin->SetPickableSlot(iSlotNumber, bFlag); return Py_BuildNone(); } PyObject* wndMgrSetUnpickableSlotAll(PyObject* poSelf, PyObject* poArgs) { UI::CWindow* pWindow; if (!PyTuple_GetWindow(poArgs, 0, &pWindow)) return Py_BuildException(); UI::CSlotWindow* pSlotWin = (UI::CSlotWindow*)pWindow; pSlotWin->SetUnpickableSlotAll(); return Py_BuildNone(); } #endif // ------------------------------------------------------------------------------------------------------- // Add after this: { "SetPath", wndNumberSetPath, METH_VARARGS }, // this: { "SetPickableSlot", wndMgrSetPickableSlot, METH_VARARGS }, { "SetUnpickableSlotAll", wndMgrSetUnpickableSlotAll, METH_VARARGS }, UserInterface/PythonApplicationModule.cpp // Add after this: #ifdef ENABLE_COSTUME_SYSTEM PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM", 1); #else PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM", 0); #endif // this: #ifdef SLOT_WINDOW_PICKABLE PyModule_AddIntConstant(poModule, "SLOT_WINDOW_PICKABLE", 1); #else PyModule_AddIntConstant(poModule, "SLOT_WINDOW_PICKABLE", 1); #endif How to use it? On a SlotWindow class you can use slotWindow.SetPickableSlot(slotNumber, TRUE/FALSE), when it's true the slot can be pickable, otherwise it won't. slotWindow.SetUnpickableSlotAll() sets all the slots in the slotwindow to become unpickable. The default state of a slot is always pickable, please note that clearing the slot (slotWindow.ClearSlot(slotNumber)) will reset the pickable status. Good luck!
  5. Pretty interesting way to manage packets here, it reminds me the way minecraft does it, could definitly see an usage in dynamic packets at least. Thanks for the release.
  6. Hi Asikoo welcome to the board I hope you'll find this place nice for you.
  7. Memory leaks are very important when we speak about reusing memory, it prevents the game to keep allocating new RAM over and over. WIth this simple fixes memory leaks on Metin2 will be fixed. 1. Server Open the file game/main.cpp Search this function: int main(int argc, char **argv) { After this add the following code: return 0; Now open the file db/Main.cpp. Search this function: int main() { After this add the following code: return 0; 2. Client Open the file UserInterface/UserInterface.cpp Search this function: int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { After this add the following code: return 0; I hope it will works now, enjoy just 200MB for a complete client. Good luck.
  8. ASIKOO CONFESSED HE IS SCAMMING WITH VIP!!!! WE MUST TAKE ACTION! #makemetin2devgreatagain
  9. As some of you have problems seeing the image here's another proof. https://github.com/ASIKOO/M2-Project/blob/master/m2srcsf/game/src/debug_allocator.h This file right here was actually made by @martysama0134in one of his first revision, I do have the leaked version on the internet and I can confirm that the file is also present there. As you can see, in the left there's marty code and on the right there's asikoo one. Asikoo just modified two things for mask the file and remove a warning, he thought he could get away with that.
  10. Bah I'll try to reupload the image in this days on another source maybe
  11. After many investigations and talk with the whole Metin2 dev community. We, as a community, have reached the conclusion that @ASIKOOhas proven to be a scammer. and, by such, he does not rappresent our community. Sever studies concluded that the server files he was working on were just downloaded from leakmmo website without any credit. We kindly belive @VegaS™would be a better administrator, not only he has fought agains scammers when he was a normal seller, but he also helped cleaning up this community from more scammer. The best part is that he has proven multiple times to own bigger baguettes than the current administrator. I do demand for an immediate ban of the scammer Asikoo and giving the new administration to Vegas. Regards, Arves100. Proofs can be viewed here: https://metin2.download/picture/I2qZct03vVtxtU30kaK3e08BS95tERXg/.png Don't forget to share the tags, they can't stop us even if they close this post: #YesVegasForTheNewAdministrator #BanAsikooScammer
  12. #banasikoo @[Pro]Lord@ASIKOO@VegaS™
  13. Wow there are even CBT 2003 screenshot, amazing! Thanks for sharing.
  14. Try to report it to vcpkg, seems like they broke msys2 again ? Perhaps do a git pull first to see if they have updated and fixed it.
  15. sor aquire a non shitty version of the sources, you're missing one file.
  16. Try to change this line inside src/vcpkg/base/system.cpp [Hidden Content] to #elif defined(__x86__) || defined(_M_X86) || defined(__i386__)
  17. #update Added screenshot of vcpkg. Removed symtable and typedef since they are not used. Added changes for removing the old method Added missing static link in vcpkg for server. New note: mariadb uses it's integrated zlib, this causes issues in client build.
  18. Hello, this is a random and unwanted tutorial for building the Metin2 source code with vcpkg. It was intended for new comers for sure, but it might get more complicated than it should be. If you remember the wiki pages about building the source and creating the Extern from scratch, this is the cleaned and updated 2020 method™ . This tutorial focuses doing changes on both some revisions that I have on the internet and the original leaked one. We will use vcpkg, but this tutorial also contains several fixes that are required to get a general source file to be built. Introduction vcpkg is a C++ package manager for Windows, Linux, Mac (and FreeBSD). It allows us to build any third party program required by any of our applications, and keep them updated. It also allows us to easily install anything new it might be required to our sources. In Metin2, this program fully replaces the old Extern directory. The tutorial is compatible for both Windows and FreeBSD, both client and server. This method also supports adding custom inclusions or libraries inside the vcpkg installation root, I'll explain more later on the topic. Why shoud you use this method? You want a quick and slimmer way of distributing your sources, the idea would be not distributing the Extern at all, and let people perform the installation of vcpkg in their PC. Keep all the third party components of Metin2 always up to date. You might get better performance and security enchanges. (Most commonly the Python update) You want to achieve static linking (removing extra DLL in your client or SO in the game). My client source only contain SpeedTreeRT and Granny2 dll files (which could be removed if you use static Granny 2.9 and build SpeedTreeRT from sources) Changes applied: Modify inclusions & libraries to use vcpkg. (No more Extern, for ever) Updated various files to use the last version from vcpkg. Changes old NANOBEGIN/NANOEND to the last SDK and fix some bugs that were generated by using Nanomites with debug builds. Cleaned up Makefile and enable static library usage (no more .so) Fixes some bugs or issues that you can get if you use the server under Windows. Compatibility and incompatibility I was not able to get libmariadb working with FreeBSD, it might have been due to the fact that I was compiling with a FreeBSD 64-bit application, in case something bad happens, I suggest you mitigate by dropping [Hidden Content]:(YOUR FREEBSD VERSION):amd64/latest/All/mariadb-connector-c-3.1.9.txz include and lib files inside (vcpkg directory)\installed\x86-freebsd. (FreeBSD recently updated their pkg to 3.1.9, it might work now) You can not build in 32-bit vcpkg under 64-bit (I was using a cross-toolchain and I never got it to work), get a 32-bit build machine. It might be possible to get multilib to build on FreeBSD, but I am not aware of any method that could be achieved under vcpkg. You need internet on your FreeBSD virtual machine or VPS, it also needs to be updated to a relavant version, any supported FreeBSD version is fine, check them at [Hidden Content] You need to use, at least, Windows 7 SP1 to build the Client (or Server). I do not reccomend using clang for building your source, I get some issues with Crypto++. Please report if cryptopp is working fine Windows prerequisites Get the last version of Visual Studio here: [Hidden Content] Choose the workload "C++ desktop application development" (or something similar) in Visual Studio installer. MAKE SURE TO INSTALL THE VISUAL STUDIO ENGLISH LANGUAGE PACK AS WELL, OR VCPKG WILL NOT WORK. YOU CAN INSTALL LANGUAGE PACK BY CLICKING THE "LANGUAGE PACK" OPTION IN VISUALSTUDIO INSTALLER. We can download Git from here [Hidden Content] and CMake from here [Hidden Content] FreeBSD Setup (Server only) This process must be executed only in the BUILD MACHINE, not in the place where the Server will be started. Type the following command: pkg install gcc makedepend gmake cmake git openssl ninja Then, type the following commands: cd (folder where we want to store vcpkg) git clone --depth=1 [Hidden Content] cd vcpkg ./bootstrap-vcpkg.sh -disableMetrics -useSystemBinaries ./vcpkg install devil cryptopp boost-system boost-container boost-unordered boost-algorithm boost-pool boost-math boost-lexical-cast Windows setup (Client and, optionally, Server) Under Windows, type the following commands: (Please note that you need to launch all this commands in an elevated/administrator command prompt) cd (folder where we want to store vcpkg) git clone --depth=1 [Hidden Content] cd vcpkg bootstrap-vcpkg -disableMetrics vcpkg integrate install vcpkg install devil:x86-windows-static cryptopp:x86-windows-static boost-system:x86-windows-static boost-container:x86-windows-static boost-unordered:x86-windows-static boost-algorithm:x86-windows-static lzo:x86-windows-static python2:x86-windows-static If you use the Type6 Snappy compression, also type the following command: vpckg install snappy:x86-windows-static If you want to build a Server under Windows, also type the following command: vcpkg install libmariadb:x86-windows-static openssl:x86-windows-static boost-pool:x86-windows-static boost-math:x86-windows-static boost-lexical-cast:x86-windows-static Inside your client source directory (where there's Metin2Client.sln) create a new folder called Extern (unfortunally some components cannot be distributed via vcpkg) and extract this pack inside that folder. Server: Common changes You need to follow the OpenSSL update to build the sources. You might also need to follow the char_skill compilation fix if you get some issue. This changes must be done inside game/src. Open cipher.h and modify the following line: encoder_->ProcessData((byte*)buffer, (const byte*)buffer, length); to: encoder_->ProcessData((CryptoPP::byte*)buffer, (const CryptoPP::byte*)buffer, length); and from: decoder_->ProcessData((byte*)buffer, (const byte*)buffer, length); to: decoder_->ProcessData((CryptoPP::byte*)buffer, (const CryptoPP::byte*)buffer, length); Open cipher.cpp and delete the following line: #include <cryptopp/cryptoppLibLink.h> Open utils.cpp and delete this lines if you have them: #ifdef WIN32 extern "C" void my_make_scrambled_password(char *to, const char *password, size_t pass_len); #endif and if you have this lines, change them: #ifdef WIN32 my_make_scrambled_password(hash_buf, tmp_pwd, strlen(tmp_pwd)); #else make_scrambled_password(hash_buf, tmp_pwd); #endif to: make_scrambled_password(hash_buf, tmp_pwd); Then, search if you have this lines: #ifndef SHA1_HASH_SIZE #define SHA1_HASH_SIZE 20 #endif if you have them, add this after those 3 lines: extern "C" { #include "sha1.h" } char *hexify(char * const result, const unsigned char *digest, const size_t size_result, size_t size_digest) { static const char * const hexchars = "0123456789ABCDEF"; char *result_pnt = result; if (size_digest <= (size_t) 0 || size_result <= (size_digest * (size_t) 2U)) { return NULL; } do { *result_pnt++ = hexchars[(*digest >> 4) & 0xf]; *result_pnt++ = hexchars[*digest & 0xf]; digest++; size_digest--; } while (size_digest > (size_t) 0U); *result_pnt = 0; return result; } // Implementation from commit 2db6b50c7b7c638104bd9639994f0574e8f4813c in Pure-ftp source. void make_scrambled_password(char scrambled_password[42], const char password[255]) { SHA1_CTX ctx; unsigned char h0[20], h1[20]; SHA1Init(&ctx); SHA1Update(&ctx, (unsigned char*)password, strlen(password)); SHA1Final(h0, &ctx); SHA1Init(&ctx); SHA1Update(&ctx, h0, sizeof h0); #ifdef HAVE_EXPLICIT_BZERO explicit_bzero(h0, strlen(password)); #else volatile unsigned char *pnt_ = (volatile unsigned char *) h0; size_t i = (size_t) 0U; while (i < strlen(password)) { pnt_[i++] = 0U; } #endif SHA1Final(h1, &ctx); *scrambled_password = '*'; hexify(scrambled_password + 1U, h1, 42, sizeof h1); } Download the following two files (sha1.c and sha1.h) and put them inside game/src folder. [Hidden Content] [Hidden Content] Open input_auth.cpp and if you have this lines, change them from: #ifdef __WIN32__ DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, dwKey, p, "SELECT PASSWORD('%s'),password,securitycode,social_id,id,status,availDt - NOW() > 0," "UNIX_TIMESTAMP(silver_expire)," "UNIX_TIMESTAMP(gold_expire)," "UNIX_TIMESTAMP(safebox_expire)," "UNIX_TIMESTAMP(autoloot_expire)," "UNIX_TIMESTAMP(fish_mind_expire)," "UNIX_TIMESTAMP(marriage_fast_expire)," "UNIX_TIMESTAMP(money_drop_rate_expire)," "UNIX_TIMESTAMP(create_time)" " FROM account WHERE login='%s'", szLogin); #else // @fixme138 1. PASSWORD('%s') -> %s 2. szPasswd wrapped inside mysql_hash_password(%s).c_str() DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, dwKey, p, "SELECT '%s',password,securitycode,social_id,id,status,availDt - NOW() > 0," "UNIX_TIMESTAMP(silver_expire)," "UNIX_TIMESTAMP(gold_expire)," "UNIX_TIMESTAMP(safebox_expire)," "UNIX_TIMESTAMP(autoloot_expire)," "UNIX_TIMESTAMP(fish_mind_expire)," "UNIX_TIMESTAMP(marriage_fast_expire)," "UNIX_TIMESTAMP(money_drop_rate_expire)," "UNIX_TIMESTAMP(create_time)" " FROM account WHERE login='%s'", mysql_hash_password(szPasswd).c_str(), szLogin); #endif to: DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, dwKey, p, "SELECT '%s',password,securitycode,social_id,id,status,availDt - NOW() > 0," "UNIX_TIMESTAMP(silver_expire)," "UNIX_TIMESTAMP(gold_expire)," "UNIX_TIMESTAMP(safebox_expire)," "UNIX_TIMESTAMP(autoloot_expire)," "UNIX_TIMESTAMP(fish_mind_expire)," "UNIX_TIMESTAMP(marriage_fast_expire)," "UNIX_TIMESTAMP(money_drop_rate_expire)," "UNIX_TIMESTAMP(create_time)" " FROM account WHERE login='%s'", mysql_hash_password(szPasswd).c_str(), szLogin); Inside this file, change this lines if you have them: #ifdef __WIN32__ DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, dwKey, p, "SELECT PASSWORD('%s'),password,securitycode,social_id,id,status,availDt - NOW() > 0," "UNIX_TIMESTAMP(silver_expire)," "UNIX_TIMESTAMP(gold_expire)," "UNIX_TIMESTAMP(safebox_expire)," "UNIX_TIMESTAMP(autoloot_expire)," "UNIX_TIMESTAMP(fish_mind_expire)," "UNIX_TIMESTAMP(marriage_fast_expire)," "UNIX_TIMESTAMP(money_drop_rate_expire)," "UNIX_TIMESTAMP(create_time)" " FROM account WHERE login='%s'", szLogin); #else // @fixme138 1. PASSWORD('%s') -> %s 2. szPasswd wrapped inside mysql_hash_password(%s).c_str() DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, dwKey, p, "SELECT '%s',password,securitycode,social_id,id,status,availDt - NOW() > 0," "UNIX_TIMESTAMP(silver_expire)," "UNIX_TIMESTAMP(gold_expire)," "UNIX_TIMESTAMP(safebox_expire)," "UNIX_TIMESTAMP(autoloot_expire)," "UNIX_TIMESTAMP(fish_mind_expire)," "UNIX_TIMESTAMP(marriage_fast_expire)," "UNIX_TIMESTAMP(money_drop_rate_expire)," "UNIX_TIMESTAMP(create_time)" " FROM account WHERE login='%s'", mysql_hash_password(szPasswd).c_str(), szLogin); #endif to: DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, dwKey, p, "SELECT '%s',password,securitycode,social_id,id,status,availDt - NOW() > 0," "UNIX_TIMESTAMP(silver_expire)," "UNIX_TIMESTAMP(gold_expire)," "UNIX_TIMESTAMP(safebox_expire)," "UNIX_TIMESTAMP(autoloot_expire)," "UNIX_TIMESTAMP(fish_mind_expire)," "UNIX_TIMESTAMP(marriage_fast_expire)," "UNIX_TIMESTAMP(money_drop_rate_expire)," "UNIX_TIMESTAMP(create_time)" " FROM account WHERE login='%s'", mysql_hash_password(szPasswd).c_str(), szLogin); Open the file libsql/AsyncSQL.cpp and change: fprintf(stdout, "AsyncSQL: connected to %s (reconnect %d)\n", m_stHost.c_str(), m_hDB.reconnect);[ in fprintf(stdout, "AsyncSQL: connected to %s\n", m_stHost.c_str()); Open the file libthecore/src/log.c and change: #ifndef __WIN32__ // log_level이 1 이상일 경우에는 테스트일 경우가 많으니 stdout에도 출력한다. if (log_level_bits > 1) { #endif in: // log_level이 1 이상일 경우에는 테스트일 경우가 많으니 stdout에도 출력한다. if (log_level_bits > 1) { also change this line, you will find it some lines after the last change: #ifndef __WIN32__ } #endif in: } Open the file libthecore/include/stdafx.h and delete //struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* and nanoseconds */ }; also delete this line: #define strtof(str, endptr) (float)strtod(str, endptr) If you have libserverkey, open libserverkey/RSACrypto.cpp and delete this lines: #ifdef _WIN32 #include <atlenc.h> #endif also ope nthe file libserverkey/RSACrypto.h and delete this lines: #ifdef _WIN32 // needed only for using openssl #pragma comment(lib, "libeay32") #endif Open libserverkey/CheckServerKey.h and change #ifdef _WIN32 #include <atlenc.h> #else #include "base64_ssl.h" #endif to: #include "base64_ssl.h" Also inside this file, modifiy this: #ifdef _WIN32 if (FALSE == Base64Decode(key.c_str(), key.size(), buf, &buflen)) { errorString = "base64 decode failed"; return false; } #else if (false == unbase64_ssl((unsigned char *)key.c_str(), key.size(), buf, buflen)) { errorString = "base64 decode failed"; return false; } buflen = strlen((const char *)buf); #endif to: if (false == unbase64_ssl((unsigned char *)key.c_str(), key.size(), buf, buflen)) { errorString = "base64 decode failed"; return false; } buflen = strlen((const char *)buf); Open db/src/CsvReader.h and change: #if _MSC_VER #include <hash_map> #else #include <map> #endif to: #include <boost/unordered_map.hpp> also change this: #if _MSC_VER typedef stdext::hash_map<std::string, size_t> NAME2INDEX_MAP; typedef stdext::hash_map<size_t, std::string> INDEX2NAME_MAP; #else typedef std::map<std::string, size_t> NAME2INDEX_MAP; typedef std::map<size_t, std::string> INDEX2NAME_MAP; #endif to this: typedef boost::unordered_map<std::string, size_t> NAME2INDEX_MAP; typedef boost::unordered_map<size_t, std::string> INDEX2NAME_MAP; Open the file db/src/Main.cpp and delete this lines: #ifdef __FreeBSD__ _malloc_options = "A"; #endif #ifdef __FreeBSD__ extern const char * _malloc_options; #endif Open game/src/MarkImage.h and before this: #include <IL/il.h> add this: #define IL_STATIC_LIB 1 Server: FreeBSD only changes We have to modify "CC = (something)" in "CC = g++" open those files with a text editor and modify it, here's the list of files: - libthecore/src/Makefile - libsql/Makefile - libpoly/Makefile - libgame/src/Makefile - libserverkey/Makefile - db/src/Makefile - game/src/Makefile - game/src/quest/Makefile (Here it's called CPP not CC) We also have to modify "CC= gccX" (where X is a number) in "CC = gcc" inside "liblua/config" (or liblua/5.0/config) Open libsql/Makefile and delete the following lines: IFLAGS = -I/usr/local/include/ #sometimes necessary included IFLAGS = -I/usr/local/include/mysql or the following lines if you have them: oppure potreste avere le seguenti righe che sono da rimuovere: IFLAGS = -I../libmysql/5.x-5.1.35 IFLAGS = -I../libmysql/7.x-5.1.35 Before "LIBS =" add this: VCPKG_DIR=(Your vcpkg directory) IFLAGS = -I$(VCPKG_DIR)/installed/x86-freebsd/include Check if you have "-m32" inside this files, otherwise add this before "LIBS = " CFLAGS += -m32 This check and add process must be done for the following files: - libthecore/src/Makefile - libsql/Makefile - libpoly/Makefile - libserverkey/Makefile - libgame/src/Makefile Open the file game/src/quest/Makefile and if you don't have "-m32" add this before "all: qc cc" CFLAGS += -m32 If you don't have "ENABLE_STATIC = 0" add this before "all: qc cc" CPP += -static If you have "ENABLE_STATIC = 0" change the 0 in 1. If you are under FreeBSD x64, you have to add this before "all: qc cc". LIBDIR += -L/usr/local/lib32/gccX While for x86 Freebsd, this LIBDIR += -L/usr/local/lib/gccX Replace X with the gcc major version, you can verify that by typing "gcc --version" in the console. You can get something like this: gcc (FreeBSD Ports Collection) 9.3.0 In my case, the number is 9. Open "db/src/Makefile", and delete this lines if you have them ifeq ($(BSD_VERSION), 7) INCDIR += -I../../libmysql/7.x-5.1.35 LIBDIR += -L../../libmysql/7.x-5.1.35 else INCDIR += -I../../libmysql/5.x-5.1.35 LIBDIR += -L../../libmysql/5.x-5.1.35 endif also delete this lines if you have them: # boost INCDIR += -I../../boost and also delete this lines: # Boost INCDIR += -I../../../Extern/include/boost # MySQL INCDIR += -I/usr/local/include/mysql LIBS += /usr/local/lib/mysql/libmysqlclient.a /usr/lib/libz.a and also this line: INCDIR += -I/usr/local/include and this ones: # Project Libraries INCDIR += -I../../../Extern/include LIBDIR += -I../../../Extern/lib also delete this word: -lmysqlclient and this one as well: -Wl,-rpath=/usr/local/lib/gccX (there could be any number where there is X) If you don't have "-m32" add before "SRCS = (some text)" or "CPPFILE = (some text)" this: CFLAGS += -m32 Add this before "SRCS = (some text)" or "CPPFILE = (some text)" this: VCPKG_ROOT (your vcpkg directory) LIBS += -lmariadbclient -lssl -lcrypto -lz INCDIR += -I$(VCPKG_ROOT)/installed/x86-freebsd/include LIBDIR += -L$(VCPKG_ROOT)/installed/x86-freebsd/lib Under FreeBSD x64, you have to add this after the LIBDIR += code you have added before: LIBDIR += -L/usr/local/lib32/gccX Under FreeBSD x86 this: LIBDIR += -L/usr/local/lib/gccX Replace X with your gcc major version code, you can grab that from "gcc --version". If you don't have "ENABLE_STATIC = 0" add this before the code we added before (LIBDIR += and INCDR +=) CFLAGS += -static If you have "ENABLE_STATIC = 0" change the 0 to 1. Open game/src/Makefile and delete the following lines (it doesn't matter if you don't have all of them) # boost INCDIR += -I../../../Extern/include/boost # DevIL INCDIR += -I../../libdevil LIBDIR += -L../../libdevil LIBS += -lIL -lpng -ltiff -lmng -llcms -ljpeg # MySQL ifeq ($(BSD_VERSION), 7) INCDIR += -I../../libmysql/7.x-5.1.35 LIBDIR += -L../../libmysql/7.x-5.1.35 else INCDIR += -I../../libmysql/5.x-5.1.35 LIBDIR += -L../../libmysql/5.x-5.1.35 endif LIBS += -lmysqlclient -lz # Miscellaneous external libraries INCDIR += -I../../../Extern/include LIBDIR += -L../../../Extern/lib LIBS += -lcryptopp -lgtest # HackShield INCDIR += -I../../libhackshield/include LIBDIR += -L../../libhackshield/lib LIBS += -lanticpxsvr # XTrap INCDIR += -I../../libxtrap/include and # Boost INCDIR += -I../../../Extern/include/boost # DevIL INCDIR += -I../../../Extern/include/IL LIBS += ../../../Extern/lib/libIL.a\ ../../../Extern/lib/libjasper.a\ ../../../Extern/lib/libpng.a\ ../../../Extern/lib/libtiff.a\ ../../../Extern/lib/libjbig.a\ ../../../Extern/lib/libmng.a\ /usr/lib/liblzma.a\ ../../../Extern/lib/liblcms.a\ ../../../Extern/lib/libjpeg.a # MySQL INCDIR += -I/usr/local/include/mysql LIBS += /usr/local/lib/mysql/libmysqlclient.a /usr/lib/libz.a # CryptoPP LIBS += ../../../Extern/lib/libcryptopp.a and # OpenSSL INCDIR += -I/usr/include LIBS += -lssl -lcrypto # LIBS += /usr/lib/libssl.a and # Project Libraries INCDIR += -I../../../Extern/include INCDIR += -I/usr/local/include LIBDIR += -L/usr/local/lib Before "CFILE = minilzo.c" add this: VCPKG_ROOT= (your vcpkg directory) INCDIR += -I$(VCPKG_ROOT)/installed/x86-freebsd/include LIBDIR += -L$(VCPKG_ROOT)/m2pkg/installed/x86-freebsd/lib LIBS += -lmariadbclient -lcryptopp -lIL -lpng -ljpeg -lssl -lcrypto Under FreeBSD x64, you have to add this after the LIBDIR += code you have added before: LIBDIR += -L/usr/local/lib32/gccX Under FreeBSD x86 this: LIBDIR += -L/usr/local/lib/gccX Replace X with your gcc major version code, you can grab that from "gcc --version". If you don't have "ENABLE_STATIC = 0" add this before the code we added before (LIBDIR += and INCDR +=) CFLAGS += -static If you have "ENABLE_STATIC = 0" change the 0 to 1. Replace: CFILE = minilzo.c with: CFILE = minilzo.c sha1.c Some sources might not have CFILE, in case you don't have it add "sha1.c" after "item_manager_read_tables.cpp" like this: item_manager_read_tables.cpp sha1.c Server: Changes for Windows Open m2server.sln or Metin2Server.sln and update the toolchain if you ask it, ignore any "ServerkeyGenerator" error. Open game.2008.vcxproj with a text editor and add after this: <ClCompile Include="war_map.cpp" /> this: <ClCompile Include="sha1.c" /> <ClCompile Include="sha1.h" /> If you used an old version of the tutorial, please remove this line: <VcpkgUserTriplet>x86-windows-static</VcpkgUserTriplet> You have to remove this line in all the vcxproj files. Open the solution with VisualStudio, select ALL projects, then right click the selection and click Properties. Inside the properties, click on the left "vcpkg" and make sure to select: "Static libraries: Yes" "Auto link: Yes" Client changes Open EterBase/cipher.h and change the following lines: Open cipher.h and modify the following line: encoder_->ProcessData((byte*)buffer, (const byte*)buffer, length); to: encoder_->ProcessData((CryptoPP::byte*)buffer, (const CryptoPP::byte*)buffer, length); and from: decoder_->ProcessData((byte*)buffer, (const byte*)buffer, length); to: decoder_->ProcessData((CryptoPP::byte*)buffer, (const CryptoPP::byte*)buffer, length); Open Eterbase/lzo.cpp and delete this line: #include <lzo-2.03/lzoLibLink.h> "lzo-2.03" may vary, it's important to delete the lzoLibLink inclusion. Open EterBase/lzo.h and check that the #include with lzo1x.h is like this: #include <lzo/lzo1x.h> Open UserInterface/MarkImage.h and before this: #include <IL/il.h> add this: #define IL_STATIC_LIB 1 Open UserInterface.cpp and delete the following line: #include <cryptopp/cryptoppLibLink.h> Inside UserInterface.cpp modifiy this: static const char * sc_apszPythonLibraryFilenames[] = { "UserDict.pyc", "future.pyc", "copy_reg.pyc", "linecache.pyc", "ntpath.pyc", "os.pyc", "site.pyc", "stat.pyc", "string.pyc", "traceback.pyc", "types.pyc", "\n", }; to: static const char * sc_apszPythonLibraryFilenames[] = { #if PY_MINOR_VERSION == 7 "abc.pyc", "bisect.pyc", "codecs.pyc", "collections.pyc", "copy.pyc", "copy_reg.pyc", "fnmatch.pyc", "functools.pyc", "genericpath.pyc", "heapq.pyc", "hashlib.pyc", // new "keyword.pyc", "linecache.pyc", "locale.pyc", "ntpath.pyc", "os.pyc", // removed pyexpat "random.pyc", "re.pyc", "shutil.pyc", "site.pyc", "sre_compile.pyc", "sre_constants.pyc", "sre_parse.pyc", "stat.pyc", "string.pyc", "sysconfig.pyc", "traceback.pyc", "types.pyc", "UserDict.pyc", "warnings.pyc", "weakref.pyc", "_abcoll.pyc", "_weakrefset.pyc", "__future__.pyc", "encodings\\aliases.pyc", "encodings\\ascii.pyc", "encodings\\cp1250.pyc", "encodings\\cp1251.pyc", "encodings\\cp1252.pyc", "encodings\\cp949.pyc", "encodings\\utf_8.pyc", "encodings\\cp850.pyc", //new "encodings\\__init__.pyc", // removed xml #else "UserDict.pyc", "__future__.pyc", "copy_reg.pyc", "linecache.pyc", "ntpath.pyc", "os.pyc", "site.pyc", "stat.pyc", "string.pyc", "traceback.pyc", "types.pyc", #endif "\n", }; Delete the following lines: #if GrannyProductMinorVersion==4 #pragma comment( lib, "granny2.4.0.10.lib" ) #elif GrannyProductMinorVersion==7 #pragma comment( lib, "granny2.7.0.30.lib" ) #elif GrannyProductMinorVersion==8 #pragma comment( lib, "granny2.8.49.0.lib" ) #elif GrannyProductMinorVersion==9 #pragma comment( lib, "granny2.9.12.0.lib" ) #else #error "unknown granny version" #endif or this line: #pragma comment( lib, "granny2.lib" ) Also delete this lines: //ifdef _DEBUG //#pragma comment( lib, "python2_d.lib" ) //#else #pragma comment( lib, "python2.lib" ) //#endif #pragma comment( lib, "devil.lib" ) #ifdef _DEBUG #pragma comment( lib, "jpegd.lib" ) #else #pragma comment( lib, "jpeg.lib" ) #endif #pragma comment( lib, "cryptopp-static.lib" ) #pragma comment( lib, "snappy.lib" ) #pragma comment( lib, "lzo2.lib" ) Delete snappy inclusion if you don't use Type6. If you have ENABLE_PY_CHECK, add before #elif PY_VERSION_HEX==0x020712F0 this one: #elif PY_VERSION_HEX==0x020712F0 { PYFOLD"/abc.pyc", 6594, 0xb23cfe1aL}, { PYFOLD"/bisect.pyc", 3276, 0x306b93d2L}, { PYFOLD"/codecs.pyc", 40678, 0xe2dc76f0L}, { PYFOLD"/collections.pyc", 28295, 0xaffface7L}, { PYFOLD"/copy.pyc", 13236, 0xaf4763dcL}, { PYFOLD"/copy_reg.pyc", 5618, 0x8612d494L}, { PYFOLD"/fnmatch.pyc", 3860, 0xdad2ad3aL}, { PYFOLD"/functools.pyc", 7859, 0x110b58e2L}, { PYFOLD"/genericpath.pyc", 3968, 0x3005313bL}, { PYFOLD"/hashlib.pyc", 7278, 0x709b3325L}, { PYFOLD"/heapq.pyc", 15302, 0x763f87a6L}, { PYFOLD"/keyword.pyc", 2187, 0x6e8bf638L}, { PYFOLD"/linecache.pyc", 3518, 0xe414a862L}, { PYFOLD"/locale.pyc", 57922, 0xe5bae851L}, { PYFOLD"/ntpath.pyc", 14031, 0x2170738fL}, { PYFOLD"/os.pyc", 27862, 0xd1b87519L}, { PYFOLD"/random.pyc", 27469, 0x626a1305L}, { PYFOLD"/re.pyc", 14274, 0xf6615b33L}, { PYFOLD"/shutil.pyc", 20489, 0x5f86796aL}, { PYFOLD"/site.pyc", 20470, 0x1e5d86efL}, { PYFOLD"/sre_compile.pyc", 13175, 0xdb74e1f3L}, { PYFOLD"/sre_constants.pyc", 6400, 0x62725f60L}, { PYFOLD"/sre_parse.pyc", 22632, 0x73a3417bL}, { PYFOLD"/stat.pyc", 3161, 0x505339d3L}, { PYFOLD"/string.pyc", 22550, 0xa831251fL}, { PYFOLD"/struct.pyc", 280, 0x692620a3L}, { PYFOLD"/sysconfig.pyc", 18751, 0x1609c777L}, { PYFOLD"/traceback.pyc", 12499, 0xc55a9ea6L}, { PYFOLD"/types.pyc", 3012, 0xab7ff24eL}, { PYFOLD"/UserDict.pyc", 11556, 0xec08a651L}, { PYFOLD"/warnings.pyc", 14453, 0x191fb51bL}, { PYFOLD"/weakref.pyc", 18614, 0xc850b7d7L}, { PYFOLD"/_abcoll.pyc", 29948, 0x2e08dd19L}, { PYFOLD"/_generate.py", 368, 0xa1759794L}, { PYFOLD"/_weakrefset.pyc", 11646, 0x37eda60dL}, { PYFOLD"/__future__.pyc", 4469, 0xfc87d05aL}, { PYFOLD"/encodings/aliases.pyc", 8811, 0x1cc93e8dL}, { PYFOLD"/encodings/ascii.pyc", 2691, 0x675a99b1L}, { PYFOLD"/encodings/cp1250.pyc", 3347, 0xdbb8207eL}, { PYFOLD"/encodings/cp1251.pyc", 3344, 0x8ef98d98L}, { PYFOLD"/encodings/cp1252.pyc", 3347, 0x7b5e1208L}, { PYFOLD"/encodings/cp850.pyc", 8292, 0xa0865dd5L}, { PYFOLD"/encodings/cp949.pyc", 2065, 0x5f2c4c06L}, { PYFOLD"/encodings/utf_8.pyc", 2294, 0xbc12dc7fL}, { PYFOLD"/encodings/__init__.pyc", 4542, 0x861f2a28L}, Open EterPack/EterPack.cpp and delete this line: #include <cryptopp/cryptoppLibLink.h> Open UserInterface/GuildMarkUploader.cpp and delete: (ILvoid*) Open EterLib/JpegFile.cpp and make sure that jpeglib.h inclusion is like this: #include <jpeglib.h> then remove this line: #include <libjpeg-6b/jpegLibLink.h> "libjpeg-6b" may vary. Inside GrpDetector.h add this after #include <d3dx8.h> #include <string> Inside ScriptLib\StdAfx.h replace: #ifdef _DEBUG #undef _DEBUG #include "../../Extern/Python2/Python.h" #define _DEBUG #else #include "../../Extern/Python2/Python.h" #endif #include "../../Extern/Python2/node.h" #include "../../Extern/Python2/grammar.h" #include "../../Extern/Python2/token.h" #include "../../Extern/Python2/parsetok.h" #include "../../Extern/Python2/errcode.h" #include "../../Extern/Python2/compile.h" #include "../../Extern/Python2/symtable.h" #include "../../Extern/Python2/eval.h" #include "../../Extern/Python2/marshal.h" the Python inclusion may vary to #include <python2.7/Python.h> #include <python2.7/node.h> #include <python2.7/grammar.h> #include <python2.7/token.h> #include <python2.7/parsetok.h> #include <python2.7/errcode.h> #include <python2.7/compile.h> #include <python2.7/eval.h> #include <python2.7/marshal.h> #undef BYTE // Fixed python bitset.h build issue Inside scriptLib/PythonLauncher.h modify #include "../../Extern/Python2/frameobject.h" to: #include <python2.7/frameobject.h> Open scriptLib/PythonLauncher.cpp and modify: #include "../../Extern/Python2/frameobject.h" to: #include <python2.7/frameobject.h> Open scriptLib/PythonMarshal.cpp and modify: #include "../../Extern/Python2/longintrepr.h" to: #include <python2.7/longintrepr.h> Open ScriptLib/PythonUtils.cpp and if we don't have this #define PyLong_AsLong PyLong_AsLongLong #define PyLong_AsUnsignedLong PyLong_AsUnsignedLongLong add it after this: #include "PythonUtils.h" Open EterBase\StdAfx.h and modify: // Armadillo nanomite protection #ifndef NANOBEGIN #ifdef __BORLANDC__ #define NANOBEGIN __emit__ (0xEB,0x03,0xD6,0xD7,0x01) #define NANOEND __emit__ (0xEB,0x03,0xD6,0xD7,0x00) #else #define NANOBEGIN __asm _emit 0xEB __asm _emit 0x03 __asm _emit 0xD6 __asm _emit 0xD7 __asm _emit 0x01 #define NANOEND __asm _emit 0xEB __asm _emit 0x03 __asm _emit 0xD6 __asm _emit 0xD7 __asm _emit 0x00 #endif #endif in: // Armadillo nanomite protection #if !defined(NANOBEGIN) && !defined(NANOEND) #ifdef _DEBUG #define NANOBEGIN #define NANOEND #else #include <armadillo/SecuredSections.h> #endif #endif This change also needs to be applied to the following files: - EterGrnLib/StdAfx.h - MilesLib/StdAfx.h - SpeedTreeLib/StdAfx.h Open MilesLib/StdAfx.h and delete this line: #include <mss.h> Open the client sln file (like Metin2Client.sln or Metin2Client_VC90.sln) if it asks for any linked update press yes. Then go to UserInterface properties, select at the top of the window "Configuration: ", it might be Debug, Release, Distribute, and set it "All configurations": Modify /SAFESEH to /SAFESEH:NO. Select ALL projects, then right click the selection and click Properties. Inside the properties, click on the left "vcpkg" and make sure to select: "Static libraries: Yes" "Auto link: Yes" Go to C/C++, General, you will find "Extra inclusion directories" for something similar. Press the little arrow in the text, then modify. Add the following: $(SolutionDir)Extern\include. Then, select the UserInterface project. Go to Linker, General and find "Extra library directory". Press the little arrow in the text, then Modify. Add the following: $(SolutionDir)Extern\lib. If you used an old version of the tutorial, please remove this line: <VcpkgUserTriplet>x86-windows-static</VcpkgUserTriplet> You have to remove this line in all .vcxproj files. Client: Cleanup and update of binary files Open our clinet directory and delete all DLL with the exception of this (MAKE SURE TO NOT RMEOVE ANY EXTRA DLL YOU HAVE INSERTED) - SpeedTreeRT.dll - granny2.dll - MSS32.dll Delete the "lib" directory and replace with this directory This directory works for Python 2.7. Final notes and infos If you use Granny 2.9 open EterBase/ServiceDefs.h and add this: #define __GRANNY_VERSION__ 9 after #define _IMPROVED_PACKET_ENCRYPTION_ The vcpkg folder already contains MSL (required for marty sources), check in share/moduleinfo.txt and if there is a new commit, you can replace the inclusions, you can also upload the new updated package and I can update the tutorial. The Python libraries I have distributed works for 2.7.18, it includes some encoding modules, this is the last ever version of python 2.7.18 Expat and xml were removed as they don't work with static python (GIL stuff) Fell free to comment with the check code updated and I'll update the post. The Visual Studio and Makefile updates do not apply with CMake or Premake (pff anyone uses them unironically?) The tutorial might not be 100% accurate for all the sources, I have tested it with mainline_released, a marty internet released and some friends sources (Client side) FreeBSD currently does not work on vcpkg, I will look at fixing the issues when I have time. The log.c changes removed 1058340518920543890 logging messages on Windows. The armadillo change not only update the nanomites to the last version (while Armadillo is deprecated) but also fixes some debugging issues, sometimes, calling those asm routimes might corrupt the debugger, so it's better to disable them if they are not required (Debug builds) If you need newer version of granny2, modify granny2.h accordingly, you can also share the update if you wish to. Changes: - Updated to python 2.7.18 (v3) - Removed all x86-windows-static specification as the new vcpkg integration is easier to use. - Ability to customize the vcpkg root directory - Removed all infos about compiling the sources and so on as they were not required in this forum (I do really expect that people knows how to build in this forum) - Removed all the old manual linking as vcpkg supports automatic linking now I apologize for any grammar error or formatting error, I have not checked the post twice, you can freely report any error in the comments. Good luck in your experiments.
  19. I had posted this on the past, and for sure it's not needed but I'll report it anyway. (I can't find old topic). This is just a compilation bugfix for Boost >1.43. What this does, it just makes the VID class hashable for boost. Another, and perhaps better way, to solve this issue is replace all "boost::unordered_map" to "std::unordered_map" (as it was suggested in the past). I'm sure you would get this error from clean 40k sources, anything with the smallest fix should not bother this. vid.h #ifndef __INC_METIN_II_VID_H__ #define __INC_METIN_II_VID_H__ class VID { public: VID() : m_id(0), m_crc(0) { } VID(DWORD id, DWORD crc) { m_id = id; m_crc = crc; } VID(const VID &rvid) { *this = rvid; } const VID & operator = (const VID & rhs) { m_id = rhs.m_id; m_crc = rhs.m_crc; return *this; } bool operator == (const VID & rhs) const { return (m_id == rhs.m_id) && (m_crc == rhs.m_crc); } bool operator != (const VID & rhs) const { return !(*this == rhs); } operator DWORD() const { return m_id; } void Reset() { m_id = 0, m_crc = 0; } DWORD getID() const { return m_id; } private: DWORD m_id; DWORD m_crc; }; std::size_t hash_value(VID const& v) { boost::hash<DWORD> hasher; return hasher(v.getID()); } #endif
×
×
  • 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.