diff --git a/L2J_DataPack_BETA/dist/tools/database_installer.bat b/L2J_DataPack_BETA/dist/tools/database_installer.bat index 386b792f7495e10582548d56908e03e5fb3f5b48..abfc33a3f962caa212af709087d469aced94727e 100644 --- a/L2J_DataPack_BETA/dist/tools/database_installer.bat +++ b/L2J_DataPack_BETA/dist/tools/database_installer.bat @@ -5,18 +5,18 @@ REM ############################################## REM ## Interactive script setup - (by TanelTM) ## REM ############################################## REM Copyright (C) 2012 L2J DataPack -REM This program is free software; you can redistribute it and/or modify -REM it under the terms of the GNU General Public License as published by +REM This program is free software; you can redistribute it and/or modify +REM it under the terms of the GNU General Public License as published by REM the Free Software Foundation; either version 3 of the License, or (at REM your option) any later version. REM -REM This program is distributed in the hope that it will be useful, but +REM This program is distributed in the hope that it will be useful, but REM WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -REM or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +REM or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License REM for more details. REM -REM You should have received a copy of the GNU General Public License along -REM with this program; if not, write to the Free Software Foundation, Inc., +REM You should have received a copy of the GNU General Public License along +REM with this program; if not, write to the Free Software Foundation, Inc., REM 675 Mass Ave, Cambridge, MA 02139, USA. Or contact the Official L2J REM DataPack Project at http://www.l2jdp.com, http://www.l2jdp.com/forum or REM #l2j @ irc://irc.freenode.net @@ -60,10 +60,10 @@ echo (2) Import and configure: This tool has some new available echo options, you choose the values that fit your needs echo using former settings as a base. echo. -echo (3) Ignose stored settings: I'll let you configure me +echo (3) Ignose stored settings: I'll let you configure me echo with a fresh set of default values as a base. echo. -echo (4) View saved settings: See the contents of the config +echo (4) View saved settings: See the contents of the config echo file. echo. echo (5) Quit: Did you came here by mistake? @@ -130,12 +130,12 @@ echo. path|find "MySQL">NUL if %errorlevel% == 0 ( echo I found MySQL is in your PATH, this will be used by default. -echo If you want to use something different, change 'use path' for +echo If you want to use something different, change 'use path' for echo something else. set mysqlBinPath=use path ) else ( echo Look, I can't find "MYSQL" in your PATH environment variable. -echo It would be good if you go and find out where "mysql.exe" and +echo It would be good if you go and find out where "mysql.exe" and echo "mysqldump.exe" are. echo. echo If you have no idea about the meaning of words such as MYSQL @@ -255,8 +255,8 @@ set lsdbprompt=y call :colors 47 title L2JDP Installer - Login Server DataBase Backup ERROR! echo. -echo Backup attempt failed! A possible reason for this to -echo happen, is that your DB doesn't exist yet. I could +echo Backup attempt failed! A possible reason for this to +echo happen, is that your DB doesn't exist yet. I could echo try to create %lsdb% for you, or maybe you prefer to echo contunue with the Community Server part of this tool. echo. @@ -284,7 +284,7 @@ set cmdline= set stage=2 title L2JDP Installer - Login Server DataBase Creation echo. -echo Trying to create a Login Server DataBase... +echo Trying to create a Login Server DataBase. set cmdline="%mysqlPath%" -h %lshost% -u %lsuser% --password=%lspass% -e "CREATE DATABASE %lsdb%" 2^> NUL %cmdline% if %ERRORLEVEL% == 0 goto ls_install @@ -296,16 +296,16 @@ set omfgprompt=q call :colors 47 title L2JDP Installer - Login Server DataBase Creation ERROR! echo. -echo An error occured while trying to create a database for +echo An error occured while trying to create a database for echo your login server. echo. echo Possible reasons: echo 1-You provided innacurate info , check user, password, etc. -echo 2-User %lsuser% don't have enough privileges for +echo 2-User %lsuser% don't have enough privileges for echo database creation. Check your MySQL privileges. echo 3-Database exists already...? echo. -echo Unless you're sure that the pending actions of this tool +echo Unless you're sure that the pending actions of this tool echo could work, i'd suggest you to look for correct values echo and try this script again later. echo. @@ -329,7 +329,8 @@ title L2JDP Installer - Login Server DataBase WARNING! echo. echo LOGINSERVER DATABASE install type: echo. -echo (f) Full: I will destroy data in your `accounts` tables. +echo (f) Full: WARNING! I'll destroy ALL of your existing login +echo data. echo. echo (u) Upgrade: I'll do my best to preserve all login data. echo. @@ -369,11 +370,11 @@ echo. echo Upgrading structure of Login Server tables. echo. echo @echo off> temp.bat -if exist ls_errors.txt del ls_errors.txt -for %%i in (..\sql\login\updates\*.sql) do echo "%mysqlPath%" -h %lshost% -u %lsuser% --password=%lspass% -D %lsdb% --force ^< %%i 2^>^> ls_errors.txt >> temp.bat +if exist ls_errors.log del ls_errors.log +for %%i in (..\sql\login\updates\*.sql) do echo "%mysqlPath%" -h %lshost% -u %lsuser% --password=%lspass% -D %lsdb% --force ^< %%i 2^>^> ls_errors.log >> temp.bat call temp.bat> nul del temp.bat -move ls_errors.txt %workdir% +move ls_errors.log %workdir% goto ls_install :ls_install @@ -415,8 +416,8 @@ set cbdbprompt=y call :colors 47 title L2JDP Installer - Community Server DataBase Backup ERROR! echo. -echo Backup attempt failed! A possible reason for this to -echo happen, is that your DB doesn't exist yet. I could +echo Backup attempt failed! A possible reason for this to +echo happen, is that your DB doesn't exist yet. I could echo try to create %cbdb% for you, or maybe you prefer to echo continue with the GameServer part of this tool. echo. @@ -456,16 +457,16 @@ set omfgprompt=q call :colors 47 title L2JDP Installer - Community Server DataBase Creation ERROR! echo. -echo An error occured while trying to create a database for +echo An error occured while trying to create a database for echo your Community Server. echo. echo Possible reasons: echo 1-You provided innacurate info , check user, password, etc. -echo 2-User %cbuser% don't have enough privileges for +echo 2-User %cbuser% don't have enough privileges for echo database creation. Check your MySQL privileges. echo 3-Database exists already...? echo. -echo Unless you're sure that the pending actions of this tool +echo Unless you're sure that the pending actions of this tool echo could work, i'd suggest you to look for correct values echo and try this script again later. echo. @@ -531,11 +532,11 @@ echo. echo Upgrading structure of Community Server tables. echo. echo @echo off> temp.bat -if exist cs_errors.txt del cs_errors.txt -for %%i in (..\sql\community\updates\*.sql) do echo "%mysqlPath%" -h %cbhost% -u %cbuser% --password=%cbpass% -D %cbdb% --force ^< %%i 2^>^> cs_errors.txt >> temp.bat +if exist cs_errors.log del cs_errors.log +for %%i in (..\sql\community\updates\*.sql) do echo "%mysqlPath%" -h %cbhost% -u %cbuser% --password=%cbpass% -D %cbdb% --force ^< %%i 2^>^> cs_errors.log >> temp.bat call temp.bat> nul del temp.bat -move cs_errors.txt %workdir% +move cs_errors.log %workdir% goto cs_install :cs_install @@ -618,12 +619,12 @@ set omfgprompt=q call :colors 47 title L2JDP Installer - Game Server DataBase Creation ERROR! echo. -echo An error occured while trying to create a database for +echo An error occured while trying to create a database for echo your Game Server. echo. echo Possible reasons: echo 1-You provided innacurate info, check username, pass, etc. -echo 2-User %gsuser% don't have enough privileges for +echo 2-User %gsuser% don't have enough privileges for echo database creation. echo 3-Database exists already...? echo. @@ -670,7 +671,7 @@ call :colors 17 set cmdline= title L2JDP Installer - Game Server DataBase Full Install echo. -echo Deleting all Game Server tables for new content... +echo Deleting all Game Server tables for new content. set cmdline="%mysqlPath%" -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% ^< gs_cleanup.sql 2^> NUL %cmdline% if not %ERRORLEVEL% == 0 goto omfg @@ -681,14 +682,14 @@ goto gs_install :gs_upgrade echo. -echo Upgrading structure of Game Server tables. +echo Upgrading structure of Game Server tables (this could take awhile, be patient). echo. echo @echo off> temp.bat -if exist gs_errors.txt del gs_errors.txt -for %%i in (..\sql\game\updates\*.sql) do echo "%mysqlPath%" -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% --force ^< %%i 2^>^> gs_errors.txt >> temp.bat +if exist gs_errors.log del gs_errors.log +for %%i in (..\sql\game\updates\*.sql) do echo "%mysqlPath%" -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% --force ^< %%i 2^>^> gs_errors.log >> temp.bat call temp.bat> nul del temp.bat -move gs_errors.txt %workdir% +move gs_errors.log %workdir% goto gs_install :gs_install @@ -794,6 +795,9 @@ echo. echo L2J provides some "Custom Server Tables" for non-retail modifications echo in order to avoid override the original Server Tables. echo. +echo Remember that in order to get these additions actually working +echo you need to edit your configuration files. +echo. set /p cstprompt=Install Custom Server Tables: (y) yes or (n) no (default no): if /i %cstprompt%==y goto custom_install if /i %cstprompt%==n goto mod_ask @@ -803,19 +807,11 @@ cls echo. echo Installing Custom content. echo @echo off> temp.bat -if exist custom_errors.txt del custom_errors.txt -for %%i in (..\sql\game\custom\*.sql) do echo "%mysqlPath%" -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% ^< %%i 2^>^> custom_errors.txt >> temp.bat +if exist custom_errors.log del custom_errors.log +for %%i in (..\sql\game\custom\*.sql) do echo "%mysqlPath%" -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% ^< %%i 2^>^> custom_errors.log >> temp.bat call temp.bat> nul del temp.bat -move custom_errors.txt %workdir% -title L2JDP Installer - Custom Server Tables Process Complete -cls -echo Database structure for L2J Custom finished. -echo. -echo Remember that in order to get these additions actually working -echo you need to edit your configuration files. -echo. -pause +move custom_errors.log %workdir% goto mod_ask :mod_ask @@ -829,6 +825,9 @@ echo. echo Some of these mods would require extra tables in order to work echo and those tables could be created now if you wanted to. echo. +echo Remember that in order to get these additions actually working +echo you need to edit your configuration files. +echo. set /p cstprompt=Install Mod Server Tables: (y) yes or (n) no (default no): if /i %cstprompt%==y goto mod_install if /i %cstprompt%==n goto end @@ -838,19 +837,11 @@ cls echo. echo Installing Mods content. echo @echo off> temp.bat -if exist mods_errors.txt del mods_errors.txt -for %%i in (..\sql\game\mods\*.sql) do echo "%mysqlPath%" -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% ^< %%i 2^>^> mods_errors.txt >> temp.bat +if exist mods_errors.log del mods_errors.log +for %%i in (..\sql\game\mods\*.sql) do echo "%mysqlPath%" -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% ^< %%i 2^>^> mods_errors.log >> temp.bat call temp.bat> nul del temp.bat -move mods_errors.txt %workdir% -title L2JDP Installer - Mod Server Tables Process Complete -cls -echo Database structure for L2J Mods finished. -echo. -echo Remember that in order to get these additions actually working -echo you need to edit your configuration files. -echo. -pause +move mods_errors.log %workdir% goto end :omfg @@ -896,7 +887,7 @@ echo. echo L2JDP Database Installer 2012 echo. echo (C) 2004-2012 L2J DataPack Team -echo L2JDP Database Installer comes with ABSOLUTELY NO WARRANTY; +echo L2JDP Database Installer comes with ABSOLUTELY NO WARRANTY echo This is free software, and you are welcome to redistribute it echo under certain conditions; See the file gpl.txt for further echo details. diff --git a/L2J_DataPack_BETA/dist/tools/database_installer.sh b/L2J_DataPack_BETA/dist/tools/database_installer.sh index a0631d38b17399317d091c60e6e3148530d68d62..9f582695dd8a0c78addbe5c2515aa66396370a6c 100644 --- a/L2J_DataPack_BETA/dist/tools/database_installer.sh +++ b/L2J_DataPack_BETA/dist/tools/database_installer.sh @@ -183,74 +183,99 @@ configure $CONF fi } -asklogin(){ +ls_backup(){ +while : + do + clear + echo "" + echo -ne "Do you want to make a backup copy of your LSDB? (y/n): " + read LSB + if [ "$LSB" == "Y" -o "$LSB" == "y" ]; then + echo "Trying to make a backup of your Login Server DataBase." + $MYSQLDUMPPATH --add-drop-table -h $LSDBHOST -u $LSUSER --password=$LSPASS $LSDB > ls_backup.sql + if [ $? -ne 0 ];then + clear + echo "" + echo "There was a problem accesing your LS database, either it wasnt created or authentication data is incorrect." + exit 1 + fi + break + elif [ "$LSB" == "n" -o "$LSB" == "N" ]; then + break + fi + done +ls_ask +} + +ls_ask(){ clear -echo "#############################################" -echo "# WARNING: This section of the script CAN #" -echo "# destroy your characters and accounts #" -echo "# information. Read questions carefully #" -echo "# before you reply. #" -echo "#############################################" echo "" -echo "Choose full (f) if you don't have and 'accounts' table or would" -echo "prefer to erase the existing accounts information." -echo "Choose skip (s) to skip loginserver DB installation and go to" -echo "communityserver DB installation/upgrade." -echo -ne "LOGINSERVER DB install type: (f) full, (s) skip or (q) quit? " -read LOGINPROMPT -case "$LOGINPROMPT" in - "f"|"F") logininstall; loginupgrade; cbbackup; askcbtype;; - "s"|"S") cbbackup; askcbtype;; +echo "LOGINSERVER DATABASE install type:" +echo "" +echo "(f) Full: WARNING! I'll destroy ALL of your existing login" +echo " data." +echo "" +echo "(u) Upgrade: I'll do my best to preserve all login data." +echo "" +echo "(s) Skip: I'll take you to the communityserver database" +echo " installation and upgrade options." +echo "" +echo "(q) Quit" +echo "" +echo -ne "LOGINSERVER DB install type: " +read LSASK +case "$LSASK" in + "f"|"F") ls_cleanup I;; + "u"|"U") ls_upgrade U;; + "s"|"S") cs_backup;; "q"|"Q") finish;; - *) asklogin;; + *) ls_ask;; esac } -logininstall(){ -echo "Deleting loginserver tables for new content." +ls_cleanup(){ +clear +echo "Deleting Login Server tables for new content." $MYL < ls_cleanup.sql +ls_install } -loginupgrade(){ -clear -echo "Installling new loginserver content." +ls_upgrade(){ +echo "" +echo "Upgrading structure of Community Server tables." +echo "" +for file in $(ls ../sql/login/updates/*.sql);do + $MYL --force < $file 2>> ls_error.log +done +ls_install +} + +ls_install(){ +if [ "$1" == "I" ]; then +echo "" +echo "Installing new Login Server content." +echo "" +else +echo "" +echo "Upgrading Login Server content." +echo "" +fi for login in $(ls ../sql/login/*.sql);do echo "Installing loginserver table : $login" $MYL < $login done +cs_ask } -gsbackup(){ -while : - do - echo "" - echo -ne "Do you want to make a backup copy of your GSDB? (y/n): " - read LSB - if [ "$LSB" == "Y" -o "$LSB" == "y" ]; then - echo "Making a backup of the original gameserver database." - $MYSQLDUMPPATH --add-drop-table -h $GSDBHOST -u $GSUSER --password=$GSPASS $GSDB > gs_backup.sql - if [ $? -ne 0 ];then - clear - echo "" - echo "There was a problem accesing your GS database, either it wasnt created or authentication data is incorrect." - exit 1 - fi - break - elif [ "$LSB" == "n" -o "$LSB" == "N" ]; then - break - fi - done -} - -cbbackup(){ +cs_backup(){ while : do clear echo "" echo -ne "Do you want to make a backup copy of your CBDB? (y/n): " - read LSB - if [ "$LSB" == "Y" -o "$LSB" == "y" ]; then - echo "Making a backup of the original communityserver database." + read CSB + if [ "$CSB" == "Y" -o "$CSB" == "y" ]; then + echo "Trying to make a backup of your Community Server DataBase." $MYSQLDUMPPATH --add-drop-table -h $CBDBHOST -u $CBUSER --password=$CBPASS $CBDB > cs_backup.sql if [ $? -ne 0 ];then clear @@ -259,240 +284,241 @@ while : exit 1 fi break - elif [ "$LSB" == "n" -o "$LSB" == "N" ]; then + elif [ "$CSB" == "n" -o "$CSB" == "N" ]; then break fi done +cs_ask } -lsbackup(){ +cs_ask(){ +clear +echo "" +echo "COMMUNITY SERVER DATABASE install type:" +echo "" +echo "(f) Full: WARNING! I'll destroy ALL of your existing community" +echo " data (i really mean it: mail, forum, memo.. ALL)" +echo "" +echo "(u) Upgrade: I'll do my best to preserve all of your community" +echo " data." +echo "" +echo "(s) Skip: I'll take you to the gameserver database" +echo " installation and upgrade options." +echo "" +echo "(q) Quit" +echo "" +echo -ne "COMMUNITYSERVER DB install type: " +read CSASK +case "$CSASK" in + "f"|"F") cs_cleanup I;; + "u"|"U") cs_upgrade U;; + "s"|"S") gs_backup;; + "q"|"Q") finish;; + *) cs_ask;; +esac +} + +cs_cleanup(){ +clear +echo "Deleting Community Server tables for new content." +$MYC < cs_cleanup.sql +cs_install +} + +cs_upgrade(){ +echo "" +echo "Upgrading structure of Game Server tables." +echo "" +for file in $(ls ../sql/community/updates/*sql);do + $MYC --force < $file 2>> cs_error.log +done +cs_install +} + +cs_install(){ +if [ "$1" == "I" ]; then +echo "" +echo "Installing new Community Server content." +echo "" +else +echo "" +echo "Upgrading Community Server content." +echo "" +fi +for cb in $(ls ../sql/community/*.sql);do + echo "Installing Communityserver table : $cb" + $MYC < $cb +done +gs_ask +} + +gs_backup(){ while : do clear echo "" - echo -ne "Do you want to make a backup copy of your LSDB? (y/n): " - read LSB - if [ "$LSB" == "Y" -o "$LSB" == "y" ]; then - echo "Making a backup of the original loginserver database." - $MYSQLDUMPPATH --add-drop-table -h $LSDBHOST -u $LSUSER --password=$LSPASS $LSDB > ls_backup.sql + echo -ne "Do you want to make a backup copy of your GSDB? (y/n): " + read GSB + if [ "$GSB" == "Y" -o "$GSB" == "y" ]; then + echo "Trying to create a Game Server DataBase." + $MYSQLDUMPPATH --add-drop-table -h $GSDBHOST -u $GSUSER --password=$GSPASS $GSDB > gs_backup.sql if [ $? -ne 0 ];then - clear - echo "" - echo "There was a problem accesing your LS database, either it wasnt created or authentication data is incorrect." - exit 1 + clear + echo "" + echo "There was a problem accesing your GS database, either it wasnt created or authentication data is incorrect." + exit 1 fi break - elif [ "$LSB" == "n" -o "$LSB" == "N" ]; then + elif [ "$GSB" == "n" -o "$GSB" == "N" ]; then break fi done +gs_ask } -asktype(){ +gs_ask(){ +clear echo "" +echo "GAME SERVER DATABASE install:" echo "" -echo "WARNING: A full install (f) will destroy all existing character data." -echo -ne "GAMESERVER DB install type: (f) full install, (u) upgrade, (s) skip or (q) quit? " -read INSTALLTYPE -case "$INSTALLTYPE" in - "f"|"F") fullinstall; upgradeinstall I; custom;; - "u"|"U") upgradeinstall U; custom;; - "s"|"S") custom;; - "q"|"Q") finish;; - *) asktype;; -esac -} - -askcbtype(){ -clear +echo "(f) Full: WARNING! I'll destroy ALL of your existing character" +echo " data (i really mean it: items, pets.. ALL)" +echo "" +echo "(u) Upgrade: I'll do my best to preserve all of your character" +echo " data." +echo "" +echo "(s) Skip: We'll get into the last set of questions (cummulative" +echo " updates, custom stuff...)" echo "" +echo "(q) Quit" echo "" -echo "WARNING: A full install (f) will destroy all existing community data." -echo -ne "COMMUNITYSERVER DB install type: (f) full install, (u) upgrade, (s) skip or (q) quit? " -read INSTALLTYPE -case "$INSTALLTYPE" in - "f"|"F") fullcbinstall; upgradecbinstall I; gsbackup; asktype;; - "u"|"U") upgradecbinstall U; gsbackup; asktype;; - "s"|"S") gsbackup; asktype;; +echo -ne "GAMESERVER DB install type: " +read GSASK +case "$GSASK" in + "f"|"F") gs_cleanup I;; + "u"|"U") gs_upgrade U;; + "s"|"S") custom_ask;; "q"|"Q") finish;; - *) asktype;; + *) gs_ask;; esac } -fullcbinstall(){ -echo "Deleting all communityserver tables for new content." -$MYC < cs_cleanup.sql -} - -upgradecbinstall(){ +gs_cleanup(){ clear -if [ "$1" == "I" ]; then -echo "Installling new communityserver content." -else -echo "Upgrading communityserver content" -fi -if [ "$1" == "I" ]; then - for cb in $(ls ../sql/community/*.sql);do - echo "Installing Community Board table : $cb" - $MYC < $cb - done -fi -newbie_helper_cb +echo "Deleting all Game Server tables for new content." +$MYG < gs_cleanup.sql +gs_install } -fullinstall(){ -clear -echo "Deleting all gameserver tables for new content." -$MYG < gs_cleanup.sql +gs_upgrade(){ +echo "" +echo "Upgrading structure of Game Server tables (this could take awhile, be patient)" +echo "" +for file in $(ls ../sql/game/updates/*.sql);do + $MYG --force < $file 2>> gs_error.log +done +gs_install } -upgradeinstall(){ -clear +gs_install(){ if [ "$1" == "I" ]; then -echo "Installling new gameserver content." +echo "" +echo "Installing new Game Server content." +echo "" else -echo "Upgrading gameserver content" +echo "" +echo "Upgrading Game Server content." +echo "" fi - for gs in $(ls ../sql/game/*.sql);do echo "Installing GameServer table : $gs" $MYG < $gs done - -newbie_helper +custom_ask } -custom(){ +custom_ask(){ +clear echo "" +echo "L2J provides some Custom Server Tables for non-retail modifications" +echo "in order to avoid override the original Server Tables." echo "" -echo -ne "Install custom gameserver DB tables: (y) yes or (n) no or (q) quit?" -read ASKCS -case "$ASKCS" in - "y"|"Y") cstinstall;; - "n"|"N") finish;; - "q"|"Q") finish;; - *) custom;; +echo "Remember that in order to get these additions actually working" +echo "you need to edit your configuration files." +echo "" +echo -ne "Install Custom Server Tables: (y) yes or (n) no ?" +read CSASK +case "$CSASK" in + "y"|"Y") custom_install;; + "n"|"N") mod_ask;; + *) custom_ask;; esac -finish } -cstinstall(){ -while : - do - clear - echo "" - echo -ne "Do you want to make another backup of GSDB before applying custom contents? (y/N): " - read LSB - if [ "$LSB" == "Y" -o "$LSB" == "y" ]; then - echo "Making a backup of the default gameserver tables." - $MYSQLDUMPPATH --add-drop-table -h $GSDBHOST -u $GSUSER --password=$GSPASS $GSDB > custom_backup.sql 2> /dev/null - if [ $? -ne 0 ];then - echo "" - echo "There was a problem accesing your GS database, server down?." - exit 1 - fi - break - elif [ "$LSB" == "n" -o "$LSB" == "N" -o "$LSB" == "" ]; then - break - fi - done +custom_install(){ clear -echo "Installing custom content." +echo "" +echo "Installing Custom content." for custom in $(ls ../sql/game/custom/*.sql);do echo "Installing custom table: $custom" $MYG < $custom done -# L2J mods that needed extra tables to work properly, should be -# listed here. To do so copy & paste the following 6 lines and -# change them properly: -# MOD: Wedding. - echo -ne "Install "Wedding Mod" tables? (y/N): " - read modprompt - if [ "$modprompt" == "y" -o "$modprompt" == "Y" ]; then - for mod in $(ls ../sql/game/mods/*.sql);do - echo "Installing custom mod table : $mod" - $MYG < $mod - done - fi +clear +mod_ask +} +mod_ask(){ +clear +echo "" +echo "L2J provides a basic infraestructure for some non-retail features" +echo "(aka L2J mods) to get enabled with a minimum of changes." +echo "" +echo "Some of these mods would require extra tables in order to work" +echo "and those tables could be created now if you wanted to." +echo "" +echo "Remember that in order to get these additions actually working" +echo "you need to edit your configuration files." +echo "" +echo -ne "Install Mod Server Tables: (y) yes or (n) no ?" +read MDASK +case "$MDASK" in + "y"|"Y") mod_install;; + "n"|"N") finish;; + *) mod_ask;; +esac +} + +mod_install(){ +clear +echo "" +echo "Installing Mods content." +for mod in $(ls ../sql/game/mods/*.sql);do + echo "Installing custom mod table : $mod" + $MYG < $mod +done +clear finish } finish(){ clear -echo "Script execution finished." +echo "L2JDP Database Installer 2012" echo "" -echo "L2JDP database_installer version 0.2.2" -echo "(C) 2007-2011 L2J Datapack Team" -echo "database_installer comes with ABSOLUTELY NO WARRANTY;" +echo "(C) 2004-2012 L2J DataPack Team" +echo "L2JDP Database Installer comes with ABSOLUTELY NO WARRANTY" echo "This is free software, and you are welcome to redistribute it" echo "under certain conditions; See the file gpl.txt for further" echo "details." echo "" echo "Thanks for using our software." echo "visit http://www.l2jdp.com for more info about" -echo "the L2J Datapack project." +echo "the L2J DataPack Project." exit 0 } -newbie_helper(){ -while : - do - echo "" - echo -ne "If you're not that skilled applying changes within 'updates' folder, i can try to do it for you (y). If you wish to do it on your own, choose (n). Should i parse updates files? (Y/n)" - read NOB - if [ "$NOB" == "Y" -o "$NOB" == "y" -o "$NOB" == "" ]; then - clear - echo "" - echo "There we go, it may take some time..." - echo "Installing Gameserver Updates" - for file in $(ls ../sql/game/updates/*.sql);do - $MYG --force < $file 2>> gserror.log - done - echo "Installing Loginserver Updates" - for file in $(ls ../sql/login/updates/*.sql);do - $MYL --force < $file 2>> lserror.log - done - break - elif [ "$NOB" == "n" -o "$NOB" == "N" ]; then - break - fi - done -} - -newbie_helper_cb(){ -while : - do - echo "" - echo -ne "If you're not that skilled applying changes within 'updates' folder, i can try to do it for you (y). If you wish to do it on your own, choose (n). Should i parse updates files? (Y/n)" - read NOB - if [ "$NOB" == "Y" -o "$NOB" == "y" -o "$NOB" == "" ]; then - clear - echo "" - echo "There we go, it may take some time..." - echo "updates parser results. Last run: "`date` >cb_database_installer.log - for file in $(ls ../sql/community/updates/*sql);do - echo $file|cut -d/ -f4 >> cb_database_installer.log - $MYC --force < $file 2>> cb_database_installer.log - if [ $? -eq 0 ];then - echo "no errors">> cb_database_installer.log - fi - done - clear - echo "" - echo "Log available at $(pwd)/cb_database_installer.log" - echo "" - break - elif [ "$NOB" == "n" -o "$NOB" == "N" ]; then - break - fi - done -} - clear load_config $1 MYL="$MYSQLPATH -h $LSDBHOST -u $LSUSER --password=$LSPASS -D $LSDB" MYG="$MYSQLPATH -h $GSDBHOST -u $GSUSER --password=$GSPASS -D $GSDB" MYC="$MYSQLPATH -h $CBDBHOST -u $CBUSER --password=$CBPASS -D $CBDB" -lsbackup -asklogin \ No newline at end of file +ls_backup \ No newline at end of file