Jump to content
metin2dev

arves100

Members
  • Content count

    467
  • Joined

  • Last visited

arves100 last won the day on September 1

arves100 had the most liked content!

Community Reputation

97 Excellent

4 Followers

About arves100

  • Rank
    Noble

Profile Information

  • Gender
    Male
  • Location
    Italy

Recent Profile Visitors

856 profile views
  1. How to compile Metin2 server on x64 without jails or VMs First, make sure to use the default FreeBSD compiler (cc for .c and c++ for .cpp), i tryied GCC but i didn't get any result. Second, add "-m32" to all the CFLAGS in your makefile. Finally, make this changes on your srcs if you got any error building with CLang The Extern dosen't need to be changed, but the freebsd libraries must be linked with -L/usr/local/lib32 rather than -L/usr/local/lib. WARNING: I failed to build MySQL/MariaDB Connector with -m32 flags, i recommend you to use a VM/Jail for build x86 libraries char_manager.cpp line 20 there is something that include boost/bind.hpp, change that include with this: #if !defined(__GNUC__) || defined(__clang__) #include <boost/bind.hpp> #endif line 650 change all the function: void CHARACTER_MANAGER::Update(int iPulse) { using namespace std; #if defined(__GNUC__) && !defined(__clang__) using namespace __gnu_cxx; #endif BeginPendingDestroy(); // PC 캐릭터 업데이트 { if (!m_map_pkPCChr.empty()) { // 컨테이너 복사 CHARACTER_VECTOR v; v.reserve(m_map_pkPCChr.size()); #if defined(__GNUC__) && !defined(__clang__) transform(m_map_pkPCChr.begin(), m_map_pkPCChr.end(), back_inserter(v), select2nd<NAME_MAP::value_type>()); #else transform(m_map_pkPCChr.begin(), m_map_pkPCChr.end(), back_inserter(v), boost::bind(&NAME_MAP::value_type::second, _1)); #endif if (0 == (iPulse % PASSES_PER_SEC(5))) { FuncUpdateAndResetChatCounter f; for_each(v.begin(), v.end(), f); } else { //for_each(v.begin(), v.end(), mem_fun(&CFSM::Update)); for_each(v.begin(), v.end(), bind2nd(mem_fun(&CHARACTER::UpdateCharacter), iPulse)); } } // for_each_pc(bind2nd(mem_fun(&CHARACTER::UpdateCharacter), iPulse)); } // 몬스터 업데이트 { if (!m_set_pkChrState.empty()) { CHARACTER_VECTOR v; v.reserve(m_set_pkChrState.size()); #if defined(__GNUC__) && !defined(__clang__) transform(m_set_pkChrState.begin(), m_set_pkChrState.end(), back_inserter(v), identity<CHARACTER_SET::value_type>()); #else v.insert(v.end(), m_set_pkChrState.begin(), m_set_pkChrState.end()); #endif for_each(v.begin(), v.end(), bind2nd(mem_fun(&CHARACTER::UpdateStateMachine), iPulse)); } } // 산타 따로 업데이트 { CharacterVectorInteractor i; if (CHARACTER_MANAGER::instance().GetCharactersByRaceNum(xmas::MOB_SANTA_VNUM, i)) { for_each(i.begin(), i.end(), bind2nd(mem_fun(&CHARACTER::UpdateStateMachine), iPulse)); } } // 1시간에 한번씩 몹 사냥 개수 기록 if (0 == (iPulse % PASSES_PER_SEC(3600))) { for (itertype(m_map_dwMobKillCount) it = m_map_dwMobKillCount.begin(); it != m_map_dwMobKillCount.end(); ++it) DBManager::instance().SendMoneyLog(MONEY_LOG_MONSTER_KILL, it->first, it->second); #ifdef _USE_SERVER_KEY_ extern bool Metin2Server_IsInvalid(); extern bool g_bShutdown; if (Metin2Server_IsInvalid()) { g_bShutdown = true; } #endif m_map_dwMobKillCount.clear(); } // 테스트 서버에서는 60초마다 캐릭터 개수를 센다 if (test_server && 0 == (iPulse % PASSES_PER_SEC(60))) sys_log(0, "CHARACTER COUNT vid %zu pid %zu", m_map_pkChrByVID.size(), m_map_pkChrByPID.size()); // 지연된 DestroyCharacter 하기 FlushPendingDestroy(); } sectree.h line 90 inside find_if function change the it_tree declaration with this #ifdef __clang__ LPSECTREE_LIST::const_iterator it_tree = m_neighbor_list.begin(); #else LPSECTREE_LIST::iterator it_tree = m_neighbor_list.begin(); #endif stdafx.h line 24 after <vector> include change all the part that include boost/unordered_map and tr1/unordered_map to this: #if defined(__clang__) #include <float.h> #include <unordered_map> #include <unordered_set> #define TR1_NS std #elif defined(__GNUC__) #include <float.h> #include <tr1/unordered_map> #include <tr1/unordered_set> #define TR1_NS std::tr1 #elif defined(_MSC_VER) #include <boost/unordered_map.hpp> #include <boost/unordered_set.hpp> #define TR1_NS boost #define isdigit iswdigit #define isspace iswspace #endif We've builded our server on x64 machine, but we created a x86 application. Why? Compiling on x64 increases the value of some C types (eg.: sizeof(int) return 4bit in x86 and 8bit on x64). Let's take for example this packet: typedef struct command_script_button { BYTE header; unsigned int idx; } TPacketCGScriptButton; The size of this packet will be 5 on x86 program, and 9 on a x64 program. If we use a x86 metin2 client, the server will except 9 bytes to be received however it will only receive 5 bytes, leaving the server listening for the 4 remaning bytes. The first, possible fix for x64, is building the metin2 client on x64 bit, loosing compatibily with old x86 PCs. The second, is to change all the packets on client/server to the same data (eg.: int becames int32 etc...), so the server builded in x64 will understand that the int packets are 4 byte and not 8; but, convering (on the rest of the server) a 8byte int into a 4byte int could lead up to loosing data. The wrong fix is to define int,long with int32 and long32 (for example). This won't fix nothing because it's like you're using a x86 program, so you could not use any x64 advantage. PS: Sorry for bad english, i hope it's now more clear for everyone
  2. Wow, maybe the first "fix" i made for Metin2 So much time passed... Anyway : i just created a new variable called g_ipfix witch incredibily it's the same as g_szPublicip. Translation: use PUBLIC_IP rather than CONNECTION_IP or the source edit.
  3. linux M2 port from FreeBSD to Debian (8/9)

    Basicly it's the same as debian but with this change: apt-get becomes pkg there's a system configuration tool called bsdconfig If you want something better, you should check the FreeBSD Handbook
  4. linux M2 port from FreeBSD to Debian (8/9)

    Hello. You clearly have no idea on what you're talking because compat7x is not required on linux. CompatXx are libraries ment to make compatible old freebsd applicaton with new one. I don't know someone who use them today (we build metin2 from source, compatXx are not required). What you really need to port are some usefull BSD function that dosen't exist in linux (strl*). Also you will have a windows-like file server, without the ability to use game99 and other great feature that only FreeBSD had because ymir decided to use kqueue inteasted of any open-source library. Some other stuff (i'm supposing the networking identification) need to be ported. For now, most of metin2 libraries are open-source, you don't really need to port them. You need to focus on metin2 server because it's the onliest that isn't compatible with it.
  5. open gcc49 libs

    Edit. portsnap fetch extract
  6. open gcc49 libs

    Add this to your CFLAGs in Makefile CFLAGS += -Wl,-rpath=/usr/local/lib/gccX where gccX is your version of gcc (ex.: if i use gcc7 i put /usr/local/lib/gcc7)
  7. open 34k sf with source?

    Use 40k source, open locale_inc.h (client) and disable DRAGON SOUL and NEW EQUIP. do the same in service.h (server)
  8. Ok let's repeat XD. Close any visual studio istance. Open db_d, press retry. It will open visual studio automaticly with the screen before.
  9. When db\game crashed, you have to press retry Fix for "cannot launch bla bla": open solution properties -> and select "game" if you want to debug game, "db" if you want to debug db. But you also have to open db\game solution properties, go to Debug "not in any subgroup", on WorkDir properties select the db folder and press ok (For DB) If you want to debug auth select "auth" folder in game project. If you want to debug game select "game" folder in game project. I think you misunderstanded what i told, but your JIT configuration is ok.
  10. @Vanilla clean command is wrong in db makefile clean: @rm -f debug/* @rm -f release/* @rm -f $(BINDIR)/game_r* $(BINDIR)/conv
  11. Welcome to Windows You can use Retry -> It will open a window where you could select the JIT (Just-In-Time Debugger) you have to select metin2Server.sln (if you opened vs with admin rights and you open the server solution) or select a new instance. It will open something like this: You will have something similar to this, you can view the call stack, local variables, console output etc... Btw your error seems releated to tAdminInfo members and next that goes out of range. Check your db loading
  12. Building our Extern from the very beginning

    This is required if you want to use higher compiler (ex: C++11 or greater requires newer boost, GCC > 4.9, CLang > 3.8, MSVC > 2010), also contains a lot of bugfix for the external modules., for example there can be a security issue like this in crpyto++ that could be used to DoS if ASN it's used. The performance could be better because newer code could be faster, overall it's more feature adding and bugfix rathen than performance
  13. Visual Studio 2013 or greater
  14. Hey tutorial created for someone who requested. We will talk about the differences of this platforms and them how to setup it on the PC (i won't do a freebsd tutorial, there are 3000 of them Advantages: - Debugger more Intuitive than GDB - Memory Leak dump without using external programs - Easy start and stop - Console Output more detailed than FreeBSD - No Virtualizzation - Great speed in Release mode - Configuration and Gesture more easier (in my opition) Disadvantages: - Microsoft typedefs (CHAR,BYTE) - fopen,sprintf,swprintf,etc... are insecure , use newer and other stupid warnings because the compiler is special - Windows dosen't have peer redirect (USE_SELECT), other cores won't work - Maybe it wouldn't be easy to create a stop script - Missing some features like HackShield Step 1: Installing MySQL/MariaDB Download MySQL Installer here (you should do that even if you use MariaDB, it have some usefull tools) If you want to use MariaDB click here MySQL Installer: Installation method: Custom Don't install MySQL Server if you want to use MariaDB only Setting up MySQL Server: Standalone MySQL (Do not enable INNODB Cluster) Config Type: Development Machine (on your PC), Server Machine (if you want to use Windows Server) WARNING: on the service page the name must begin with MySQL You could uncheck "Start at Windows" if you want to start the server manually Then move into Execute and finish the install MariaDB Configuration You MUST change the name to something like this or anything else that won't be MySQL else you will die before starting the server (XD), seriusilly change it else there will be service mismatch If you want to install MariaDB with MySQL change the TCP Port If you want to remove MariaDB at System bootup you had to open the services (Run... -> services.msc) Find the name of the service (we setted that before), right click -> Property, Bootup type: Manual (No.. i don't have an English Windows) press apply and then ok Now you will see an icon rappresenting a dolphin (MySQL logo) let's right click them and we will se this If you have installed MariaDB go to Options -> Manage Monitored Items press Add --> Windows Service, select the service of MariaDB, press OK and close. Here, we could easly start, stop and restart out Databases, othen that use MySQL Workbench for run querys and show the server status If you want to launch MySQL Notifier at system startup, close any existing instance (Actions -> Close MySQL Notifier) go to this folder: C:\Program Files (x86)\MySQL\MySQL Notifier 1.1 and launch MySQLNotifier.exe with admin rights, them from the notifier clickActions -> Options, check "Run at Windows Startup" and click Accept Step 2: Database setup Go to C:\ProgramData\MySQL\MySQL Server 5.7\Data (if you use MySQL) or C:\Program Files\MariaDB 10.2\data (if you use MariaDB) and copy the database files here (or take them from /var/db/mysql if you have a VM) We need this folder (for the basic SF setup) account common hotbackup log player Step 3: Creating our SF in local Create a folder where we put our Windows server files (ex: Desktop\metin2_Server) This folder will be the same as we use for FreeBSD, then if must follow the same links and structure as the FreeBSD SF For create a symbolic link open a CMD with admin rights and type this command mklink <source file> <destination file> for the folder mklink /D For who want a (not tested) script in MS-BATCH Starting the server Open db.exe in db folder After you see "[async] 0/0/" or something similar it means that db has been started Launch in the older that you want game.exe and auth.exe making double-click Stopping the server Select the console window (of the core you want to stop) and press ESC button. Remeber that db.exe must be the last core that need to be stopped Notes - The only thing that need to be fixed (if you are using ymir source) is the ip check of "5.x" and "10.x" (easily fixing in Config.cpp) - The folder were we put the files (share_data,etc...) it's the same folder that we use in WinSCP. - All the implementations\tutorials written for FreeBSD are the same. - For building with Windows, you must install Visual Studio, open the file m2server.2008.sln (or copy the vcxproj into your source folder) and build - For building, you must create a compatible Extern, link is here
  15. open SASH EQUIP PROBLEM

    1) If you have sash with item scale: Check item scale and acce attach part in the tut If not: Check msm of your race 2) Check if part_acce is updated in database (try to logout, save player data, etc..)
×