Jump to content

Search the Community

Showing results for tags 'freebsd'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Metin2 Dev
    • Announcements
  • Community
    • Member Representations
    • Off Topic
  • Miscellaneous
    • Metin2
    • Showcase
    • File Requests
    • Community Support - Questions & Answers
    • Paid Support / Searching / Recruiting
  • Metin2 Development
  • Metin2 Development
    • Basic Tutorials / Beginners
    • Guides & HowTo
    • Binaries
    • Programming & Development
    • Web Development & Scripts / Systems
    • Tools & Programs
    • Maps
    • Quests
    • 3D Models
    • 2D Graphics
    • Operating Systems
    • Miscellaneous
  • Private Servers
    • Private Servers
  • Uncategorized
    • Drafts
    • Trash
    • Archive
    • Temporary
    • Metin2 Download

Product Groups

  • Small Advertisement
  • Large Advertisement
  • Advertising

Categories

  • Third Party - Providers Directory

Categories

  • Overview
  • Pages
    • Overview
    • File Formats
    • Network
    • Extensions

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Pillory


Marketplace


Game Server


Country


Nationality


Github


Gitlab


Discord


Skype


Website

  1. 1. Faster and cleaner boot: 2. Alias for shortcuts such as paths and executions. UPDATED! 12.10.2021 3. Disable Send Mail - Credits to: @ martysama0134 (Not waiting after Send Mail Service on boot, it will reduce your boot time with 10 more seconds) Hope it's usefull. It was for me Hope you have a great day! Shahin
  2. In this topic I would like to teach you how to install MariaDB instead Oracle MySQL and why. Why prefer MariaDB instead MySQL? MariaDB it's a fork of MySQL and it is compatible with MySQL. Forecasts indicate that the MariaDB fork replace Oracle MySQL Server as rdbms. MariaDB have more features for performance and data integrity. One of this features is Aria storage engine. Aria is the upgrade of old MyISAM storage engine used on our Metin2 Private server. This old storage engine have some bugs and it isn't ACID like InnoDB. An upgrade of InnoDB is the fork XtraDB, used on MariaDB and Percona. So if you don't want/can't convert your metin2 tables from MyISAM to InnoDB or XtraDB (the best choice) you can use the similar storage engine: Aria. How to install MariaDB on FreeBSD. Administrate MariaDB it's like MySQL. The service is mysql-server and the path of MariaDB home directory is /var/db/mysql, like classical Oracle MySQL server. Remove old MySQL server installation. If you have mysql-server installed you need to deinstall it: Make a security's backup of your mysql data directory: cd /var/db && tar -cvJf mysql.tar.xz mysql Make a real backup of your applicative db (metin2, website etc.) with dump. You can use the CLI utility mysqldump or GUI with Navicat (right click on db name->Dump SQL file->Structure and data). Stop Mysql-server with: service mysql-server stop Remove mysql directory: rm -rf /var/db/mysql Find the mysql version: mysql --version Deinstall mysql from ports: cd /usr/ports/databases/mysqlxx-server && make deinstall clean && cd /usr/ports/databases/mysqlxx-client && make deinstall clean Where xx is the version find on previous step. Install MariaDB This thread was written when the lastest version of MariaDB was 10.1 update your ports tree: portsnap fetch update Install MariaDB: cd /usr/ports/databases/mariadb101-server && make install clean if not present, enable mysql service: echo "mysql_enable=YES" >> /etc/rc.conf start mysql server: service mysql-server start Import your application databases (metin2, website etc.) from dump. Do not import from datafile! If you use navicat, remember to create a new connection for MariaDB instead MySQL Convert MyISAM to new storage engine For better performance and security of your data you need to convert all of your table with a new storage engine. You can choose a different storage engine for each table. I suggest you to choose between Aria (new MyISAM) or XtraDB (new InnoDB). Choose Aria to read fastest and low write (example item_proto, mob_proto, shop, shop_item) or FULLTEXT index feature (to search fastest on text culomn). Choose XtraDB to critical table with hight write frequency (example player, item, account). To convert from one storage engine to another you have two ways: Via GUI like Navicat (one table at time). Right click on the table -> Design Table->Options->Engine. Change and save. Via query: ALTER TABLE <table_name> ENGINE=<engine>; This solution don't exclude the necessity of db backups. Please scedule frequently backup of your applicative dbs from dump. See mysqldump utility. For much safety, do also a datafile backup of entire mysql data directory (/var/db/mysql). It's for emergency restore of all mysql if dump import don't work. Use datafile restore only for whole mysql directory and only if there aren't another solution with dump.
  3. 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.
  4. Hello Friends You know that so many files are shared in the Forum that some of them are compiled with GCC8 - GCC9 or GCC10. There is also MySQL, of course, if it is on MySQL, MySQL 5.6 or MariaDB 10.3 is used. That's why I will share 2 different Freebsd VDIs on a single topic. 1 - Mysql 5.6 Version 2 - MariaDB 10.3 Version You can download and use these 2 VDIs according to your needs. ISO File Used - 2021-Apr-09 06:58 ; Freebsd Login ; User : root Password : dev Package Installation List for MySQL 5.6 ; gcc10: 10.3.0 gcc8: 8.5.0_1 gcc9: 9.4.0 gdb: 10.2_1 gmake: 4.3_2 makedepend: 1.0.6,1 mysql56-client: 5.6.51 mysql56-server: 5.6.51 python27-2.7.18_1 Package Installation List for MariaDB 10.3 ; gcc10: 10.3.0 gcc8: 8.5.0_1 gcc9: 9.4.0 gdb: 10.2_1 gmake: 4.3_2 makedepend: 1.0.6,1 mariadb103-client: 10.3.30 mariadb103-server: 10.3.30 python27-2.7.18_1 Download Link ; Google.Drive (Download) Dosya.Upload (Download) Virüs Scan ; Thank you for using it and for your nice comments. Enix Yazılım.
  5. There instructions have been tested on FreeBSD 12.1! First of all we want to install update the package repository: pkg update If you have never used pkg probably you will be asked to install it. Now run this command to install php7.4 and nginx pkg install php74 nginx We can install the most common php extensions running this command: pkg install php74-extensions php74-mysqli php74-mbstring php74-curl php74-gd The following extensions will be installed: php74-ctype: 7.4.14 php74-curl: 7.4.14 php74-dom: 7.4.14 php74-extensions: 1.0 php74-filter: 7.4.14 php74-gd: 7.4.14 php74-iconv: 7.4.14 php74-json: 7.4.14 php74-mbstring: 7.4.14 php74-mysqli: 7.4.14 php74-opcache: 7.4.14 php74-pdo: 7.4.14 php74-pdo_sqlite: 7.4.14 php74-phar: 7.4.14 php74-posix: 7.4.14 php74-session: 7.4.14 php74-simplexml: 7.4.14 php74-sqlite3: 7.4.14 php74-tokenizer: 7.4.14 php74-xml: 7.4.14 php74-xmlreader: 7.4.14 php74-xmlwriter: 7.4.14 Enable nginx and php service to automatically start sysrc nginx_enable=yes sysrc php_fpm_enable=YES We can start nginx and php for the first time by running service nginx start service php-fpm start You can open now your web browser and type the server ip in the address bar. You should see a page like this We are going to configure nginx now. Open the file nginx.conf located in /usr/local/etc/nginx and modify the section "server": server { listen 80; server_name _; root /var/www; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; include fastcgi_params; } location ~ /\.ht { deny all; } } Change mydomainname.com with your domain (or server ip). We can test now if php is working correctly. The files of your webiste will be hosted in the folder /var/www (you can change it in the configuration above). Create a new file inside that folder and call it index.php with this content: <?php phpinfo(); Now open again the browser and type the ip address/domain name and you should see something like this: The server is working properly and you can upload now your script You might need to install more php extentions according to the requirements of your script
  6. Hello community, About Firewall This firewall is ideal for those who have a national server and not an international server. It is based on GEO block, adding new countries or removing them is extremely easy. Currently I can easily say that it is the best pf that is published for free at the level of efficiency. I attacked the firewall several times, it was tested on online servers with 700/800 simultaneous players and it worked efficiently without problems. Warning The best protection that can be applied is at the network level. there is no point in having 1 firewall running on an operating system if the network does not support a large amount of traffic for the operating system's firewall to be able to act. This firewall in combination with a good VPS/dedicated VPS and good network protection on the company side can easily handle small to medium attacks. All the magic happens because of GEO BLOCK, without GEO BLOCK it is equivalent to the pf's shared here in the community. The code is not optimally organized and can be improved, remembering that it was my first version. Requirements -pftop (PF) -wget How To Setup [Hidden Content] Questions? Comment, as soon as possible I will answer. Best Regards, Papix
  7. You too? You want to create a server for our favorite MMORPG?! You will be able to make your dream come true ! This guide is exclusively compatible with Metin2 Project. Are you ready? Gooo! Install the Virtual Machine Spoiler Prerequisites Download and install the latest version of VirtualBox Download the latest version of the Metin2 Project Virtual Machine Storage: 25GB RAM: 2GB Introduction VirtualBox is virtualization software. A Metin2 Server runs mostly on an operating system called FreeBSD. It's therefore necessary to virtualize a second computer within yours to operate your Metin2 Project Server. It's the virtualization of a second operating system that consumes resources in processor, RAM and storage on the host system, your computer. If you are using a dedicated server, you will install FreeBSD as the main operating system without using Windows! The Metin2 Project Virtual Machine is ready to use, it's already preconfigured to be usable, even for a neophyte! Ready? Gooo! You need to open the « OVA » file by clicking on it, like to open your favorite software. The extension is recognized automatically by Windows and is associated with VirtualBox. You must click on the button « IMPORT » and let VirtualBox work, it imports your Metin2 Project Virtual Machine for your greatest happiness ! It has successfully imported your Metin2 Project Virtual Machine! Congratulations ! Configure the Virtual Machine Spoiler Introduction By default, your Metin2 Project Virtual Machine is partitioned into a local network within your computer. This manipulation consists of making your router and your virtual machine communicate and allowing it access to the Internet network. Ready? Gooo! You must click on the name of your virtual machine then click on « CONFIGURATION ». A part that is very important, this is where you give your virtual machine the power to connect to the world and control all of us ! Click on « NETWORK » and choose « BRIDGED ADAPTER » then select the primary network card that your computer uses, « WIFI » or « ETHERNET ». You also have the possibility to modify the various parameters of your virtual machine, such as the RAM, the power of the processor... Click the « OK » to save the changes. Manage the Virtual Machine Spoiler Introduction It's important to know how to manage a virtual machine, starting it and shutting it down are actions that you are likely to perform regularly when managing your Metin2 Project Server. Ready? Gooo! All you have to do is start your Metin2 Project Virtual Machine ! For that, it's very simple you have to right click on the name of your virtual machine and it will offer you several choices including: « START » or « CLOSE » when you want to turn it off. When it has finished starting, you must have this on your screen, you must identify yourself using the identifiers that are available on the topic where you downloaded Metin2 Project, when entering the password it will not be displayed no, this is absolutely normal. So here you have the main interface between your computer and your virtual machine, it's a bit like your second screen! It must imperatively remain open otherwise it would turn off your computer . Trick It's possible to restart your Metin2 Project Virtual Machine using a command! When you are connected and identified on the VirtualBox interface or using PuTTY, all you have to do is enter the following command then validate with the « ENTER »key on your keyboard: reboot Retrieve the IP Address Spoiler Introduction An IP address is like your postal address, if we don't know it, we can't know where you are. An IP address represents the postal address, the location of your Metin2 Project Virtual Machine on your network. Ready? Gooo! You will retrieve the address of your virtual machine, it has an address, a home and it does not pay rent! This address, which is exclusively numeric is the IP address, it's specific to each computer, whether physical or virtual. You will be able to connect to the various tools to manage your Metin2 Project private server but also to connect to the game! For that, it's very simple you have to enter the following command in the VirtualBox interface: ifconfig In our example, the IP address of the virtual machine is: « 192.168.0.21 ». Use PuTTY Spoiler Prerequisites Download the latest version of PuTTY Introduction PuTTY is an SSH client, it allows you to connect to your FreeBSD Server in SSH. It's more or less similar to a remote control software like AnyDesk or TeamViewer except that it's used in command line! This saves you the uncomfortable interface of VirtualBox. PuTTY being much more ergonomic for copying and pasting commands... Ready? Gooo! Enter the IP address in the field: Host Name (or IP address) Enter the SSH port in the field: Port (Default: 22) Enter a name you want in the field: Saved Sessions Click on the « SAVE » button to save the connection parameters You must double click on the registered server of your choice to initiate a connection. PuTTY will ask you for the username and password of your FreeBSD user, this corresponds to the credentials used on your VirtualBox interface. It may also ask you to confirm the connection to the SSH Server and indicate a security problem, don't panic and click on « YES ». Use EterNexus Spoiler Prerequisites Download the latest version of EterNexus Download the Metin2 Project Client Introduction EterNexus is a software which will allow you to decompress and compress the « EIX » and « EPK » archives of the « PACK » folder of your Metin2 Project Client, these archives contain absolutely all the game data, images, texts, models, textures... Ready? Gooo! You have to extract the files from EterNexus and move them to the « PACK » directory of your Metin2 Project Client. You will find a folder with the same name of the archive that you unzipped in the directory where the archive is located. To unzip an archive: EterNexus will recreate a new archive with the same name of the folder and in the same location where the same directory is located. To compress an archive: Configure the Metin2 Project Client Spoiler Prerequisites Download and install the latest version of Notepad++ Download and install the latest version of WinRAR Introduction It's necessary to link your Metin2 Project Client to your Metin2 Project Server, for this we will enter the IP address of your server within the game client configuration. Ready? Gooo! You must first extract the Metin2 Project Client archive. In order to configure your Metin2 Project Client and link it to your Metin2 Project Virtual Machine, you must configure the IP address within your Metin2 Project Client. You must extract the archive « ROOT » and you will find a multitude of files there, the one that interests us is « SERVERINFO.PY », it contains all the information about your server, the IP address, the name, the port of access... At the beginning of this file, there is a list of sample servers to guide you through the changes. At the beginning of the file you must find the following block: SRV_LOCALHOST = { 'name':'LOCALHOST', 'host':'127.0.0.1', 'auth':11002, 'c1':13001, 'ids':'10', } You need to modify the line similar to: 'host':'XXX.XXX.XXX.XXX', You must replace « XXX.XXX.XXX.XXX » by the IP address of your Metin2 Project Virtual Machine then save the changes. After that, you simply need to compress the « ROOT » archive. This means that when you run the Metin2 Project Client, you will need to select the « LOCALHOST » server. Use Navicat Spoiler Prerequisites Download and install the latest version of Navicat Introduction Navicat is a graphical database management and development software suite, it will allow you to manage your databases and the data stored in them. Navicat is not limited to MySQL, it's also able to connect to other SQL Servers such as PostgreSQL, Oracle, SQLite, MariaDB... As part of Metin2 Project, we use MySQL, the database records and stores all data relating to your Metin2 Project Server, accounts, characters, inventories, state of quests... Ready? Gooo! To start the configuration of Navicat, you must click on « CONNECTION » then choose « MYSQL », MySQL is the engine of our database used in Metin2 Project. Logins are available on the topic where you have downloaded Metin2 Project. Enter the name you want in the field: Connection Name Enter the IP address in the field: Host Enter the MySQL port in the field: Port (Default: 3306) Enter the username of a public account in the field: User Name Enter the password associated with your user in the field: Password Check the box: Save password In order to ensure that the connection is established, you can click on the button: « TEST CONNECTION » if you have the message below, everything is good! It only remains to confirm by clicking twice on the buttons: « OK ». To connect to a MySQL Server, you must double click on the name of the previously added server. In the left part of Navicat, to see all the data of your Metin2 Project Server you must click on « TABLES ». To open a data table, also double click on it. Create an Account on Metin2 Project Spoiler Prerequisites Encrypt password Ready? Gooo! Creating an account on your Metin2 Project Server is easy, for that we will use Navicat to connect to the MySQL Server. We are going to modify the « ACCOUNT » table, it's located in the « ACCOUNT » database. To manually add an account from Navicat, you must click on the « + » at the bottom left and fill in the boxes, these fields are the most important, everything else is optional and will be filled in automatically with the default settings: ID: Do not fill, it fills automatically LOGIN: The username of the account we use to connect to the game client PASSWORD: This is the password, which you must first encrypt SOCIAL_ID: This is the code for deleting a character EMAIL: This is the email address of the account CREATE_TIME: Account creation date STATUS: Account status, « OK » or « BLOCK » if he should be banned SECURITYCODE: ? AVAILDT: ? MILEAGE: DC CASH: MD GOLD_EXPIRE: Double Drop Chance for Items SILVER_EXPIRE: 50% More experience SAFEBOX_EXPIRE: More storage space in the Warehouse AUTOLOOT_EXPIRE: A Hand that Automatically Picks Up Yangs FISH_MIND_EXPIRE: The chance of catching a Fish increases MARRIAGE_FAST_EXPIRE: Love points increase faster MONEY_DROP_RATE_EXPIRE: Double Chance of Yang Drop LAST_PLAY: Last login date This ensures that your passwords are not in the clear in your database, a measure of security and confidentiality. Finish by pressing the « ENTREE » key on your keyboard to confirm and save. Assign « GM » permissions Spoiler Introduction Adding permissions to a user involves a lot of responsibility, for this we will use Navicat to connect to the MySQL Server. We are going to modify the « GMLIST » table, it's located in the « COMMON » database. To manually add an account from Navicat, you must click on the « + » at the bottom left and fill in the boxes: MID: Do not fill, it fills automatically MACCOUNT: The account ID the one to use to connect with the game client MNAME: This is the name of the character, it must be strictly identical, if it's not yet existing, it does not matter, the important thing here is to choose a name that will be that of your character MCONTACTIP: The box is empty by default, however some explanations: this allows the rights to be assigned to an account according to the player's IP address, this prevents someone from connecting to the account to take advantage of the accesses, to be avoided if the player to a dynamic IP address MSERVERIP: The box is on « ALL » by default, however some explanations: this is in the case where you have several Metin2 servers running on the same FreeBSD Server, this allows you to assign access to a particular server, it requires adding the server IP in the « GMHOST » table MAUTHORITY: This is the level of access rights in play, you can check the access level of an order from the sources of Metin2 GOD: Limited access HIGH_WIZARD: Limited access WIZARD: Limited access LOW_BIZARD: Limited access IMPLEMENTOR: Full access Finish by pressing the « ENTREE » key on your keyboard to confirm and save. You have defined the accesses, you must reload them, two solutions: You have an account with an already existing GM character, you must write this in-game command and disconnect / reconnect the concerned account: « /RELOAD A ». You don't have any GM characters, you have to stop and restart the Metin2 Project Server with the Metin2 Project Shell Manager. At this stage, the server has not started, the next start of the Metin2 Project Server will suffice to update your character's accesses. Use WinSCP Spoiler Prerequisites Download and install the latest version of WinSCP Introduction WinSCP is a graphical SFTP client for Windows. It uses SSH and is open source. The purpose of this program is to enable secure copying of files between a local computer and a remote computer. You will use it to transfer files to it. With WinSCP you will be able to explore the content of your Metin2 Project Virtual Machine as if you were on your computer with Windows and its file explorer. You will find there the files of the FreeBSD operating system, the programs which have been installed, but also, most importantly, the files of our Metin2 Project Server. Ready? Gooo! When you open the program for the first time, it automatically offers you the connection manager: Enter the IP address in the field: Host name Enter the SSH port in the port number: Port number (Default: 22) Enter Username: root: in the field: Username Enter the password for: root: in the field: Password Click on the button: Save... Enter the name you want in the field: Save session as Check the box: Save password (not recommended) Click on the button: OK To initiate the connection, you must double click on the server you have registered. WinSCP will automatically connect with the username and password that have been registered. It may also ask you to confirm the connection to the SFTP Server and announce a security issue, don't panic, click « YES ». Start the Metin2 Project Server Spoiler Prerequisites Using Metin2 Project Shell Manager Introduction Metin2 Project comes with a powerful program, Metin2 Project Shell Manager. It allows you to manage your Metin2 Project Server with ease! Ready? Gooo! To invoke it, you need to run this command on PuTTY: cd /usr/m2_project && sh m2sh.sh You have a multitude of options available to you that allow you to manage Metin2 Project as simply as possible. Each time you run the above command, you must choose one of these options by entering it and then validating it with the « ENTER » key on your keyboard. Enter: 103 Ready? Gooo! Spoiler Introduction It's time for you to materialize in the virtual and wonderful world of Metin2 Project ! Enjoy the great and beautiful Metin2 Project adventure... Made With and
  8. M2 Download Center Download Here ( Internal ) [CLICK] Here to download the necessary file. The file gcc-4.9-20130804.tar.bz2 we put it in the address /usr/ports/distfiles in our FreeBSD Once this is done we go to FreeBSD and enter the following command cd /usr/ports/lang/gcc49/ && make install clean When entering this command between 30 seconds and 3 minutes, a blue screen will appear and we will give it in OK and the installation will start... The installation will last between 2 and 3 hours, DO NOT close the FreeBSD or Putty during installation.
  9. Hello guys, Recently I have been updating my whole workflow and I discovered Ninja. To be concise, Ninja is basically a more modern and lightweight equivalent to "Make" that we (almost) all use. Its motto is simple, avoid being too complex to allow for a faster build & rebuild time, while allowing a human-readable syntax. I will just paraphrase them : "When you are in a edit-compile cycle you want it to be as fast as possible — you want the build system to do the minimum work necessary to figure out what needs to be built immediately. [...] Ninja contains the barest functionality necessary to describe arbitrary dependency graphs. Its lack of syntax makes it impossible to express complex decisions." Long story short, using it, you will basically build slightly faster & rebuild your project even faster. Let's get started! Then you are good! As a rule of thumb, you can use the following commands the same way you use your previous Make commands: Clean your solution: ninja -t clean Build your solution using a number of workers: ninja -j<number_of_workers> Have a nice day!
  10. Hello everybody! Today I was with a friend and he needed to download some files directly from Mega on his server and I happened to know a way, I even use it whenever it is necessary to transfer large files to the server, such as backups in tar.gz. The big advantage is that the file transfer speed is very high so it goes faster than doing it via ftp from your computer. I believe it can be useful for many. I'm posting because I didn't find anything in the community teaching how to do it. Basically the method used is the installation of a package called MEGA TOOLS I leave the tutorial: #1 Install the Megatools package ([Hidden Content]) with the command: Then go to the mega file you want to download and get the link. But attention, the link has to be direct to the file that you want to download, it cannot be a folder, because no file will be downloaded, even if it is inside the folder. and type the command: and your file will be downloaded directly to the current directory, you can choose a directory to which you want to download the file, for example: then I hope that was clear and that it is useful for some of you. Sorry if my english is not the best
  11. 1. Foreword If you are like me and enjoy spending time fiddling with FreeBSD, or you want to make it a bit harder to avoid making mistakes because you edited the wrong file or something, it pays off to set up some coloring in your FreeBSD shell. Not for the aesthetics, but to identify easier: who we are (user), where we are (path), and what are we looking at (file coloring) First let's start with the subject of shells. Zsh is pretty popular among programmers, and it also provides an easy way to do exactly what we want through the Oh My Zsh addon. Oh My Zsh is a package designed to make zsh easier to use; you can head here for more details if you want to know more: [Hidden Content] Note that you can use zsh as a root shell, but any Unix admin worth his salt will tell you that root should be using one of the default shells available with FreeBSD, since, if you run into any issue with the shell, you won't be able to su to root, which is pretty bad. So I will also explain how to do exactly the same coloring with FreeBSD's default shell, csh. Now for the sake of example, let's say we have two users to deal with: root, and the user for our metin2 server which is aptly called metin2 [Note: a sensible approach in such setup is to forbid root from logging in through ssh and do that through the unprivileged metin2 user instead, using su whenever we need root access. I won't talk about this topic here though, just do not forget to add this metin2 user to the wheel group so he can su to root, if you follow this strategy.] 2. Installing Zsh So let's login as root and install the zsh shell first. We can do it from packages or ports, just stick to one method or you will break dependencies and other nasty stuff. pkg update pkg install zsh Or for ports: portsnap auto cd /usr/ports/shells/zsh make install cleam Now let's create our unprivileged user if we don't have one yet: adduser metin2 We wil get a bunch of questions, just leave the defaults - ecept for the shell which will be zsh, and in "Invite to other groups?" you should type wheel here, so we can superuser (su) into root. And of course you would want to type a password, though I prefer using ssh keys for login myself. That was easy wasn't it? 3. Installing oh-my-zsh Now let's switch to our new user with: su metin2 Note: Something that annoys me is how the keypad doesn't work in zsh, specifically the / * - symbols which I use all the time. To amend this, you can add the keybindings in this post in .zshrc. Note they may differ depending on your keyboard - press ctrl+v and then the desired key to find out that key's code: [Hidden Content] Make sure we are at the home directory (/home/metin2) and then proceed to install Oh My Zsh: fetch [Hidden Content] sh install.sh Yes we can install oh-my-zsh even though we are not the root user; of course it will work only for this user. Now try logging in a second Putty window to make sure everything works as intended - it's a good practice when we are changing stuff like shells, ssh or firewall parameters, to make sure we don't get locked out of our own system. 4. Setting up an oh-my-zsh theme Once installed, by editing the .zshrc file found in our home directory you can change the color scheme or theme to any of the ones available - be aware though that the FreeBSD terminal only supports 16 colors by default, so all those fancy Linux ones won't work properly without heavy modification of the environment. [Hidden Content]/wiki/Themes Luckily for you I will provide here my own color scheme perfectly adapted for this amazing operating system, in case you want to use it - just create a new file called .oh-my-zsh/themes/wom.zsh-theme -mind the dot before oh-; paste this on it, save and then set the theme as "wom" in the beginning of the .zshrc file -again mind the dot-. # WoM2 oh my zsh theme by Shogun if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="white"; fi PROMPT='%{$fg[$NCOLOR]%}%B%n@%m%b%{$reset_color%}:%{$fg[green]%}%B%0d%b%{$reset_color%} $(git_prompt_info)%(!.#.$) ' RPROMPT='[%*]' # git theming ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[yellow]%}%B" ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} " ZSH_THEME_GIT_PROMPT_CLEAN="" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}▒~\~W" # LS colors, made with [Hidden Content] export LSCOLORS="ExGxfxcxbxegehbhbgacad" zstyle ':completion:*' list-colors "di=1;34:ln=35:so=32:pi=33:ex=1;31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43" Now once you are done you can open a new session (either login on a second Putty window if you're unsure about whether your changes could break something, or else just su to the same user again su metin2) and play around with the ls and cd commands to check directory listing and autocompletion are properly colorized. If you want to make your own theme, you can replace the parameters of the PROMPT (self explanatory), LSCOLORS (directory listing) and list-colors (autocomplete) - for the later two you can get the appropiate strings here: [Hidden Content] Note that the brownish color in this tool is actually yellow in FreeBSD, and that to access the second set of 8 colors you should mark "bold" which is not really bold but a different shade of the same color. 5. Shell coloring in csh Okay time to move to the root user and its default system shell which is a bit less user friendly. I prefer to get rid of the user specific settings file /root/.cshrc by deleting all the lines on it except for the comments at the start (hint - Ctrl+K in the ee editor deletes the line you're in) and then edit the system wide /etc/csh.cshrc file instead, so the changes apply to all users which use csh. # $FreeBSD: releng/11.3/etc/csh.cshrc 50472 1999-08-27 23:37:10Z peter $ # # System-wide .cshrc file for csh(1). # # WoM2 theme by Shogun on 31st April 2020 umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) set color setenv EDITOR ee setenv PAGER less setenv BLOCKSIZE K setenv LSCOLORS ExGxfxcxBxegehbhbgacad setenv LS_COLORS "di=1;34:ln=1;36:so=35:pi=32:ex=1;31:bd=34;46:cd=34;47:su=31;47:sg=31;46:tw=30;42:ow=30;43" alias h history 25 alias j jobs -l alias la ls -aFG alias lf ls -FAG alias ll ls -lAFG alias ls ls -G set red="%{\033[1;31m%}" set green="%{\033[1;32m%}" set yellow="%{\033[1;33m%}" set blue="%{\033[1;34m%}" set magenta="%{\033[1;35m%}" set cyan="%{\033[1;36m%}" set white="%{\033[1;37m%}" set end="%{\033[0m%}" # This is needed at the end of the prompt if ($?prompt) then # An interactive shell -- set some stuff up set prompt = "${red}%N@%m:${green}%~${white} %# ${end}" set promptchars = "%#" set filec set history = 1000 set savehist = (1000 merge) set autolist = ambiguous # Use history to aid expansion set autoexpand set autorehash set mail = (/var/mail/$USER) if ( $?tcsh ) then bindkey "^W" backward-delete-word bindkey -k up history-search-backward bindkey -k down history-search-forward endif endif # Clean up after ourselves... unset red green yellow blue magenta cyan yellow white end These settings will result in exactly the same coloring as in my wom theme for oh-myzsh; besides I set ee as the default editor and less as the default pager. Feel free to change these to your liking. For those curious about the topic I will explain the parts of this file related to coloring, since documentation on the net is pretty sparse about this: set color enables coloring for autocomplete. Without this, the LS_COLORS line below won't have any effect. setenv LSCOLORS will define the colors for directory listing (ls) - note that for this to work ls needs to be invoked with either the -G or the -l parameter, that's why we add the alias ls ls -G line. The parameters defining colors here are the same as in oh-my-zsh. setenv LS_COLORS defines the color scheme for the autocomplete, just like list-colors did in oh-my-zsh. Once again, it works the same way parameter wise. Interestingly, this parameter is used for ls in Linux, hence the confusing naming of the variables. The set red, green, etc lines are just a helper for coloring the prompt later on the script here: set prompt = "${red}%N@%m:${green}%~${white} %# {end}" 6. Notes What if we want to use zsh and oh-my-zsh for root as well? In that case you should not install it from the unprivileged user but from root. And what if we want to install oh-my-zsh for several unprivileged users, leaving root with csh (that's my own setup) - You will notice that if you try to install oh-my-zsh a second time, you will get an error. The way around this is, assuming we are logged in as this other user (let's call it "www") and in its home directory - let's call it /home/www: unset ZSH rm .zshrc rm .zsrhz-local (if exists) Now you can follow the same steps listed earlier to install it as this user. 7. TL; DR If you want some prettier colors but can't bother reading this or don't feel confident changing stuff, just copy and paste this on your putty window while you are logged in: echo 'set color' >> ~/.cshrc echo 'alias ls ls -G' >> ~/.cshrc Happy BSDing!
  12. Hello community! This guide is for those who want to edit the default FreeBSD text editor. I will use the nano editor in the explanation but it is optional. Guide [Hidden Content]
  13. Hi everyone, Since I have just set up a new server using the latest versions of both FreeBSD, I took the chance to come back and make a little contribution to my old forum. NOTE: MySQL 5.7 and newer deprecate the PASSWORD() function and thus requires changes on the source and on your website code. Install MySQL 5.6 instead if you are not ready for this - these instructions should work just fine with it, except for the my.cnf path 1. Physical server setup I divided this guide into three parts; hardware setup, OS and MySQL. Previous to the configuration of the OS we will have, of course, rented our server and set up some partitions. In my case, it's a server with 64 GB RAM and 2 NVMe disks. NVMe disks are the fastest in the market, performing even better than SSD. As for the OS, my provider, a very popular french company, offers only one BSD option - a premade template using Freebsd 11.3 ZFS, which I chose. Next I opted for ENglish and "set custom partitions". In the partition setup screen, I decide to assign MySQL its own partition on /var/db/mysql, with roughly three quarters of the space available (400 GB) and leave the rest for everything else. Finally I set a 2GB swap partition. Note that since we are using a RAID setup, the space taken by our partitions show as double. [A RAID, to explain it in layman terms, is a number of hard drives, all containing the same data, working simultaneously - so if one of them fails, the server can continue to work until the faulty disk is replaced and no data or uptime is lost. The downside is that the extra hard drives don't give us any extra space, a price that is worth paying for mission critical applications like this] Having MySQL in its own partition is not strictly needed so if you don't know how much space your MySQL partition will need, just make one big partition for everything (Mountpoint "/") and delete the default "/home" partition which is of little use for us. Remember to use the arrow icon when you set up your last partition to make sure you're using all the available space left! Once done here, enter a hostname for your server and let it get installed. Once completed, you will receive an e-mail with the root password, which you can use to connect to your server through putty on port 22. I won't explain here the usage of putty. 2. Upgrading to latest FreeBSD 2.1 Standard upgrade procedure I have highlighted the word upgrade so you notice we are talking about updating the whole kernel here to a new version - thus, an upgrade. Once we logged in, it's time to update our server to the latest FreeBSD release which at the time of writing this post is 12.1, but do check here first: freebsd.org freebsd-update upgrade -r 12.1-RELEASE Follow the on screen instructions. We have a clean system, so when asked "Does this look reasonable?" feel free to answer y as we are not going to break anything at this point. However, if you upgrade an existing server you should check each file that is being changed, assuming you know what those changes mean of course. You will be eventually shown, as in every OS update, a list of files to be updated - just type :q and enter to keep going. Finally you will be prompted to type "freebsd-update install" and, after the installation is done, to reboot. Now we are supposed to rebuild our ports, since we did not install anything yet and there is nothing to rebuild we will ignore this step; otherwise, rebuild your ports or upgrade your packages using either "portmaster -GaD" or "pkg update". Finally we will type freebsd-update install and we will have our new version of FreeBSD ready to use. 2.2 Standard update procedure If you are using OVH, it's time now to change your repositories since OVH does not provide updates for FreeBSD 12 in their custom repos yet, so we will be pulling our updates from the standard FreeBSD repositories instead. The downside is that we won't be able to use OVH's Real Time Monitoring system, but in my experience it is not of much use anyway. So let's do this: ee /usr/local/etc/pkg/repos/FreeBSD.conf If the file is empty, paste the following text: FreeBSD: { url: "pkg+[Hidden Content]", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", enabled: yes } Now let's disable OVH repos: ee /usr/local/etc/pkg/repos/OVH.conf And change both instances of "enabled: yes" to "enabled: no". If OVH adds FreeBSD 12 repositories to their repos at some point, you can always revert this change in the future. And now it's time to test updating our system works: portsnap fetch extract pkg update pkg upgrade If you just installed version 12.1 of FreeBSD like me it's possible that pkg is not working for you either. The solution is the following: pkg-static install -f pkg Then you should be able to run pkg normally. 2.3 Rebuilding databases Some system databases need to be rebuilt after a change, such as the changes resulting in a release upgrade like the one we just made. Also, we want to add our e-mail to receive root e-mail messages which may be important. ee /etc/aliases under: # root: [email protected] add: root: [your email] Save and exit, and then let's sync the users database: newaliases /usr/sbin/pwd_mkdb -p /etc/master.passwd 2.4 Set up sendmail By default, FreeBSD generates audits periodically which can alert us to issues in our system (see crontab). So we will have them forwarded to our email. ee /etc/crontab We add at the top: MAILTO=[our email address] This forwards the cron output to our chosen mail address. Now to basic sendmail setup: cd /etc/mail/certs openssl dhparam -out dh.param 4096 NOTE: if you run your own mail server, you should add it as a smart host for sendmail; take a look here: [Hidden Content] Check /var/maillog to make sure everything works. (Be aware that your mail server might not like some random unknown server sending e-mail to it, so receiving them may require some work.) 2.4 Weeding out issues Version 12 being quite new, we will find some things are a bit buggy. These actions are not (should be not) part of the installation process, but are particular issues encountered with version 12. I got some error message with Perl 5.30 while building ports so I installed it from ports and the problem is gone: cd /usr/ports/lang/perl530 && make install clean Another error was caused by SSL missing, so I installed OpenSSL to solve it: pkg install openssl And added this lime in /etc/make.conf so the ports stop complaining when building. /etc/make.conf does not exist in the base install, so just create it. DEFAULT_VERSIONS+=ssl=openssl 2.5 System tuning There are hundreds of guides in the internet about tuning this or other sysctl setting on FreeBSD. Take them with a pinch of salt as they may not be appropiate to your FreeBSD version, and the default settings change in every version, potentially leaving former tuning settings obsolete. Here are a few ones that are proven to apply to this specific case: in /boot/loader.conf # prevent swapping by mysql - set this to a quarter or half of your RAM - ZFS only! vfs.zfs.arc_max="16G" In /etc/sysctl.conf kern.ipc.soacceptqueue=512 # max incoming TCP connections (default is 128, not very good in case of DDoS) compat.ia32.maxdsiz=2147483648 # compatibility for 32 bit apps Finally, if you want to have a firewall, you may want to install pf. I think I made a guide at some point, in any case it's beyond the scope of this tutorial. On a production server, you should also set up ssh key authentication and log in through an user specially created for running your Metin server. Remember to add this user to the wheel group so you can su into root from it as necessary; thereafter you can disable password authentication altogether in /etc/ssh/sshd_config. There are plenty of guides as well on how to do this, as it's a very standard procedure in the Unix world. 3. Installing MySQL 8 3.1 The installation itself Allright so far so good. Now it's time for MySQL 8. I have no idea why they decided to jump from 5.7 to 8 straight away, but it seems MySQL 8 does better on benchmarks than the previous versions. So I will attempt to run Metin on it. pkg install mysql80-server pkg install mysql80-client Add in rc.conf mysql_enable="YES" Now let's disable binary logging to save space, by commenting this line in /usr/local/etc/mysql/my.cnf #log-bin = mysql-bin And disable strict SQL - Metin does not like it: sql-mode = "" At this point you should start MySQL and check everything is fine: service mysql-server start Note you do not need to run mysql_upgrade in this version. Now you should import whichever data you want to import into MySQL. Do not just copy the files, use mysqldump. You should not import the mysql database if you're upgrading from older MySQL or MariaDB versions - add your users manually there. 3.2 Important changes in MySQL 8.0 Of course this version is faster and more efficient and so on, but it's not up to me to explain those changes. What I am going to go over is changes in configuration and behavior that you need to know about. Note that MySQL 8.0 does not create passwords with the old algorithm by default. We have to enable it. Also - very important- the MySQL PASSWORD() function has been deprecated - replace it in your code if you use it (the source does use it). Creating an user with the old password method: CREATE USER 'nativeuser'@'localhost'IDENTIFIED WITH mysql_native_password BY 'password'; Or you can set this as default in my.cnf. Note the FreeBSD port of MySQL 8 saves my.cnf in /usr/local/etc/mysql/my.cnf - instead of /usr/local/etc/my.cnf as older versions used to do. [mysqld] default-authentication-plugin=mysql_native_password 3.3 Getting my.cnf ready If you are using the default config file supplied, make sure you set max_conections to a reasonable number, let's say 200. Optionally, we can set do some tuning as well. # tuning for large RAM (>16GB) innodb-flush-log-at-trx-commit = 2 # safe on ZFS - may corrupt data on non journaling filesystems skip-innodb_doublewrite # tuning for fast disks. Set to 500 for SSD. Remove both lines if your disk is an old SATA drive. innodb_io_capacity = 1000 innodb_flush_neighbors = 0 Here is how our my.cnf looks like with these changes. I have also commented out bind-address since I do want to connect to my database from the outside, but that may not be your case. I have also set innodb_buffer_pool to 16G and innodb_log_file_size to 4G, since I have converted the game tables to InnoDB. If you are not using innodb, you can just leave the default of 1G. # $FreeBSD: branches/2020Q1/databases/mysql80-server/files/my.cnf.sample.in 469734 2018-05-12 15:35:25Z mmokhi $ [client] port = 3306 socket = /tmp/mysql.sock [mysql] prompt = \u@\h [\d]>\_ no_auto_rehash [mysqld] user = mysql port = 3306 socket = /tmp/mysql.sock #bind-address = 127.0.0.1 basedir = /usr/local datadir = /var/db/mysql/ tmpdir = /var/db/mysql_tmpdir slave-load-tmpdir = /var/db/mysql_tmpdir secure-file-priv = /var/db/mysql_secure #log-bin = mysql-bin log-output = TABLE master-info-repository = TABLE relay-log-info-repository = TABLE relay-log-recovery = 1 slow-query-log = 1 server-id = 1 sync_binlog = 1 sync_relay_log = 1 binlog_cache_size = 16M default_password_lifetime = 0 enforce-gtid-consistency = 1 gtid-mode = ON safe-user-create = 1 lower_case_table_names = 1 explicit-defaults-for-timestamp = 1 myisam-recover-options = BACKUP,FORCE open_files_limit = 32768 table_open_cache = 16384 table_definition_cache = 8192 net_retry_count = 16384 key_buffer_size = 256M max_allowed_packet = 64M long_query_time = 5 innodb_buffer_pool_size = 16G innodb_data_home_dir = /var/db/mysql innodb_log_group_home_dir = /var/db/mysql innodb_data_file_path = ibdata1:128M:autoextend innodb_temp_data_file_path = ibtmp1:128M:autoextend innodb_flush_method = O_DIRECT innodb_log_file_size = 4G innodb_log_buffer_size = 128M innodb_write_io_threads = 8 innodb_read_io_threads = 8 innodb_autoinc_lock_mode = 2 skip-symbolic-links # Our stuff here default-authentication-plugin = mysql_native_password max_connections = 200 # disable strict mode (doesnt play well with our queries) sql-mode = "" # tuning for large RAM innodb-flush-log-at-trx-commit = 2 # safe on zfs - may corrupt data on non journaling filesystems skip-innodb_doublewrite # tuning for ssd and nvme innodb_io_capacity = 1000 innodb_flush_neighbors = 0 [mysqldump] max_allowed_packet = 512M quote_names quick For further tuning I recommend running mysql-tuner once in a while. It will provide us with valuable insights on our server; note that you should first let it run live so data can be gathered. cd /root fetch [Hidden Content] perl mysqltuner.pl For instructions visit [Hidden Content] Feel free to comment on any issues you may have with my tutorial, I may try to help.
  14. M2 Download Center Download Here ( Internal ) This guide will walk you through each step of installing the necessary daemons for a Metin2 server on FreeBSD. Asking for help setting up Metin2 on the official FreeBSD forums is not permitted, I suggest if you have issues to ask in this forum only. You may not need to install cURL, it depends on whether or not you'll host your website on the same server and use things that require cURL (such as automatic paypal transactions). It's recommended to host your website on a separate web server and not share the IP with anyone then run it through CloudFlare. A guide will be posted soon in these forums on how to run your website through CloudFlare while preventing CloudFlare IP resolvers from functioning. However, if you do run your website on another server I would recommend hosting it in the same datacenter because you'll need to use Remote MYSQL to access your database. - For sake of simplicity I'll be using "ee editor" for this guide. Most new people don't like vi anyway. If you're already familiar with vi, feel free to use that to edit text inside files instead. - To transfer files to and from your server, use WinSCP. - To enter commands into your server, use PuTTy. Please note that when the system asks you for a password in PuTTy you won't see it as you type it on the screen, be precise! - Pressing the TAB key in PuTTy will auto-complete as much as possible in the directory you're in. Downloads Libs: [Hidden Content] 1. Updating Ports portsnap fetch extract portsnap update 2. Installing Python 2.7 cd /usr/ports/lang/python27 make -DBATCH install clean pro tip: Use the "-DBATCH" flag for a default installation of the port. Skip all those annoying prompts during installation. 3. Standard C++ Libraries fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/9.1-RELEASE/lib32.txz tar Jxpvf lib32.txz -C / rm lib32.txz Unrar "Libs.rar" and put the files in the "/usr/lib32" directory. 4. Compat7x Because Metin2 was originally meant to be run on FreeBSD 7, we need this so that it's compatible with FreeBSD 9. cd /usr/ports/misc/compat7x && make -DBATCH install clean pkg_add -r compat7x-amd64 5. Install & Configure MySQL 5.6 server cd /usr/ports/databases/mysql56-server make BUILD_OPTIMIZED=yes BUILD_STATIC=yes make WITH_XCHARSET=all install clean Now we make it start on each startup of the system. ee /etc/rc.conf Add a new line: mysql_enable="YES" Press ESC then save and close the file. service mysql-server start /usr/local/bin/mysqladmin -uroot password 'enterpassword' pro tip: "enterpassword" should be the password you choose, don't use "enterpassword" as your password. A long string of lower case and capital letters and numbers is the safest bet. Don't use words that can be found in a dictionary. Don't use passwords which are the same as other passwords of yours. You may not need to do this, but when I got an OVH server it messed up the installation of mysql (on 9.2). If you get an error about the mysql user account with the step above, just do this: pwd_mkdb -p /etc/master.passwd chown -R mysql /var/db/mysql && chgrp -R mysql /var/db/mysql Then repeat the step. 6. Adding your server files and Metin2 Database Extract your game.tar.gz containing all the Metin2 server files somewhere in your server. This is all you have to do to extract a .tar.gz file: tar -zxvf filename.tar.gz You should have your metin2 database inside of a tarball (.tar.gz file). For structure, it doesn't really matter as long as once you extract your tarball on your server it follows this file hierarchy: Now you should change the group and ownership of some files for your database: service mysql-server stop chown -R mysql /var/db/mysql && chgrp -R mysql /var/db/mysql service mysql-server start Setup an account for you to login to the database via Navicat and an account for your game cores to interact with your database using. For this example I'll use the username "rumor" for my account and "metin2" for the game core's account. Every password in this example will be "password" but please DO NOT use this as your password! If you have a static IP address and wish to restrict access to the database only to your IP, change the "%" sign to your IP. The "%" sign indicates that any IP address is allowed to connect to the database using the specified credentials. mysql -p Now enter the password you set with mysqladmin earlier... and you will see this prompt: mysql> This is where we set the actual permissions for the accounts up. GRANT ALL PRIVILEGES ON *.* TO 'rumor'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO 'metin2'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; quit pro tip: remember (or write down) this information because you will need it later. Setup your CONFIG files under each channel folder and the "auth" folder. All of these are found inside the Metin2 server files. PLAYER_SQL: localhost metin2 password player COMMON_SQL: localhost metin2 password common LOG_SQL: localhost metin2 password log The conf.txt file looks a little bit different and it's found in the "db" folder of your Metin2 server files. SQL_ACCOUNT = "localhost account metin2 password 0" SQL_PLAYER = "localhost player metin2 password 0" SQL_COMMON = "localhost common metin2 password 0" SQL_HOTBACKUP = "localhost hotbackup metin2 password 0" ~~~~ STOP HERE IF YOU'RE RUNNING YOUR WEB SERVER SOMEWHERE ELSE ~~~~ 7. Setting up web server for website and/or patcher Install nginx: cd /usr/ports/www/nginx make install clean Make sure these are selected with space bar: [X] HTTP_MODULE Enable HTTP module [X] HTTP_ADDITION_MODULE Enable http_addition module [X] HTTP_CACHE_MODULE Enable http_cache module [X] HTTP_GEOIP_MODULE Enable http_geoip module [X] HTTP_GZIP_STATIC_MODULE Enable http_gzip_static module [X] HTTP_IMAGE_FILTER_MODULE Enable http_image_filter module [x] HTTP_PERL_MODULE Enable http_perl module [X] HTTP_REALIP_MODULE Enable http_realip module [X] HTTP_REWRITE_MODULE Enable http_rewrite module [X] HTTP_STATUS_MODULE Enable http_stub_status module Press "Enter" when ready to continue. Install libtool cd /usr/ports/devel/libtool make install clean Install php5 cd /usr/ports/lang/php5 make config Make sure the following is selected with space bar then press "Enter": [X] FPM Build FPM version (experimental) Leave everything else default. then do this: make install clean ~~~~ If you need cURL support then do this, if not then skip this step: cd /usr/ports/lang/php5-extensions make config Make sure that the "CURL Support" is selected then press "Enter". Then do the installation and clean the directory: make -DBATCH install clean ~~~~ Time to configure your php.ini file... cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini Edit /usr/local/etc/php.ini in WinSCP using Notepad++. Firstly, set your "date.timezone" to the appropriate one. Choose from this list: [Hidden Content] Next, if you have something that needs to run large MYSQL queries you may run into some issues. Some website packages also can cause these problems. The issue is with memory usage. For security reasons there are limitations set on how much memory php is allowed to use. I suggest only modifying this IF you have problems loading memory-intensive pages. Just try to raise it a bit until it works, don't raise it to an excessively high number. I had to set mine to "512M" to make my queries work in my patcher. It can be set by just inputting numbers and they will be recognized as bytes, or you could use K, M, or G. memory_limit = 512M Installation of php-mysql5: cd /usr/ports/databases/php5-mysql make -DBATCH install clean If you've gotten this far, congratulations.. you're almost done! You need to create a folder for your website like this: mkdir /usr/local/www/nginx/domain.com Set the owner and permissions: chown www:www /usr/local/www/nginx/domain.com chmod 755 /usr/local/www/nginx/domain.com Customize this file to your needs and upload it to /usr/local/etc/nginx: If you're using cloudflare, uncomment the lines 38-57 by removing the "#". The reason for this is to ensure you get the real user IP in your logs rather than cloudflare's IP. If you want to allow directory listing.. ie: [url=[Hidden Content] to present a visitor with a list of files they can access/download then uncomment lines 63 and 73. You MUST change the domain name to your own! Now you need to enable startup of php-fpm and nginx whenever your server is booted: ee /etc/rc.conf Add these lines: php_fpm_enable="YES" nginx_enable="YES" Start your services: service php-fpm start service nginx start Upload your website files to /usr/local/www/nginx/domain.com
  15. M2 Download Center Download Here ( Internal ) Description: Today's New Year's eve, and I felt that I should help the people who can't compile the gamecore/db on FreeBSD, because of the library mess that's usually going on - most people compile DevIL, mysqlclient etc from the ports collection, as this takes a lot of time, hardware resources, and even knowledge for some. Given this situation, I've decided to compile from the official sources of all the required libraries, and tidy a bit up the all lib-includes files, by putting them all into the Extern folder (link below). This allows to brush away some stuff from the Server folder: (Yay, it's so clean and shiny ) [Hidden Content] I've also changed the makefiles according to the needs (link also below). This pre-done stuff should easy the process of compilation a lot for others, not to mention that it should work on all branches (I'm gonna test this next year lol ) Usage: Decompress your Server folder from your favourite branch, and upload it to a FreeBSD machine, which has gmake, makedepend and python installed. Nothing more is needed (except for gcc/g++ ofc). Upload the Extern.tgz archive into the same folder where you put the Server folder, and extract it. Patch the Makefiles in the Server folder with the ones from Makefiles.zip. Compile using gmake / gmake all / gmake game / gmake db from within the Server folder. Video (da n00b prooph part): Note: my English pronounciation isn't that great; I'll be adding subtitles asap. Downloads: Extern.tgz: [Hidden Content] Makefiles.zip: [Hidden Content] Happy New Year!
  16. Hello, today I will introduce steps to install a web server under FreeBSD. We need to install some programs: Main Programs -MySql56 Server -Appache24 -PHP 5.6 -Php 5.6 extensions -php 5.6 extra-extensions Advanced Firewall -IP Filter -mod_security -mod_antiloris -mod_evasive Before you begin configuring the web server you must install PKG. In FreeBSD console type: Command1: pkg after Y -> ENTER ( to confirm install) After : pkg update Installing and configuring MySQL. Now the mysql server : In the freebsd console type these commands : pkg install mysql56-server echo 'mysql_enable="YES"' >> /etc/rc.conf service mysql-server start --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Now create the mysql " root " user : mysql -u root GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'password' WITH GRANT OPTION; flush privileges; exit Where does the password, you put your desired password. DONE mysql Installing and configuring Apache24. pkg install apache24 The following command: echo 'apache24_enable="YES"' >> /etc/rc.conf --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Now open winscp and navigate to /usr/local/etc/apache22/httpd.conf In httpd.conf looking for the following line: # ServerName www.yourdomain.com:80 And delete # from you httpd.conf (# ServerName www.yourdomain.com:80 ) Delete # --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Now start the service : service apache24 start READY. Now to test if it works. Open a webpagee, and type the ip adress used for VDS (VPS ) If everything is OK should appear in the website: It Works !! Installing and configuring PHP 5.6 The command : pkg install php56 pkg install mod_php56 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Open /usr/local/etc/apache24/httpd.conf : And verifi if you have this line : LoadModule php5_module libexec/apache24/libphp5.so If there is no add manually. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- You open the FreeBSD console and put it and ENTER command: cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Now let’s configure Apache. Open the file /usr/local/etc/apache24/httpd.conf and look for the following line: DirectoryIndex index.html And change it so it reads as follows: DirectoryIndex index.html index.php --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Now apache just needs to know what it should parse the PHP files with. These two lines should be added to the httpd.conf file, and can be put at the bottom if needed: Or search in httpd.conf lines that start with new line AddType and start with these two: AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- If want to use PHP code inside of .htm files you can just add on those extensions. AddType application/x-httpd-php .php .htm .html --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- As an optional step, if you’d like to add multilanguage support to Apache, uncomment the following line( in httpd.conf) : Include etc/apache24/extra/httpd-languages.conf service apache24 restart service mysql-server restart --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Okay, now to test if it works php. Type this command in freebsd console : # echo "<? phpinfo(); ?>" >> /usr/local/www/apache24/data/index.php [Hidden Content] And type the ip on used by VDS (VPS) on a web browser. Installing and configuring php 5.6 extensions and extra extensions. pkg install php56-extensions pkg install php56-mysqli pkg install php56-mysql pkg install php56-gd pkg install php56-openssl DONE Varnish cache > Best Http accelerator pkg install varnish Then rc.conf : echo 'varnishd_enable="YES"' >> /etc/rc.conf Starting varnish . /usr/local/etc/rc.d/varnishd start Check if varnish really run? /usr/local/etc/rc.d/varnishd status varnishd is not running. Now, View varnish configuration ee /usr/local/etc/varnish/default.vcl Inside the file I see these : # Default backend definition. Set this to point to your content # server. # # backend default { # .host = “127.0.0.1”; # .port = “8080”; # } It means the content need to run on port 8080. Remove all # mark to be like this : backend default { .host = “127.0.0.1”; .port = “8080”; } 127.0.0.1 =replace with you ip host (vps, vds ) etc... save the file. Change apache configuration to run on port 8080. ee /usr/local/etc/apache22/httpd.conf Changer : Listen 80 with : Listen 8080 save the file. Restart apache : service apche24 restart Now retry to run varnish ? /usr/local/etc/rc.d/varnishd start Chech varnish : /usr/local/etc/rc.d/varnishd status P.S : you can enable varnish log echo 'varnishlog_enable="YES"' >> /etc/rc.conf /usr/local/etc/rc.d/varnishlog start Security Antiloris protection Slowloris allows a single machine to take down another machine’s web server with minimal bandwidth and side effects on unrelated services and ports. The tools used to launch Slowloris attack can be downloaded at [Hidden Content] Slowloris tries to keep many connections to the target web server open and hold them open as long as possible. It accomplishes this by opening connections to the target web server and sending a partial request. Periodically, it will send subsequent HTTP headers, adding to—but never completing—the request. Affected servers will keep these connections open, filling their maximum concurrent connection pool, eventually denying additional connection attempts from clients. Install this : pkg install mod_antiloris Find the following line in your httpd.conf ( and uncomment it ? If there is this line after installing mod_antiloris add manually. #LoadModule antiloris_module libexec/apache24/mod_antiloris.so ModSecurity pkg install www/mod_security ModSecurity requires firewall rule definitions. Most people use the OWASP ModSecurity Core Rule Set (CRS). The easiest way to track the OWASP CRS repository right now is to use Git. Let's make a directory for all our ModSecurity related stuff, and clone the CRS repository under it. pkg install git mkdir -p /usr/local/etc/modsecurity cd /usr/local/etc/modsecurity git clone [Hidden Content] crs Copy the default ModSecurity config file, and fetch a necessary file which is currently not included in the package: cp /usr/local/etc/modsecurity.conf-example modsecurity.conf fetch [Hidden Content] cp crs/modsecurity_crs_10_setup.conf.example modsecurity_crs_10_setup.conf Now we create an Apache configuration snippet in Apache's modules.d directory. It loads the ModSecurity module, and includes the configurations and CRS: ee << EOF > /usr/local/etc/apache22/modules.d/000_modsecurity.conf # Load ModSecurity # Comment out the next line to temporarily disable ModSecurity: LoadModule security2_module libexec/apache22/mod_security2.so <IfModule security2_module> # Include ModSecurity configuration Include etc/modsecurity/modsecurity.conf # Include OWASP Core Rule Set (CRS) configuration and base rules Include etc/modsecurity/modsecurity_crs_10_setup.conf Include etc/modsecurity/crs/base_rules/*.conf # Add custom configuration and CRS exceptions here. Example: # SecRuleRemoveById 960015 </IfModule> EOF When the configuration is all set, simply restart Apache, and confirm that ModSecurity is loaded by checking Apache's log file: service apache22 restart Log file saved to : /var/log/httpd-error.log Hopefully, the log will show something like this: ModSecurity for Apache/2.4.2 ([Hidden Content]) configured. ModSecurity: APR compiled version="1.4.8"; loaded version="1.4.8" ModSecurity: PCRE compiled version="8.34 "; loaded version="8.34 2013-12-15" ModSecurity: LIBXML compiled version="2.8.0" What log says is diferent by appache version Now that ModSecurity is active, try making a suspicious request to your web server, for instance browse to a URL [Hidden Content]. The CRS has a rule against this type of request. After browsing to the URL, you should now see this request logged in /var/log/modsec_audit.log. You'll notice that the request succeeds, and the response is sent to the browser normally. The reason is that ModSecurity runs in DetectionOnly mode by default, in order to prevent downtime from misconfiguration or heavy-handed blocking. You can enable blocking mode simply by editing modsecurity.conf and changing the following line : SecRuleEngine On Again, restart Apache. Now, make the same suspicious request to your web server. You should now see a "403 Forbidden" error! In practice, it's probably best to keep SecRuleEngine DetectionOnly for some time, while your users exercise the web applications. Meanwhile, you should keep an eye on /var/log/modsec_audit.log to see what is being blocked. If there are any false positives, you need to mitigate this by writing custom exceptions. Mod_evasive -DOS Hash Table Size -DOS Page Count -DOS Site Count -DOS Page Interval -DOS Site Interval -DOS Blocking Period -DOS Email Notify -DOS System Command -DOS Log Dir -Whitelisting IP Addresses Coming soon If you know other vulnerabilities leave a message and i edit solving. Going to edit my post time. When I have time,about security. If you need to install more extensions, leave message in topic. And I'll edit the post and fill you: D If you have errors, such as missing libraries or other errors will ask something in the topic. All steps tested on FreeBSD 10.1
  17. Welcome to the second part of my guide series. This time I'll tell you how you can compile with gcc48 or even gcc49 like it's the case in vanilla and how you can use c++11 which will allow much more and faster instructions than the old one. At first we need to have a look at our Makefile. Make sure you edited the Line SVN_VERSION so you won't receive any errors. Try it e. g. to SVN_VERSION = mt2 Next, you'll have to declare what compiler you want to use. Of course you first need to install the compiler, but I guess it's clear (if you haven't done so, just use cd /usr/ports/lang/gcc49 or even 48 and use make install clean). The line normally say: CC = g++ This is the standard compiler. You may want to change this line to: CC = g++49 Or if you're using 48, change it to CC = g++48 Now before you compile it, you'd recompile all needed libs with gcc48/gcc49 too! So change the compiler in the makefile and recompile the sources in the following directories: libgame/src libpoly libserverkey libsql libthecore/src And then you need to recmopile cryptopp with the newer gcc version too! It's located in the Extern/cryptopp-directory. Now you can compile your game and even your db source with the newer gcc version. You may experience a much smaller file size. The newer compilers will produce an even more faster and smaller gamefile than before. Oh and if you want to carry out the lib-files you're using on your compiling machine (to make sure everything runs smoothly) you may use the following CFLAG: -Wl,-rpath,/usr/local/lib32/metin2 You can change the path to whatever you want! If you specify this, you instruct the linker to use this path so whenever you start your game/dbcache it'll first look in the given directory for the right libs and then, if it can't find the libs there, it'll look elsewhere. Using c++11 is a must-have if you want to make new statements. The source code how to load the database without txt-files needs the newer c++ version, so you'll have to upgrade at least the dbcache for it. But you'll experience even more smaller file sizes with this change so it keeps up with more and more advantages. First you may want to specify the new CFLAG. It's called: -std=c++11 This tells the compiler to use c++11. Keep in mind that not every compiler can use c++11! The newer gcc version can deal with it without any problems. If you compile your source then, you may find a new error occuring! Open every .cpp and .h-file in Notepad++ and do the following things (you can use the mass replacement of Notepad++): replace typeof with __typeof replace auto_ptr with unique_ptr Watch out for the common-directory too! Then you can recompile the source and it's done! Oh and for this you don't need to compile every other sourcecode with c++11. You can e. g. only compile the dbcache with it. Last small hint: You can play with the tuning flags to get even more optimization. -O2 can sometimes be good, but sometimes it's better to use others flags. You can even use -O3 or -Ofast. But be careful with this and consider using -fstrict-aliasing so the compiler won't optimize instructions that'd lead into a crash if it'd optimize them. And always: Pay attention to the warnings your compiler throws at you! They aren't there to just "hang out". They'd lead into crashes, so care about them. Lastly I hope you enjoyed the guide. As in the last one, please tell me if it's good or not and if you have any questions: Feel free to ask.
  18. Hello everybody! Me again. I will share with you the current library here. So, let's do this. for Server (Don't forget to get backup!) before anything else(if required) portsnap fetch extract #1: If you installed mysql: if(mysql) else #2: after and for Client soon
  19. [Hidden Content] For this tutorial, your PC must supports virtualization technology. Benchmarks: 1- Enable virtualization technology(SVM Mode). I enabled at bios. But you can do this whit different ways: 2- Enable VT at VirtualBox: 3- Enable I/O APIC at VirtualBox: 4- Change Processor setting. Before check your CPU Core Count: Usage: Don't use gmake j command like: gmake -j20 Usage: gmake -j(core+1) Example I have 4 cores: gmake -j5
  20. Hello guys today i'm gonna show u how to compile the source in freebsd. First of all you need and dns or a dedicated server because in hamachi server we can not use the fetch command We will install Gmake,Makedepend,Svn(subversion),Devil,G++ 1)gmake: cd /usr/ports/devel/gmake && make install clean 2)makedepend: cd /usr/ports/devel/makedepend && make install clean 3)svn: cd /usr/ports/devel/subversion && make install clean 4)devil: cd /usr/ports/graphics/devil && make install clean 5)G++: cd /usr/ports/lang/gcc48/ && make install clean NOTE: if you have already installed some of this step just skip the step and follow the other Then you do this: From libdevil/ copy all .a files into /usr/lib From libgame/From lib copy the From libgame.a file into /usr/lib From libhackshield/From lib copy the From libanticpxsvr.a file into /usr/lib From liblua/From lib copy the .a files into /usr/lib From libpoly/ copy the .o files into /usr/lib From libserverkey/ copy the .o files into /usr/lib From libthecore/From lib copy the From libthecore.a files into /usr/lib After copying the files into the /usr/lib do this: go to Extern folder of the novaline and open the include folder and copy everything into /usr/include go to Extern/Lib folder of the novaline branch and copy everything from there to /usr/lib go to Extern folder of the novaline branch and drag the cryptopp and openssl folders into /usr/include So we have installed everything then we have to upload the branch novaline into /usr/src then u give this command in freebsd: cd /usr/src/novaline/Server cd /usr/src/novaline/Server/ gmake To build db: cd /usr/src/novaline/Server/db/src gmake clean gmake -j20 To build game: cd /usr/src/novaline/Server/game/src gmake clean gmake -j20 Fixing the error: g++ directory": No such file or directory Solution: here
  21. At first the people can say "what i do if i have loss my phone." You can't loss your phone if you are doing this. What ever Everyone know this system as Google Authenticatior. This is not only for this. Google LastPass Facebook Dropbox & Spideroak Microsoft Yahoo! Mail Amazon Web Services (AWS) A few mmorpg is use this system for theirself games. Step 1 : - Install libqrencode. This lib provide see QR Code in your SSH terminal. cd /usr/ports/graphics/libqrencode make && make install Step 2 : - Install Google Authenticator. cd /usr/ports/security/pam_google_authenticator make && make install Step 3 : - Download Google Authenticator from Google Play and install that. Step 4 : Write this command in your ssh terminal. Write "y" for each question. You will see QR code. Take that QR Code via your android phone. Google Authenticator is show you that program in google play if you don't have Bardcode scanner. google-authenticator Step 5 : Write this command in your ssh terminal. ee /etc/ssh/sshd_config after find this : #ChallengeResponseAuthentication yes Change via this : ChallengeResponseAuthentication yes Step 6 : Write this command in your ssh terminal again. ee /etc/pam.d/sshd file after add this : auth optional /usr/local/lib/pam_google_authenticator.so ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Step 6.5 : Follow this If you are not sure to loss your phone Write this command in your ssh terminal again. ee /etc/pam.d/sshd file after add this auth requisite /usr/local/lib/pam_google_authenticator.so - What is change? Google authenticator give a few password (Step 2 end). Save them When you are trying to log in again, you should write the code from what google authenticator give for pwd. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Step 7 : Write this command in your ssh terminal. service sshd reload - How is work this system ? Google authenticator is create new password in 5-10 seconds. They must know this if someone know your password. Screen from my server. €dit 2: If someone want to apply this theirself webpage, here a link for you ASP.Net PHP Kind RegardsZerelth ~ Ellie
  22. Hi devs, I'm not a person who discovered this issue but I would like to share this with you. According to source: „On September 24, 2014, a GNU Bash vulnerability, referred to as Shellshock or the "Bash Bug", was disclosed. In short, the vulnerability allows remote attackers to execute arbitrary code given certain conditions, by passing strings of code following environment variable assignments. Because of Bash's ubiquitous status amongst Linux, BSD, and Mac OS X distributions, many computers are vulnerable to Shellshock; all unpatched Bash versions between 1.14 through 4.3 (i.e. all releases until now) are at risk.“ How to check if my machine is in a risk? All you have to do is execute this code: env 'VAR=() { :;}; echo Bash is vulnerable!' 'FUNCTION()=() { :;}; echo Bash is vulnerable!' bash -c "echo Bash Test" If your output is „Bash Test“, then you are safe and you can continue without any troubles. In oposite case you have to be worried, because your input is „Bash is vulnerable!“ and your machine is not safe. How do I become safe? You should update version of bash ASAP. You can do it easily by executing this command: pkg upgrade bash Attention: Now execute test program again and you should be safe, because it will give you correct output. Sources: [Hidden Content] [Hidden Content] [Hidden Content]
  23. Hi guys, today i'm gonna show you how to reset a root password usualy as a .vdi FreeBSD x.x doesen't depend actually wich version because those are default commands initialy launched from the begining of FreeBSD. I am not sure if this is posted somewhere if yes, please excuse me, so let's move on. First thing, when starting the .vdi at the loader screen choose Single User Mode, in my case this is sortet as option number 2 so after pressing 2 the FreeBSD is loading a bunch of codes and we have to wait a little. The number where the Single User Mode is set can be different from FreeBSD to FreeBSD. Second, now after the machins is prompt and we are in the /bin/sh we can change our password. Enter the following commands: fsck Then just press y when asked until you finish and see the following screen. After making the fsck (wich help us changing the password with no errors) use the following commands: mount -u / mount -a passwd After hitting the passwd command, just enter your new password and it should be fine, reboot and that's it! Thank you guys, see you soon with new content hopfuly! Cheers and have a great code.
  24. M2 Download Center Download Here ( Internal ) Hi guys, Today I'm gonna show you how to build enhanceMT server sources on FreeBSD (using FreeBSD 10) Please note that at the moment with only support compiling using CLang (we have to fix a few things to use GCC any help is appreciated). 1. Softwares needed PKG: Check if installed using this command : pkg -vv GIT: pkg install git CMake: pkg search cmake # To see the last package version pkg install cmake<version # The one you find with the command below Boost libs: pkg install boost-all-1.55.0 # Or more, check with pkg search boost CryptoPP: pkg install cryptopp-5.6.2_2 MySQL: pkg install mysql55-server-5.5.41 mysql55-client-5.5.41 DevIL: pkg install devil 2. Get the sources First, create a new folder where you want to checkout the sources and go in that folder with the "cd" command. Then write the following command to checkout the sources from our repo (you need to register here : [Hidden Content] git clone [Hidden Content] Wait until the download is finished then go into the sources folder "Server" : cd Server 3. Configure the solution with CMake Go into the "build" folder : cd build And run the CMake command : cmake ../ 4. Let's build it ! Here you go ! Run the make command: make And that's it ! It wasn't to hard right ? /emoticons/default_happy.png I just want you to remember that enhanceMT is an open source and community project, everyone can work on it. So if you have any suggestions, bugs, fix, etc. just open an issue on GitHub here : [Hidden Content]). Thanks @Kuzuri for testing and writing tutorial on FE. Sgt Fatality
  25. Hello Metin2dev user, todqsay i´m want to show you how to install a Desktop on you Freebsd maschine, with KDE-Desktop, First you must be install XORG to run the Desktop, Put in you maschine: cd /usr/ports/x11/xorg && make install clean This Proces can have a time from 1 hour up to 4 Hour´s... When it finish you must install KDE Software with this code: cd /usr/ports/x11/kde4 && make install clean This Proces can have a time from 1 hour up to 4 hour´s. When that Proces is finished you must edit you config with dies command: /etc/rc.conf you add new lines with this format: hald_enable="YES" dbus_enable="YES" local_startup="${local_startup} /usr/local/kde4/etc/rc.d" kdm4_enable="YES" When that is gfinished make a reboot and you desktop is finished creat
×
×
  • 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.