Jump to content

Search the Community

Showing results for tags 'freebsd'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


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


There are no results to display.

There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL






Found 23 results

  1. Hello people, i saw that a lot of people want to start developing on Metin2, but there isn't a place where the people can easly see tutorials without surf the whole internet. My idea is to create a reference for anyone who want to start creating his own server, starting from the first steps into the creation of a full Metin2 Server, but also a place where advanced developers could orient into the complicated parts of this world. The special thing about this wiki is that everyone could add or alter pages (that will be approved by moderators), so everyone could contribute to the wiki. The wiki his hosted inside a website that i own (it would be very complicated handle this kind of project inside any forum). At the monent, the wiki is started and it's only in english. (Translation system will be added, contact me if you would like to translate) The wiki will be completly free and without any kind of advertisement. (But altervista's limitated band could make the site unaccessible) Link here: http://rewardmetin2.rf.gd/index.php/Main_Page Greets!
  2. Hello community, I'vee been struggling all night long for a solution to this: I started a new VM and I installed mysql80-server and configured everything. But when the time came to extract my game's db in the folder, the service died! I couldn't get it back, not without deleting everything I extracted. Since then, I've tried everything, this service hates my tables. I tried manually creating and importing the data 1 by 1 in sql files, error all the time! I tried to import data from another connection and you 'll never guess! It says that '0000-00-00 00:00:00' cannot be set as default value of a datetime field. What do I have to do to get it working???
  3. Sharingan

    open Advice for beginner

    Hi everyone, I apologize from the beginning for my bad english ı want to ask bunch of questions first, ı want to use vanilla core but whats the difference between core and server files second ı download bunch of server files and they contain folders like auth,channel,db,game99,share but some of does not contain only src and what am I have to do for use vanilla core I setup freebsd 10.4 install programs using these topic but I cant success to install - devel/libc++- devel/libcxxrt I think they are not exist
  4. Hi guys. As the title says, i'm having a problem installing some features on my server, for my website. Every time i try to install apache or php i have to write "make install" or "make install clean" or "make...something" i get: "/usr/ports/Mk/bsd.port.mk", line 1043: Unknown directive Unknown modifier 't' Variable .CURDIR is recursive.
  5. Typical

    open Lags in Virtualbox

    (Sorry for mistakes, my English is bad) Hi, for some time now a virtual machine is running very slowly. The commissioning takes only +/- 10 minutes, where it once started in a moment. The screen is not smooth and everything is very slow. I reinstalled it several times and checked it on different versions, but on each one it is the same. The problem only occurs on FreeBSD 9.2. Other versions (such as 9.0 or 9.3) work quickly and do not lag. Before this inscription disappears it takes about 3-4 minutes, and the rest can be seen in the following video. Please help. Log from virtualbox: https://pastebin.com/YmyCRWeV
  6. I am trying recently to learn metin2 developing found several tuts but I keep getting errors some I could fix and the other I cant such as : Can anyone help me please (Note: tried upgrading/updating to FreeBSD 10.2 as FreeBSD web said because it doesn't support 9.2 and 9.3 anymore and its still doesnt work ) I would appreciate some help ty Best Regards , BYB
  7. How to compile Metin2 server on x64 without jails or VMs First, make sure to use the default FreeBSD compiler (cc for .c and c++ for .cpp), i tryied GCC but i didn't get any result. Second, add "-m32" to all the CFLAGS in your makefile. Finally, make this changes on your srcs if you got any error building with CLang The Extern dosen't need to be changed, but the freebsd libraries must be linked with -L/usr/local/lib32 rather than -L/usr/local/lib. WARNING: I failed to build MySQL/MariaDB Connector with -m32 flags, i recommend you to use a VM/Jail for build x86 libraries char_manager.cpp line 20 there is something that include boost/bind.hpp, change that include with this: #if !defined(__GNUC__) || defined(__clang__) #include <boost/bind.hpp> #endif line 650 change all the function: void CHARACTER_MANAGER::Update(int iPulse) { using namespace std; #if defined(__GNUC__) && !defined(__clang__) using namespace __gnu_cxx; #endif BeginPendingDestroy(); // PC 캐릭터 업데이트 { if (!m_map_pkPCChr.empty()) { // 컨테이너 복사 CHARACTER_VECTOR v; v.reserve(m_map_pkPCChr.size()); #if defined(__GNUC__) && !defined(__clang__) transform(m_map_pkPCChr.begin(), m_map_pkPCChr.end(), back_inserter(v), select2nd<NAME_MAP::value_type>()); #else transform(m_map_pkPCChr.begin(), m_map_pkPCChr.end(), back_inserter(v), boost::bind(&NAME_MAP::value_type::second, _1)); #endif if (0 == (iPulse % PASSES_PER_SEC(5))) { FuncUpdateAndResetChatCounter f; for_each(v.begin(), v.end(), f); } else { //for_each(v.begin(), v.end(), mem_fun(&CFSM::Update)); for_each(v.begin(), v.end(), bind2nd(mem_fun(&CHARACTER::UpdateCharacter), iPulse)); } } // for_each_pc(bind2nd(mem_fun(&CHARACTER::UpdateCharacter), iPulse)); } // 몬스터 업데이트 { if (!m_set_pkChrState.empty()) { CHARACTER_VECTOR v; v.reserve(m_set_pkChrState.size()); #if defined(__GNUC__) && !defined(__clang__) transform(m_set_pkChrState.begin(), m_set_pkChrState.end(), back_inserter(v), identity<CHARACTER_SET::value_type>()); #else v.insert(v.end(), m_set_pkChrState.begin(), m_set_pkChrState.end()); #endif for_each(v.begin(), v.end(), bind2nd(mem_fun(&CHARACTER::UpdateStateMachine), iPulse)); } } // 산타 따로 업데이트 { CharacterVectorInteractor i; if (CHARACTER_MANAGER::instance().GetCharactersByRaceNum(xmas::MOB_SANTA_VNUM, i)) { for_each(i.begin(), i.end(), bind2nd(mem_fun(&CHARACTER::UpdateStateMachine), iPulse)); } } // 1시간에 한번씩 몹 사냥 개수 기록 if (0 == (iPulse % PASSES_PER_SEC(3600))) { for (itertype(m_map_dwMobKillCount) it = m_map_dwMobKillCount.begin(); it != m_map_dwMobKillCount.end(); ++it) DBManager::instance().SendMoneyLog(MONEY_LOG_MONSTER_KILL, it->first, it->second); #ifdef _USE_SERVER_KEY_ extern bool Metin2Server_IsInvalid(); extern bool g_bShutdown; if (Metin2Server_IsInvalid()) { g_bShutdown = true; } #endif m_map_dwMobKillCount.clear(); } // 테스트 서버에서는 60초마다 캐릭터 개수를 센다 if (test_server && 0 == (iPulse % PASSES_PER_SEC(60))) sys_log(0, "CHARACTER COUNT vid %zu pid %zu", m_map_pkChrByVID.size(), m_map_pkChrByPID.size()); // 지연된 DestroyCharacter 하기 FlushPendingDestroy(); } sectree.h line 90 inside find_if function change the it_tree declaration with this #ifdef __clang__ LPSECTREE_LIST::const_iterator it_tree = m_neighbor_list.begin(); #else LPSECTREE_LIST::iterator it_tree = m_neighbor_list.begin(); #endif stdafx.h line 24 after <vector> include change all the part that include boost/unordered_map and tr1/unordered_map to this: #if defined(__clang__) #include <float.h> #include <unordered_map> #include <unordered_set> #define TR1_NS std #elif defined(__GNUC__) #include <float.h> #include <tr1/unordered_map> #include <tr1/unordered_set> #define TR1_NS std::tr1 #elif defined(_MSC_VER) #include <boost/unordered_map.hpp> #include <boost/unordered_set.hpp> #define TR1_NS boost #define isdigit iswdigit #define isspace iswspace #endif We've builded our server on x64 machine, but we created a x86 application. Why? Compiling on x64 increases the value of some C types (eg.: sizeof(int) return 4bit in x86 and 8bit on x64). Let's take for example this packet: typedef struct command_script_button { BYTE header; unsigned int idx; } TPacketCGScriptButton; The size of this packet will be 5 on x86 program, and 9 on a x64 program. If we use a x86 metin2 client, the server will except 9 bytes to be received however it will only receive 5 bytes, leaving the server listening for the 4 remaning bytes. The first, possible fix for x64, is building the metin2 client on x64 bit, loosing compatibily with old x86 PCs. The second, is to change all the packets on client/server to the same data (eg.: int becames int32 etc...), so the server builded in x64 will understand that the int packets are 4 byte and not 8; but, convering (on the rest of the server) a 8byte int into a 4byte int could lead up to loosing data. The wrong fix is to define int,long with int32 and long32 (for example). This won't fix nothing because it's like you're using a x86 program, so you could not use any x64 advantage. PS: Sorry for bad english, i hope it's now more clear for everyone
  8. Hi guys! Let me explain you. I've been dealing with this problem for months and have not found yet a glimpse of where this problem comes from, so thats why I'm asking you guys My intention is to run a 40k server from my laptop, which has freebsd installed on it. The main problem is that, when I run 34k or 40k server files on it I'm able to connect to the server but it freezes after a couple of seconds of play. I can enter the game, past the character select screen, but if I move ingame a few metres or hit a few dogs the connection just... dies. What confuses me is that if I use the same server configuration on 2089 files it works flawlessly Also, the same setup on VirtualBox with these 34k and 40k files work without further problems. That being said, it looks like it is something specific to those server files or a hardware issue. But from what I tested its more likely to be the former since, even while my laptop only has 1GB of RAM, I've been able to run these 40k files on VirtualBox with 256MB. Technical information: Laptop: Intel Atom, 2 cores @ 1.56GHz / 1GB DDR3 RAM / FreeBSD 10.3 with 18GB of free space and 2GB swap. Default gateway: Ipv4 address: External IP: 181.197.XXX.XX. No need to add BIND_IP on CONFIG files under 2089 files (and it just works), neither in 34k and 40k (and server runs) but the problem arises. I tried several times adding my Ipv4 address, but had no success. If I try to add my external IP I get the infamous "socket_tcp_bind: tcp_socket: Can't assign requested address". All ports have been properly forwarded via router configuration. I don't have to use PortMap so as to connect to the servers. DMZ available. Ask me anything and I will post the information you need in order to solve this issue. I would love to see this problem solved help guys!
  9. meneleos

    Core problem (optind)

    Hi. #0 0x2884161b in sbrk () from /usr/lib32/libc.so.7 #1 0x28c0021c in ?? () #2 0x289238b8 in malloc_message () from /usr/lib32/libc.so.7 #3 0x289238f0 in malloc_message () from /usr/lib32/libc.so.7 #4 0x08670e10 in optind@@FBSD_1.0 () #5 0x000000b8 in ?? () #6 0x2882a070 in syscall () from /usr/lib32/libc.so.7 #7 0x28c000c0 in ?? () #8 0x290d504c in ?? () #9 0x00000002 in ?? () #10 0x00000000 in ?? () Why does this happen ?
  10. FivePercent

    Libexec problem 64Bit

    Hello, so i've recently been having this problem:sh start.sh How many channels do you want to start? 1 Start DB-server... Start Auth-Server... Start Channel 1... ELF interpreter /libexec/ld-elf.so.d not found, error 8 Mysql_real_connect: Can't connect to local MySQL server throught socked '/tmp/mysql.sock' (2) failed, retrying in 5 seconds ELF interpreter /libexec/ld-elf.so.d not found, error 8 Start Channel 99... ELF interpreter /libexec/ld-elf.so.d not found, error 8 Mysql_real_connect: Can't connect to local MySQL server throught socked '/tmp/mysql.sock' (2) I've tried changing the ld-elf.so.d file with a different one, basically went all around the internet to figure out a solution. Using a FreeBSD 11.0, 64Bit, amd64. Thanks! Regards.
  11. Germais

    Installation Path

    I think this question is more related to FreeBSD but anyway, why do most people install the metin2 serverfiles in the path /usr/home? So I have already done this experience myself, I changed the path to /usr/metin2 and it worked just fine but I still wonder why do everyone or most people put the files at /usr/home? Sorry if this is a dumb question ;S
  12. Hello guys ! I am correctly trying to setup a server for me with a clean VM. I installed freebsd 10.3, mysql 5.6 and so on. I want to run a server purely for me no other people should be able to connect. I have set the network adapter in virtualbox to bridge mode. Now I have to setup the networking in configuraiton in freebsd the problem is, i dont know how. The interface has changed and now I dont know how to setup the networking in freebsd to allow the server to run for just me. This is how it looks when i go into network configuration: i.epvpimg.com//cPdCg.png I would appreciate it if someone could tell me where to put my ip adress and since i am doing it without hamachi with ot wihtout 100 at the end ? what to put in at the other options etc. If someone could help that would be really great, I am looking forward to any answers !
  13. sharqawy

    FreeBSD Problem

    I Have A Problem FreeBSD
  14. 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.
  15. kawaichan

    Socket_Tcp !

    Hello guys, By the way i'm new to this forum, and i have been searching for a solution to this problem... My goal is to create a Metin2 server using Hamachi and french Files 2014, and FreeBSD 9.2. Anyway i did all steps to launch the server normally, so after that i wanted to give the game to my friends so we can play together of course under Hamachi, so i asked and they told me to add some stuffs in config.cpp file and adding the Bind_IP: my public ip to all CONFIG files except db file. After doing this the server went OFF and it gave me some kind of error while launching, the screenshot explain all : http://prntscr.com/apq5rm Thank you guys, i hope you help me soon, i'm searching 3 days ago, in google and epvp...
  16. Hello today i want show you, how to install Gnome2 Desktop system on FreeBSD. This easy way to control your Metin2 server, you can develop your c++ apps, metin2 source with Gui Based Compiler, you can install apps, you can surf on internet, you can download torrent, you can control your web,mail servers etc.. I like it alot this system. You may also like. Gnome Installation Docs here, if you want Gnome2 you can look here : I prefer gnome cuz, Kde plasma use much ram (if you have effects).. Maybe you want connect to desktop, you cant with SSH How to connect Desktop on BSD Machine? pkg_add -r -v vnc or pkg_add -r -v tightvnc when installation done, go /root/.vnc/ and edit "xstartup" file then write this : #!/bin/sh xrdb $HOME/.Xresources xsetroot -solid grey xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & /usr/local/bin/gnome-session & #if you dont want start Gnome on VNC you can edit /usr/local/bin/gnome-session & to startkde or kde full path.. Now you can start vncserver! mehti@www:~ # vncserver -depth 24 -geometry 2560x1600 #2560x1600 is res of session all done, now you can connect to your server desktop! -------------------------------------------------------------------------------------------------------------------------------------------- #if you dont have vnc viewer you can download here : Installer for Windows (64-bit) (2,367,488 bytes) Installer for Windows (32-bit) (2,105,344 bytes) Download TightVNC Java Viewer (Version 2.7.2) TightVNC Java Viewer works on any system where Java is supported. It requires Java SE version 1.6 or later. TightVNC Java Viewer JAR in a ZIP archive (720,395 bytes) -- Screenshot
  17. Hello community, With the changes of the game, the items and mobs are now managed through a txt. And as there are problems in generating this txt and to manage the same, I decided I wanted to continue to manage the items and mobs by the database, since it is much easier to make changes and filter searches. Say this way will have 4 tables (item_proto, item_proto_WORK, mob_proto and mob_proto_WORK). The _WORK tables are where we do our updates, is basically just duplicate the original, the other 2 remaining are those that will be updated automatically by the game to read the txt generated by this converter. In my case, I have the file in the share / server conf folder (same folder as the item_proto.txt, item_names.txt, mob_proto.txt and mob_names.txt). Here is the conversion script (cproto.php): <?php /** * Item_proto and mob_proto converter * * */ // MySQL/DB Configuration $config["mysql_host"] = ""; $config["mysql_user"] = "root"; $config["mysql_pass"] = ""; $config["player_db"] = "player"; $config["item_proto_work"] = "item_proto_WORK"; // Tabela de trabalho $config["mob_proto_work"] = "mob_proto_WORK"; // Tabela de trabalho // Output Configuration $config["prefix_output"] = ""; // Este prefixo é para debug apenas. Exemplo: metin2_ => metin2_item_proto.txt $config["item_output"] = array("{$config["prefix_output"]}item_names.txt", "{$config["prefix_output"]}item_proto.txt", "{$config["prefix_output"]}item_proto_test.txt"); $config["mob_output"] = array("{$config["prefix_output"]}mob_names.txt", "{$config["prefix_output"]}mob_proto.txt", "{$config["prefix_output"]}mob_proto_test.txt"); class Proto{ private static $dbCon = false; public static $targets = ""; public static function start(){ if(self::getTargets()){ self::convertTargets(); } } private static function output($string, $color, $restoreColor = true, $breakline = true){ switch($color){ case "red": $initColor = "033[31m"; break; case "green": $initColor = "033[32m"; break; default: $initColor = "033[0m"; } $out = $initColor.$string; if($restoreColor){ $out .= "033[0m"; } if($breakline){ $out .= "n"; } echo $out; } private static function write($file, $lines){ $fo = fopen($file, "w"); fwrite($fo, $lines); fclose($fo); } private static function connect(){ global $config; if(!self::$dbCon){ $c = @mysql_connect($config["mysql_host"], $config["mysql_user"], $config["mysql_pass"]) or die(self::output("Erro #1: Ocorreu um erro ao ligar à base de dados.", "red")); if($c){ self::$dbCon = true; self::output("Ligação à base de dados com sucesso.", "green"); } } } private static function getTargets(){ global $config; if($_SERVER["argc"] > 1){ $tmp = array(); foreach($_SERVER["argv"] as $k => $v){ if($v == "all"){ $tmp[] = $v; break; } if($v == "item" || $v == "mob"){ $tmp[] = $v; } } if(in_array("all", $tmp)){ self::$targets = "all"; }elseif(in_array("item", $tmp) && in_array("mob", $tmp)){ self::$targets = "all"; }else{ if(in_array("item", $tmp)){ self::$targets = "item"; } if(in_array("mob", $tmp)){ self::$targets = "mob"; } } if(in_array("all", $tmp) || in_array("item", $tmp) || in_array("mob", $tmp)){ return true; }else{ self::output("Erro #3: Argumento inválido.", "red"); } }else{ self::output("Erro #2: Precisas de especificar pelo menos um argumento.", "red"); } self::output("Item/Mob proto Converter", "green"); self::output("", "green"); self::output("Utilização: sh cproto.sh [args...]", "green"); self::output("Argumentos possíveis:", "green"); self::output(" item Converte apenas o {$config["item_proto_work"]}", "green"); self::output(" mob Converte apenas o {$config["mob_proto_work"]}", "green"); self::output(" all Converte tanto o item_proto como o mob_proto", "green"); return false; } private static function convertNumToString($target, $value){ $item_type = array(0=>"ITEM_NONE", 1=>"ITEM_WEAPON", 2=>"ITEM_ARMOR", 3=>"ITEM_USE", 4=>"ITEM_AUTOUSE", 5=>"ITEM_MATERIAL", 6=>"ITEM_SPECIAL", 7=>"ITEM_TOOL", 8=>"ITEM_LOTTERY", 9=>"ITEM_ELK", 10=>"ITEM_METIN", 11=>"ITEM_CONTAINER", 12=>"ITEM_FISH", 13=>"ITEM_ROD", 14=>"ITEM_RESOURCE", 15=>"ITEM_CAMPFIRE", 16=>"ITEM_UNIQUE", 17=>"ITEM_SKILLBOOK", 18=>"ITEM_QUEST", 19=>"ITEM_POLYMORPH", 20=>"ITEM_TREASURE_BOX", 21=>"ITEM_TREASURE_KEY", 22=>"ITEM_SKILLFORGET", 23=>"ITEM_GIFTBOX", 24=>"ITEM_PICK", 25=>"ITEM_HAIR", 26=>"ITEM_TOTEM", 27=>"ITEM_BLEND", 28=>"ITEM_COSTUME"); $item_limit = array(0=>"LIMIT_NONE", 1=>"LEVEL", 2=>"STR", 3=>"DEX", 4=>"INT", 5=>"CON", 6=>"PC_BANG", 7=>"REAL_TIME", 8=>"REAL_TIME_FIRST_USE", 9=>"TIMER_BASED_ON_WEAR"); $item_apply = array(0=>"APPLY_NONE", 1=>"APPLY_MAX_HP", 2=>"APPLY_MAX_SP", 3=>"APPLY_CON", 4=>"APPLY_INT", 5=>"APPLY_STR", 6=>"APPLY_DEX", 7=>"APPLY_ATT_SPEED", 8=>"APPLY_MOV_SPEED", 9=>"APPLY_CAST_SPEED", 10=>"APPLY_HP_REGEN", 11=>"APPLY_SP_REGEN", 12=>"APPLY_POISON_PCT", 13=>"APPLY_STUN_PCT", 14=>"APPLY_SLOW_PCT", 15=>"APPLY_CRITICAL_PCT", 16=>"APPLY_PENETRATE_PCT", 17=>"APPLY_ATTBONUS_HUMAN", 18=>"APPLY_ATTBONUS_ANIMAL", 19=>"APPLY_ATTBONUS_ORC", 20=>"APPLY_ATTBONUS_MILGYO", 21=>"APPLY_ATTBONUS_UNDEAD", 22=>"APPLY_ATTBONUS_DEVIL", 23=>"APPLY_STEAL_HP", 24=>"APPLY_STEAL_SP", 25=>"APPLY_MANA_BURN_PCT", 26=>"APPLY_DAMAGE_SP_RECOVER", 27=>"APPLY_BLOCK", 28=>"APPLY_DODGE", 29=>"APPLY_RESIST_SWORD", 30=>"APPLY_RESIST_TWOHAND", 31=>"APPLY_RESIST_DAGGER", 32=>"APPLY_RESIST_BELL", 33=>"APPLY_RESIST_FAN", 34=>"APPLY_RESIST_BOW", 35=>"APPLY_RESIST_FIRE", 36=>"APPLY_RESIST_ELEC", 37=>"APPLY_RESIST_MAGIC", 38=>"APPLY_RESIST_WIND", 39=>"APPLY_REFLECT_MELEE", 40=>"APPLY_REFLECT_CURSE", 41=>"APPLY_POISON_REDUCE", 42=>"APPLY_KILL_SP_RECOVER", 43=>"APPLY_EXP_DOUBLE_BONUS", 44=>"APPLY_GOLD_DOUBLE_BONUS", 45=>"APPLY_ITEM_DROP_BONUS", 46=>"APPLY_POTION_BONUS", 47=>"APPLY_KILL_HP_RECOVER", 48=>"APPLY_IMMUNE_STUN", 49=>"APPLY_IMMUNE_SLOW", 50=>"APPLY_IMMUNE_FALL", 51=>"APPLY_SKILL", 52=>"APPLY_BOW_DISTANCE", 53=>"APPLY_ATT_GRADE_BONUS", 54=>"APPLY_DEF_GRADE_BONUS", 55=>"APPLY_MAGIC_ATT_GRADE", 56=>"APPLY_MAGIC_DEF_GRADE", 57=>"APPLY_CURSE_PCT", 58=>"APPLY_MAX_STAMINA", 59=>"APPLY_ATTBONUS_WARRIOR", 60=>"APPLY_ATTBONUS_ASSASSIN", 61=>"APPLY_ATTBONUS_SURA", 62=>"APPLY_ATTBONUS_SHAMAN", 63=>"APPLY_ATTBONUS_MONSTER", 64=>"APPLY_MALL_ATTBONUS", 65=>"APPLY_MALL_DEFBONUS", 66=>"APPLY_MALL_EXPBONUS", 67=>"APPLY_MALL_ITEMBONUS", 68=>"APPLY_MALL_GOLDBONUS", 69=>"APPLY_MAX_HP_PCT", 70=>"APPLY_MAX_SP_PCT", 71=>"APPLY_SKILL_DAMAGE_BONUS", 72=>"APPLY_NORMAL_HIT_DAMAGE_BONUS", 73=>"APPLY_SKILL_DEFEND_BONUS", 74=>"APPLY_NORMAL_HIT_DEFEND_BONUS", 75=>"APPLY_PC_BANG_EXP_BONUS", 76=>"APPLY_PC_BANG_DROP_BONUS", 77=>"APPLY_EXTRACT_HP_PCT", 78=>"APPLY_RESIST_WARRIOR", 79=>"APPLY_RESIST_ASSASSIN", 80=>"APPLY_RESIST_SURA", 81=>"APPLY_RESIST_SHAMAN", 82=>"APPLY_ENERGY", 83=>"APPLY_DEF_GRADE", 84=>"APPLY_COSTUME_ATTR_BONUS", 85=>"APPLY_MAGIC_ATTBONUS_PER", 86=>"APPLY_MELEE_MAGIC_ATTBONUS_PER"); $mob_rank = array(0=>"PAWN", 1=>"S_PAWN", 2=>"KNIGHT", 3=>"S_KNIGHT", 4=>"BOSS", 5=>"KING"); $mob_type = array(0=>"MONSTER", 1=>"NPC", 2=>"STONE", 3=>"WARP", 4=>"DOOR", 5=>"BUILDING", 7=>"POLYMORPH_PC", 8=>"HORSE", 9=>"GOTO"); $mob_battletype = array(0=>"MELEE", 1=>"RANGE", 2=>"MAGIC", 3=>"SPECIAL", 4=>"POWER", 5=>"TANKER"); switch($target){ case "item_type": $target = $item_type; break; case "item_limit": $target = $item_limit; break; case "item_apply": $target = $item_apply; break; case "mob_rank": $target = $mob_rank; break; case "mob_type": $target = $mob_type; break; case "mob_battletype": $target = $mob_battletype; break; default: $target = ""; } return $target[$value]; } private static function getItemSubtype($type, $subtype){ if($type == 1){ if($subtype == 0){ return ""WEAPON_SWORD""; } elseif($subtype == 1){ return ""WEAPON_DAGGER""; } elseif($subtype == 2){ return ""WEAPON_BOW""; } elseif($subtype == 3){ return ""WEAPON_TWO_HANDED""; } elseif($subtype == 4){ return ""WEAPON_BELL""; } elseif($subtype == 5){ return ""WEAPON_FAN""; } elseif($subtype == 6){ return ""WEAPON_ARROW""; } elseif($subtype == 7){ return ""WEAPON_MOUNT_SPEAR""; } elseif($subtype == 8){ return ""WEAPON_NUM_TYPES""; } }elseif($type == 2){ if($subtype == 0){ return ""ARMOR_BODY""; } elseif($subtype == 1){ return ""ARMOR_HEAD""; } elseif($subtype == 2){ return ""ARMOR_SHIELD""; } elseif($subtype == 3){ return ""ARMOR_WRIST""; } elseif($subtype == 4){ return ""ARMOR_FOOTS""; } elseif($subtype == 5){ return ""ARMOR_NECK""; } elseif($subtype == 6){ return ""ARMOR_EAR""; } elseif($subtype == 7){ return ""ARMOR_NUM_TYPES""; } }elseif($type == 3){ if($subtype == 0){ return ""USE_POTION""; } elseif($subtype == 1){ return ""USE_TALISMAN""; } elseif($subtype == 2){ return ""USE_TUNING""; } elseif($subtype == 3){ return ""USE_MOVE""; } elseif($subtype == 4){ return ""USE_TREASURE_BOX""; } elseif($subtype == 5){ return ""USE_MONEYBAG""; } elseif($subtype == 6){ return ""USE_BAIT""; } elseif($subtype == 7){ return ""USE_ABILITY_UP""; } elseif($subtype == 8){ return ""USE_AFFECT""; } elseif($subtype == 9){ return ""USE_CREATE_STONE""; } elseif($subtype == 10){ return ""USE_SPECIAL""; } elseif($subtype == 11){ return ""USE_POTION_NODELAY""; } elseif($subtype == 12){ return ""USE_CLEAR""; } elseif($subtype == 13){ return ""USE_INVISIBILITY""; } elseif($subtype == 14){ return ""USE_DETACHMENT""; } elseif($subtype == 15){ return ""USE_BUCKET""; } elseif($subtype == 17){ return ""USE_CLEAN_SOCKET""; } elseif($subtype == 18){ return ""USE_CHANGE_ATTRIBUTE""; } elseif($subtype == 19){ return ""USE_ADD_ATTRIBUTE""; } elseif($subtype == 20){ return ""USE_ADD_ACCESSORY_SOCKET""; } elseif($subtype == 21){ return ""USE_PUT_INTO_ACCESSORY_SOCKET""; } elseif($subtype == 22){ return ""USE_ADD_ATTRIBUTE2""; } elseif($subtype == 23){ return ""USE_RECIPE""; } elseif($subtype == 24){ return ""USE_CHANGE_ATTRIBUTE2""; } elseif($subtype == 25){ return ""USE_BIND""; } elseif($subtype == 26){ return ""USE_UNBIND""; } elseif($subtype == 29){ return ""AUTOUSE_BOMB""; } elseif($subtype == 30){ return ""AUTOUSE_GOLD""; } }elseif($type == 5){ if($subtype == 0){ return ""MATERIAL_LEATHER""; } elseif($subtype == 1){ return ""MATERIAL_BLOOD""; } elseif($subtype == 2){ return ""MATERIAL_ROOT""; } elseif($subtype == 3){ return ""MATERIAL_NEEDLE""; } elseif($subtype == 4){ return ""MATERIAL_JEWEL""; } }elseif($type == 6){ if($subtype == 0){ return ""SPECIAL_MAP""; } if($subtype == 1){ return ""SPECIAL_KEY""; } if($subtype == 2){ return ""SPECIAL_DOC""; } if($subtype == 3){ return ""SPECIAL_SPIRIT""; } if($subtype == 4){ return ""SPECIAL_MAP""; } }elseif($type == 7){ if($subtype == 0){ return ""TOOL_FISHING_ROD""; } }elseif($type == 8){ if($subtype == 0){ return ""LOTTERY_TICKET""; } elseif($subtype == 1){ return ""LOTTERY_INSTANT""; } }elseif($type == 10){ if($subtype == 0){ return ""METIN_NORMAL""; } elseif($subtype == 1){ return ""METIN_GOLD""; } }elseif($type == 12){ if($subtype == 0){ return ""FISH_ALIVE""; } elseif($subtype == 1){ return ""FISH_DEAD""; } }elseif($type == 14){ if($subtype == 0){ return ""RESOURCE_FISHBONE""; } elseif($subtype == 1){ return ""RESOURCE_WATERSTONEPIECE""; } elseif($subtype == 2){ return ""RESOURCE_WATERSTONE""; } elseif($subtype == 3){ return ""RESOURCE_BLOOD_PEARL""; } elseif($subtype == 4){ return ""RESOURCE_BLUE_PEARL""; } elseif($subtype == 5){ return ""RESOURCE_WHITE_PEARL""; } elseif($subtype == 6){ return ""RESOURCE_BUCKET""; } elseif($subtype == 7){ return ""RESOURCE_CRYSTAL""; } elseif($subtype == 8){ return ""RESOURCE_GEM""; } elseif($subtype == 9){ return ""RESOURCE_STONE""; } elseif($subtype == 10){ return ""RESOURCE_METIN""; } elseif($subtype == 11){ return ""RESOURCE_ORE""; } }elseif($type == 16){ if($subtype == 0){ return ""UNIQUE_NONE""; } elseif($subtype == 2){ return ""UNIQUE_SPECIAL_RIDE""; } elseif($subtype == 3){ return ""UNIQUE_3""; } elseif($subtype == 4){ return ""UNIQUE_4""; } elseif($subtype == 5){ return ""UNIQUE_5""; } elseif($subtype == 6){ return ""UNIQUE_6""; } elseif($subtype == 7){ return ""UNIQUE_7""; } elseif($subtype == 8){ return ""UNIQUE_8""; } elseif($subtype == 9){ return ""UNIQUE_9""; } elseif($subtype == 10){ return ""USE_SPECIAL""; } }elseif($type == 28){ if($subtype == 0){ return ""COSTUME_BODY""; } elseif($subtype == 1){ return ""COSTUME_HAIR""; } } return 0; } private static function getFlags($flag, $method){ $antiflags = array(0=>"NONE", 1=>"ANTI_FEMALE", 2=>"ANTI_MALE", 4=>"ANTI_MUSA", 8=>"ANTI_ASSASSIN", 16=>"ANTI_SURA", 32=>"ANTI_MUDANG", 64=>"ANTI_GET", 128=>"ANTI_DROP", 256=>"ANTI_SELL", 512=>"ANTI_EMPIRE_A", 1024=>"ANTI_EMPIRE_B", 2048=>"ANTI_EMPIRE_C", 4096=>"ANTI_SAVE", 8192=>"ANTI_GIVE", 16384=>"ANTI_PKDROP", 32768=>"ANTI_STACK", 65536=>"ANTI_MYSHOP", 131072=>"ANTI_SAFEBOX"); $flags = array(0=>"NONE", 1=>"ITEM_TUNABLE", 2=>"ITEM_SAVE", 4=>"ITEM_STACKABLE", 8=>"COUNT_PER_1GOLD", 16=>"ITEM_SLOW_QUERY", 32=>"ITEM_UNIQUE", 64=>"ITEM_MAKECOUNT", 128=>"ITEM_IRREMOVABLE", 256=>"CONFIRM_WHEN_USE", 512=>"QUEST_USE", 1024=>"QUEST_USE_MULTIPLE", 2048=>"QUEST_GIVE", 4096=>"ITEM_QUEST", 8192=>"LOG", 16384=>"STACKABLE", 32768=>"32768", 65536=>"REFINEABLE", 131072=>"131072", 262144=>"ITEM_APPLICABLE"); $wearflags = array(0=>"NONE", 1=>"WEAR_BODY", 2=>"WEAR_HEAD", 4=>"WEAR_FOOTS", 8=>"WEAR_WRIST", 16=>"WEAR_WEAPON", 32=>"WEAR_NECK", 64=>"WEAR_EAR", 128=>"WEAR_SHIELD", 256=>"WEAR_UNIQUE", 512=>"WEAR_ARROW", 1024=>"WEAR_HAIR", 2048=>"WEAR_ABILITY"); switch($method){ case "af": $target = $antiflags; break; case "f": $target = $flags; break; case "wf": $target = $wearflags; break; default: $target = ""; } $str = """; for($i=17;$i>=0;$i--){ $pow = pow(2, $i); if($pow < $flag){ $str = " | ".$target[$pow].$str; $flag = $flag-$pow; }elseif($pow == $flag){ return """.$target[$pow].$str; } } return ""NONE""; } private static function convertTargets(){ global $config; self::connect(); self::output("Item/Mob proto Converter", "green"); self::output("", "green"); if(self::$targets == "all" || self::$targets == "item"){ self::output("A converter {$config["item_proto_work"]}...", "green"); $write = array("", "", ""); $write[0] .= "VNUM LOCALE_NAMEn"; $write[1] .= ""Vnum" "Name" "Type" "SubType" "Size" "AntiFlags" "Flags" "WearFlags" "ImmuneFlags" "Gold" "ShopBuyPrice" "RefinedVnum" "RefineSet" "AlterToMagicItemPercent" "LimitType0" "LimitValue0" "LimitType1" "LimitValue1" "ApplyType0" "ApplyValue0" "ApplyType1" "ApplyValue1" "ApplyType2" "ApplyValue2" "Value0" "Value1" "Value2" "Value3" "Value4" "Value5" "Specular" "GainSocketPercent" "AddonType"n"; $write[2] .= ""Vnum" "Name" "Type" "SubType" "Size" "AntiFlags" "Flags" "WearFlags" "ImmuneFlags" "Gold" "ShopBuyPrice" "RefinedVnum" "RefineSet" "AlterToMagicItemPercent" "LimitType0" "LimitValue0" "LimitType1" "LimitValue1" "ApplyType0" "ApplyValue0" "ApplyType1" "ApplyValue1" "ApplyType2" "ApplyValue2" "Value0" "Value1" "Value2" "Value3" "Value4" "Value5" "Specular" "GainSocketPercent" "AddonType"n"; $query = mysql_query("SELECT * FROM {$config["player_db"]}.{$config["item_proto_work"]} ORDER BY vnum ASC"); while($fetch = mysql_fetch_assoc($query)){ $type = self::convertNumToString("item_type", $fetch["type"]); $subtype = self::getItemSubtype($fetch["type"], $fetch["subtype"]); $antiflag = self::getFlags($fetch["antiflag"], "af"); $flag = self::getFlags($fetch["flag"], "f"); $wearflag = self::getFlags($fetch["wearflag"], "wf"); $immuneflag = (empty($fetch["immuneflag"])) ? ""NONE"" : ""{$fetch["immuneflag"]}""; $limittype0 = self::convertNumToString("item_limit", $fetch["limittype0"]); $limittype1 = self::convertNumToString("item_limit", $fetch["limittype1"]); $applytype0 = self::convertNumToString("item_apply", $fetch["applytype0"]); $applytype1 = self::convertNumToString("item_apply", $fetch["applytype1"]); $applytype2 = self::convertNumToString("item_apply", $fetch["applytype2"]); $write[0] .= "{$fetch["vnum"]} {$fetch["locale_name"]}n"; $write[1] .= "{$fetch["vnum"]} "{$fetch["name"]}" "{$type}" {$subtype} {$fetch["size"]} {$antiflag} {$flag} {$wearflag} {$immuneflag} {$fetch["gold"]} {$fetch["shop_buy_price"]} {$fetch["refined_vnum"]} {$fetch["refine_set"]} {$fetch["magic_pct"]} "{$limittype0}" {$fetch["limitvalue0"]} "{$limittype1}" {$fetch["limitvalue1"]} "{$applytype0}" {$fetch["applyvalue0"]} "{$applytype1}" {$fetch["applyvalue1"]} "{$applytype2}" {$fetch["applyvalue2"]} {$fetch["value0"]} {$fetch["value1"]} {$fetch["value2"]} {$fetch["value3"]} {$fetch["value4"]} {$fetch["value5"]} {$fetch["specular"]} {$fetch["socket_pct"]} {$fetch["addon_type"]}n"; $write[2] .= "{$fetch["vnum"]} "{$fetch["name"]}" "{$type}" {$subtype} {$fetch["size"]} {$antiflag} {$flag} {$wearflag} {$immuneflag} {$fetch["gold"]} {$fetch["shop_buy_price"]} {$fetch["refined_vnum"]} {$fetch["refine_set"]} {$fetch["magic_pct"]} "{$limittype0}" {$fetch["limitvalue0"]} "{$limittype1}" {$fetch["limitvalue1"]} "{$applytype0}" {$fetch["applyvalue0"]} "{$applytype1}" {$fetch["applyvalue1"]} "{$applytype2}" {$fetch["applyvalue2"]} {$fetch["value0"]} {$fetch["value1"]} {$fetch["value2"]} {$fetch["value3"]} {$fetch["value4"]} {$fetch["value5"]} {$fetch["specular"]} {$fetch["socket_pct"]} {$fetch["addon_type"]}n"; } for($i=0;$i<2;$i++){ self::output(" -> A escrever {$config["item_output"][$i]}...", "green"); self::write($config["item_output"][$i], $write[$i]); } self::output("{$config["item_proto_work"]} convertido com sucesso!", "green"); } if(self::$targets == "all" || self::$targets == "mob"){ self::output("A converter {$config["mob_proto_work"]}...", "green"); $write = array("", "", ""); $write[0] .= "VNUM LOCALE_NAMEn"; $write[1] .= ""Vnum" "Name" "Rank" "Type" "BattleType" "Level" "Size" "AiFlags" "MountCapacity" "RaceFlags" "ImmuneFlags" "Empire" "Folder" "OnClick" "St" "Dx" "Ht" "Iq" "MinDamage" "MaxDamage" "MaxHp" "RegenCycle" "RegenPercent" "MinGold" "MaxGold" "Exp" "Def" "AttackSpeed" "MoveSpeed" "AggressiveHpPct" "AggressiveSight" "AttackRange" "DropItemGroup" "ResurrectionVnum" "EnchantCurse" "EnchantSlow" "EnchantPoison" "EnchantStun" "EnchantCritical" "EnchantPenetrate" "ResistSword" "ResistTwoHanded" "ResistDagger" "ResistBell" "ResistFan" "ResistBow" "ResistFire" "ResistElect" "ResistMagic" "ResistWind" "ResistPoison" "DamMultiply" "SummonVnum" "DrainSp" "MobColor" "PolymorphItem" "SkillLevel0" "SkillVnum0" "SkillLevel1" "SkillVnum1" "SkillLevel2" "SkillVnum2" "SkillLevel3" "SkillVnum3" "SkillLevel4" "SkillVnum4" "SpBerserk" "SpStoneskin" "SpGodspeed" "SpDeathblow" "SpRevive"n"; $write[2] .= ""Vnum" "Name" "Rank" "Type" "BattleType" "Level" "Size" "AiFlags" "MountCapacity" "RaceFlags" "ImmuneFlags" "Empire" "Folder" "OnClick" "St" "Dx" "Ht" "Iq" "MinDamage" "MaxDamage" "MaxHp" "RegenCycle" "RegenPercent" "MinGold" "MaxGold" "Exp" "Def" "AttackSpeed" "MoveSpeed" "AggressiveHpPct" "AggressiveSight" "AttackRange" "DropItemGroup" "ResurrectionVnum" "EnchantCurse" "EnchantSlow" "EnchantPoison" "EnchantStun" "EnchantCritical" "EnchantPenetrate" "ResistSword" "ResistTwoHanded" "ResistDagger" "ResistBell" "ResistFan" "ResistBow" "ResistFire" "ResistElect" "ResistMagic" "ResistWind" "ResistPoison" "DamMultiply" "SummonVnum" "DrainSp" "MobColor" "PolymorphItem" "SkillLevel0" "SkillVnum0" "SkillLevel1" "SkillVnum1" "SkillLevel2" "SkillVnum2" "SkillLevel3" "SkillVnum3" "SkillLevel4" "SkillVnum4" "SpBerserk" "SpStoneskin" "SpGodspeed" "SpDeathblow" "SpRevive"n"; $query = mysql_query("SELECT * FROM {$config["player_db"]}.{$config["mob_proto_work"]} ORDER BY vnum ASC"); while($fetch = mysql_fetch_assoc($query)){ $rank = self::convertNumToString("mob_rank", $fetch["rank"]); $type = self::convertNumToString("mob_type", $fetch["type"]); $battletype = self::convertNumToString("mob_battletype", $fetch["battle_type"]); $ai_flag = (empty($fetch["ai_flag"])) ? "" : ""{$fetch["ai_flag"]}""; $setRaceFlag = (empty($fetch["setRaceFlag"])) ? "" : ""{$fetch["setRaceFlag"]}""; $setImmuneFlag = (empty($fetch["setImmuneFlag"])) ? "" : ""{$fetch["setImmuneFlag"]}""; $mob_color = (empty($fetch["mob_color"])) ? "0" : "{$fetch["mob_color"]}"; $write[0] .= "{$fetch["vnum"]} {$fetch["locale_name"]}n"; $write[1] .= "{$fetch["vnum"]} "{$fetch["name"]}" "{$rank}" "{$type}" "{$battletype}" {$fetch["level"]} {$fetch["size"]} {$ai_flag} {$fetch["mount_capacity"]} {$setRaceFlag} {$setImmuneFlag} {$fetch["empire"]} "{$fetch["folder"]}" {$fetch["on_click"]} {$fetch["st"]} {$fetch["dx"]} {$fetch["ht"]} {$fetch["iq"]} {$fetch["damage_min"]} {$fetch["damage_max"]} {$fetch["max_hp"]} {$fetch["regen_cycle"]} {$fetch["regen_percent"]} {$fetch["gold_min"]} {$fetch["gold_max"]} {$fetch["exp"]} {$fetch["def"]} {$fetch["attack_speed"]} {$fetch["move_speed"]} {$fetch["aggressive_hp_pct"]} {$fetch["aggressive_sight"]} {$fetch["attack_range"]} {$fetch["drop_item"]} {$fetch["resurrection_vnum"]} {$fetch["enchant_curse"]} {$fetch["enchant_slow"]} {$fetch["enchant_poison"]} {$fetch["enchant_stun"]} {$fetch["enchant_critical"]} {$fetch["enchant_penetrate"]} {$fetch["resist_sword"]} {$fetch["resist_twohand"]} {$fetch["resist_dagger"]} {$fetch["resist_bell"]} {$fetch["resist_fan"]} {$fetch["resist_bow"]} {$fetch["resist_fire"]} {$fetch["resist_elect"]} {$fetch["resist_magic"]} {$fetch["resist_wind"]} {$fetch["resist_poison"]} {$fetch["dam_multiply"]} {$fetch["summon"]} {$fetch["drain_sp"]} {$mob_color} {$fetch["polymorph_item"]} {$fetch["skill_level0"]} {$fetch["skill_vnum0"]} {$fetch["skill_level1"]} {$fetch["skill_vnum1"]} {$fetch["skill_level2"]} {$fetch["skill_vnum2"]} {$fetch["skill_level3"]} {$fetch["skill_vnum3"]} {$fetch["skill_level4"]} {$fetch["skill_vnum4"]} {$fetch["sp_berserk"]} {$fetch["sp_stoneskin"]} {$fetch["sp_godspeed"]} {$fetch["sp_deathblow"]} {$fetch["sp_revive"]}n"; $write[2] .= "{$fetch["vnum"]} "{$fetch["name"]}" "{$rank}" "{$type}" "{$battletype}" {$fetch["level"]} {$fetch["size"]} {$ai_flag} {$fetch["mount_capacity"]} {$setRaceFlag} {$setImmuneFlag} {$fetch["empire"]} "{$fetch["folder"]}" {$fetch["on_click"]} {$fetch["st"]} {$fetch["dx"]} {$fetch["ht"]} {$fetch["iq"]} {$fetch["damage_min"]} {$fetch["damage_max"]} {$fetch["max_hp"]} {$fetch["regen_cycle"]} {$fetch["regen_percent"]} {$fetch["gold_min"]} {$fetch["gold_max"]} {$fetch["exp"]} {$fetch["def"]} {$fetch["attack_speed"]} {$fetch["move_speed"]} {$fetch["aggressive_hp_pct"]} {$fetch["aggressive_sight"]} {$fetch["attack_range"]} {$fetch["drop_item"]} {$fetch["resurrection_vnum"]} {$fetch["enchant_curse"]} {$fetch["enchant_slow"]} {$fetch["enchant_poison"]} {$fetch["enchant_stun"]} {$fetch["enchant_critical"]} {$fetch["enchant_penetrate"]} {$fetch["resist_sword"]} {$fetch["resist_twohand"]} {$fetch["resist_dagger"]} {$fetch["resist_bell"]} {$fetch["resist_fan"]} {$fetch["resist_bow"]} {$fetch["resist_fire"]} {$fetch["resist_elect"]} {$fetch["resist_magic"]} {$fetch["resist_wind"]} {$fetch["resist_poison"]} {$fetch["dam_multiply"]} {$fetch["summon"]} {$fetch["drain_sp"]} {$mob_color} {$fetch["polymorph_item"]} {$fetch["skill_level0"]} {$fetch["skill_vnum0"]} {$fetch["skill_level1"]} {$fetch["skill_vnum1"]} {$fetch["skill_level2"]} {$fetch["skill_vnum2"]} {$fetch["skill_level3"]} {$fetch["skill_vnum3"]} {$fetch["skill_level4"]} {$fetch["skill_vnum4"]} {$fetch["sp_berserk"]} {$fetch["sp_stoneskin"]} {$fetch["sp_godspeed"]} {$fetch["sp_deathblow"]} {$fetch["sp_revive"]}n"; } for($i=0;$i<2;$i++){ self::output(" -> A escrever {$config["mob_output"][$i]}...", "green"); self::write($config["mob_output"][$i], $write[$i]); } self::output("{$config["mob_proto_work"]} convertido com sucesso!", "green"); } } } Proto::start(); ?> cproto.sh ROOT=$PWD cd $ROOT/share/conf && php -a cproto.php $1 $2 Commands: sh cproto.sh mob sh cproto.sh item sh cproto.sh all If you have any item / wrong mob, might give you problems when you start the game, however it is a good way to know they have something wrong in your item / mob proto and correct. The most common errors are the sets of types / subtypes and limits of items.
  18. Hi guys, I'm having a bit of a trouble in freebsd running php files. heres the view of a php file from the browser: Heres my httpd.conf: <IfModule dir_module> <IfModule php5_module> DirectoryIndex index.php index.html </IfModule> <IfModule !php5_module> <IfModule php4_module> DirectoryIndex index.php index.html </IfModule> <IfModule !php4_module> DirectoryIndex index.php index.html </IfModule> </IfModule> </IfModule> php.conf: <IfModule mime_module> <IfModule php4_module> AddType application/x-httpd-php .php </IfModule> <IfModule php5_module> AddType application/x-httpd-php .php </IfModule> </IfModule> apache is already running... How can I fix this? Thx in advance.
  19. mindfreak99

    FreeBSD 9.3 Mysql Error

    Good day , I have a little problem with my FreeBSD 9.3 Root ServerThe server is hosted by Kimsufi . After installing MySQL 5.5 mysql does not start , I get this error code : Starting MySQL . su : unknown login: mysql /usr/local/etc/rc.d/mysql-server : WARNING : failed to start mysql Does anyone have a solution for my problem ? Best Regards Prof.MindFreak
  20. 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 http://your_server_IP_address/index.php 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 = “”; # .port = “8080”; # } It means the content need to run on port 8080. Remove all # mark to be like this : backend default { .host = “”; .port = “8080”; } =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 http://ha.ckers.org/slowloris/ 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 https://github.com/SpiderLabs/owasp-modsecurity-crs 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 https://raw.github.com/SpiderLabs/ModSecurity/master/unicode.mapping 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 (http://www.modsecurity.org/) 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 http://www.example.com/?foo=/etc/passwd. 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 Here is a .VDI for test (webpages, forums ) etc https://mega.co.nz/#!0sdykLpa!2MlUz9pLwdwKQYe4cJLjtGmu5cT2WPdi8caM29A2o0o
  21. Dear Community, In this tutorial I will show you how you to set up ssh key instead of password-based authentication for your server. With ssh key you can easily connect to your server on the ssh port without password, and it provides much stronger protection than the simple password-based authentication. First of all, you have to generate your own unique key via Puttygen by moving your mouse cursor over the blank area: Then you will get something like this: The random code that I highlighted will be needed, so do not close your generator! You can add here password protection for your key if you like, and when you are finished, save it as a private key. After that, you have to create a new user for your system without using password. My example is 'sshkeytest' After that, type the following commands: su sshkeytest cd /home/sshkeytest mkdir .ssh chmod 700 .ssh cd .ssh In this directory you have to create a file called authorized_keys2. You can do it via sftp, or by using the following command: ee authorized_keys2Now insert the code that is shown in the Puttygen, but only to the last == characters (which I highlighted before), it must not include the rsa-key-20... characters. It is important that you have to past it in only one line. If you are ready, type the following: chmod 600 authorized_keys2After that you have to allow your new user's login by editing the sshd_config file: ee /etc/ssh/sshd_configSearch for something like this: And rewrite it to this: With this option you allowed the ssh login of the 'sshkeytest' user (and only for this user!), and disabled the root login. If you do not find these lines, you can just simple type into the end of the file. !! WARNING !! If you can connect to your server only via ssh protocoll, do not disable root login at first, because if you did something wrong, you will not be able to connect after this step. If you are ready, you have to restart the sshd: /etc/rc.d/sshd restartNow open your PageAnt, and browse your .ppk file. While PageAnt is running with your key, you can log in via Putty or FileZilla (or any other client which supports ssh key authentication) without password. If your server still asks for password, you did something wrong. Try again. With the new user you do not have full rights, but you will need root rights for many operations. You can easily switch to root by using the su command: su rootAfter you gave the right password, you are logged in with the root user with full rights. Download the mentioned programs here. Sorry if this tutorial already exists in this board, but I could not find it anywhere. I hope that it was useful and I could help some of you with that. Good luck! Kind regards, RoxaLyssa
  22. LiiKeFam3


    Shared object "libm.so.6" not found, required by "libpng.so.3" How can i fix it?
  23. F'Corono'

    How to install SSHGuard in FreeBSD

    Hello, in order to protect our machine against Brute Force attacks, we will use the sshguard. I will be quick: cd /usr/ports /security/sshguard -pf make install clean ; rehash The sshguard works by reading the log files.Will also protect our server form: sendmail, exim, dovecot, cucipop, UWimap bruteforce attacks proftpd, vsftpd, pure-ftpd, FreeBSD ftpd bruteforce attacks To configure sshguard, edit the file in "/etc/pf.conf" and add the following lines: table <sshguard> persist block in quick on $ext_if proto tcp from <sshguard> to any port 22 label "SSH bruteforce atempt" After, edit the file "/etc/syslog.conf" and add the following line: auth.info;authpriv.info |exec /usr/local/sbin/sshguard Now restart the syslog service: /etc/rc.d/syslogd restart To check if the IP of the attacker is added to the table sshguard viewing PF Firewall: pfctl -Tshow -tsshguard SSHGuard project: http://www.sshguard.net/