Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/28/16 in all areas

  1. M2 Download Center Download Here ( Internal )
    2 points
  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.
    1 point
  3. M2 Download Center Download Here ( Internal ) hallo all i want public my auto even quest , it's very simple to understand i made it from some long time quest auto_events begin state start begin when 20086.chat."auto event" with pc.is_gm() begin say_title(" Hallo "..pc.get_name()) say(" state now "..game.get_event_flag("autoevent").." ") say(" ") local s = select(" active "," disable "," close ") if s == 1 then setskin(NOWINDOW) server_loop_timer("auto_event_timer", 1) game.set_event_flag("autoevent", 1) elseif s == 2 then setskin(NOWINDOW) clear_server_timer("auto_event_timer") game.set_event_flag("autoevent", 0) end end when auto_event_timer.server_timer begin local events_info = { {"Sat 14:00", "hair", "event", "hairup", 1, " 4 hours ", "Sat 18:00", 0}, {"Sun 14:00", "6 Shabe Box", "event", "2006_drop", 1, " 4 hours ", "Sun 18:00", 0}, {"Mon 13:00", "Gold ball", "event", "gold_bool", 1, " 4 hours ", "Mon 18:00", 0}, {"Tue 14:00", "dressup box", "event", "dressup", 1, " 4 hours ", "Tue 18:00", 0}, {"Wed 14:00", "fotball box", "event", "football_drop", 1, " 4 hours ", "Wed 18:00", 0}, {"Thu 14:00", "moon box", "event", "drop_moon", 1, " 4 hours ", "Thu 18:00", 0}, {"Fri 14:00", "mount", "event", "Mount_Ring_Event", 1, " 4 hours ", "Fri 18:00", 0}, } local day_time = os.date("%a %H:%M") for i,v in ipairs(events_info) do if v[1] == day_time then if game.get_event_flag(v[4]) != v[5] then notice_all("notice: event "..v[2].." actived for "..v[6].." started from now! ") game.set_event_flag(v[4], v[5]) end elseif v[7] == day_time then if game.get_event_flag(v[4]) != v[8] then notice_all(" notice: event "..v[2].." finish, see u with other events !! ") game.set_event_flag(v[4], v[8]) end end end end end end
    1 point
  4. We accomplished this by adding a pet equipment slot. If you want to do it without source modification (quest only) you could save the item id in a questflag when summoning the pet in the first place -> item.get_id() When you'll relog or teleport the questflag will still hold the unique item_id which you can use to set your current used quest item -> item.select(pc.getqf('pet_item_id')) After that you can just use pet.summon() because CQuestManager::instance().GetCurrentItem() is now returning a valid LPITEM instance (by our previously defined item.select(pc.getqf('pet_item_id')) )
    1 point
  5. change name?XDDD #topic try this long CItem::GetPetVnum() { char szQuery[1024]; snprintf(szQuery, sizeof(szQuery), "SELECT Petvnum FROM pet_summon WHERE PetSummonItemVnum = %u LIMIT 1", GetVnum()); std::auto_ptr<SQLMsg> msg(DBManager::instance().DirectQuery(szQuery)); if (msg->Get()->uiNumRows > 0) { MYSQL_ROW row = mysql_fetch_row(msg->Get()->pSQLResult); long alrow = atoi(row[0]); sys_log(0, "TEST_VNUM : %l\n", alrow); return alrow; } else return -1; }
    1 point
  6. long CItem::GetPetVnum() { char szQuery[1024]; snprintf(szQuery, sizeof(szQuery), "SELECT Petvnum FROM pet_summon WHERE PetSummonItemVnum='%d'", GetVnum()); std::auto_ptr<SQLMsg> msg(CDBManager::instance().DirectQuery(szQuery)); MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult); long alrow = atoi(row[0]); sys_log(0, "TEST_VNUM : %d\n", alrow); return alrow; } try this
    1 point
  7. can give me serverside but in sql?
    1 point
×
×
  • 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.