LAUNCH EQ2EMU.bat 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. @echo off
  2. rem The following are the variables used, what they do, and the settings available.
  3. rem All settings on by default.
  4. rem SQLUPDATE Will update, the EQ2Emu World DB. 1 for on, 2 for updates only. anything else for off.
  5. rem ******** SETTING SQLUPDATE = 1 WILL ERASE ALL DATA IN THE DATABASE use 2 TO SAVE CHARACTERS/GUILDS ************
  6. rem EXEUPDATE Will update, EXE files. 1 for on, anything else for off. If we update we check for structs as well.
  7. rem LUAUPDATE Will update, LUA files. 1 for on, anything else for off.
  8. rem MAPUPDATE Will update, MAP files. 1 for on, anything else for off.
  9. rem SENDBUGS Will send your bug reports to an offsite server to be reviewed by staff. 1 for on, anything else is off.
  10. rem LSUPDATE Will check for new Loginserver updates SQL
  11. SET NAME=Zeklabs.com
  12. TITLE %NAME%
  13. SET SQLUPDATE=1
  14. SET EXEUPDATE=1
  15. SET LUAUPDATE=1
  16. SET MAPUPDATE=1
  17. SET SENDBUGS=1
  18. SET LSUPDATE=1
  19. rem Lets show the nice fancy header
  20. echo 88888888888 ,ad8888ba, ad888888b, 88888888888 88b d88
  21. echo 88 d8"' `"8b d8" "88 88 888b d888
  22. echo 88 d8' `8b a8P 88 88`8b d8'88
  23. echo 88aaaaa 88 88 ,d8P" 88aaaaa 88 `8b d8' 88 88 88
  24. echo 88""""" 88 88 a8P" 88""""" 88 `8b d8' 88 88 88
  25. echo 88 Y8, "88,,8P a8P' 88 88 `8b d8' 88 88 88
  26. echo 88 Y8a. Y88P d8" 88 88 `888' 88 "8a, ,a88
  27. echo 88888888888 `"Y8888Y"Y8a 88888888888 88888888888 88 `8' 88 `"YbbdP'Y8
  28. echo Windows Installer by Devn00b [Launch EQ2EMU.bat] https://www.eq2emu.com
  29. rem Some people have older version of this script, and are missing options.bat so lets be sure they get it no matter what option is selected.
  30. rem On each load delete options.bat and re-download it.
  31. powershell write-host -fore Blue [Making sure you have an updated Options.bat]
  32. move options.bat options.old
  33. wget -q -N --no-check-certificate https://www.zeklabs.com/dl/Options.bat
  34. echo [Completed Option.bat Update]
  35. echo  
  36. rem check if first run, if it is deal with it
  37. SET FIRSTRUN=0
  38. if not exist options\ranonce.txt SET FIRSTRUN=1
  39. if /I "%SQLUPDATE%" EQU "1" powershell write-host -fore Red ******** SETTING SQLUPDATE = 1 WILL ERASE ALL DATA IN THE DATABASE use 2 TO SAVE CHARACTERS/GUILDS ************
  40. if /I "%SQLUPDATE%" EQU "1" echo [Checking for SQL Full Update and Downloading]
  41. if /I "%SQLUPDATE%" EQU "1" wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://zeklabs.com/dl/eq2emudb.rar
  42. if /I "%SQLUPDATE%" EQU "1" unrar x -y -inul eq2emudb.rar
  43. if /I "%SQLUPDATE%" EQU "1" del eq2emudb.rar
  44. if /I "%SQLUPDATE%" EQU "1" echo [Completed Download of SQL Full Update]
  45. if /I "%SQLUPDATE%" EQU "2" echo [Checking for SQL Update and Downloading]
  46. if /I "%SQLUPDATE%" EQU "2" wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://zeklabs.com/dl/eq2dbupdate.rar
  47. if /I "%SQLUPDATE%" EQU "2" unrar x -y -inul eq2dbupdate.rar
  48. if /I "%SQLUPDATE%" EQU "2" del eq2dbupdate.rar
  49. if /I "%SQLUPDATE%" EQU "2" echo [Completed Download of SQL Update]
  50. if /I "%EXEUPDATE%" EQU "1" echo [Checking for EXE Updates. **NOTE** If something goes wrong, backups files can be found in the oldfiles folder]
  51. if /I "%EXEUPDATE%" EQU "1" cd server
  52. if /I "%EXEUPDATE%" EQU "1" mkdir oldfiles
  53. if /I "%EXEUPDATE%" EQU "1" move eq2*.exe oldfiles
  54. if /I "%EXEUPDATE%" EQU "1" wget -q http://git.eq2emu.com:3000/devn00b/EQ2EMu/raw/master/server/EQ2Login__Debug64.exe
  55. if /I "%EXEUPDATE%" EQU "1" wget -q http://git.eq2emu.com:3000/devn00b/EQ2EMu/raw/master/server/EQ2World__Debug_x64.exe
  56. if /I "%EXEUPDATE%" EQU "1" echo [New EXE Could Mean NEW Structs. Checking...]
  57. if /I "%EXEUPDATE%" EQU "1" move SpawnStructs.xml oldfiles/
  58. if /I "%EXEUPDATE%" EQU "1" move WorldStructs.xml oldfiles/
  59. if /I "%EXEUPDATE%" EQU "1" move EQ2_Structs.xml oldfiles/
  60. if /I "%EXEUPDATE%" EQU "1" move ItemStructs.xml oldfiles/
  61. if /I "%EXEUPDATE%" EQU "1" move LoginStructs.xml oldfiles/
  62. if /I "%EXEUPDATE%" EQU "1" move CommonStructs.xml oldfiles/
  63. if /I "%EXEUPDATE%" EQU "1" wget -q http://git.eq2emu.com:3000/devn00b/EQ2EMu/raw/master/server/SpawnStructs.xml
  64. if /I "%EXEUPDATE%" EQU "1" wget -q http://git.eq2emu.com:3000/devn00b/EQ2EMu/raw/master/server/WorldStructs.xml
  65. if /I "%EXEUPDATE%" EQU "1" wget -q http://git.eq2emu.com:3000/devn00b/EQ2EMu/raw/master/server/EQ2_Structs.xml
  66. if /I "%EXEUPDATE%" EQU "1" wget -q http://git.eq2emu.com:3000/devn00b/EQ2EMu/raw/master/server/ItemStructs.xml
  67. if /I "%EXEUPDATE%" EQU "1" wget -q http://git.eq2emu.com:3000/devn00b/EQ2EMu/raw/master/server/LoginStructs.xml
  68. if /I "%EXEUPDATE%" EQU "1" wget -q http://git.eq2emu.com:3000/devn00b/EQ2EMu/raw/master/server/CommonStructs.xml
  69. if /I "%EXEUPDATE%" EQU "1" echo [Completed Struct Updates]
  70. if /I "%EXEUPDATE%" EQU "1" echo [Completed EXE Updates]
  71. if /I "%EXEUPDATE%" EQU "1" cd ..
  72. if /I "%LUAUPDATE%" EQU "1" echo [Checking for LUA Updates]
  73. if /I "%LUAUPDATE%" EQU "1" echo [This will take a moment due to number of files]
  74. if /I "%LUAUPDATE%" EQU "1" cd server
  75. if /I "%LUAUPDATE%" EQU "1" wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://zeklabs.com/dl/eq2emulua.rar
  76. if /I "%LUAUPDATE%" EQU "1" ..\unrar x -y -inul eq2emulua.rar
  77. if /I "%LUAUPDATE%" EQU "1" del eq2emulua.rar
  78. if /I "%LUAUPDATE%" EQU "1" echo [Completed LUA Updates]
  79. if /I "%LUAUPDATE%" EQU "1" cd ..
  80. if /I "%MAPUPDATE%" EQU "1" echo [Checking for MAP Updates]
  81. if /I "%MAPUPDATE%" EQU "1" echo [This will take a LONG time. The maps are 2+ GB in size.]
  82. if /I "%MAPUPDATE%" EQU "1" cd server
  83. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part01.rar
  84. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part02.rar
  85. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part03.rar
  86. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part04.rar
  87. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part05.rar
  88. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part06.rar
  89. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part07.rar
  90. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part08.rar
  91. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part09.rar
  92. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part10.rar
  93. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part11.rar
  94. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part12.rar
  95. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part13.rar
  96. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part14.rar
  97. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part15.rar
  98. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part16.rar
  99. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part17.rar
  100. if /I "%MAPUPDATE%" EQU "1" echo [Any downloads below here means NEW maps!]
  101. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part18.rar
  102. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part19.rar
  103. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part20.rar
  104. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part21.rar
  105. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part22.rar
  106. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part23.rar
  107. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part24.rar
  108. if /I "%MAPUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://github.com/devn00b/EQ2EMu-Maps/raw/master/eq2emumaps.part25.rar
  109. if /I "%MAPUPDATE%" EQU "1" ..\unrar x -o+ -inul eq2emumaps*.rar
  110. if /I "%MAPUPDATE%" EQU "1" del /f /q eq2emumaps*.rar
  111. if /I "%MAPUPDATE%" EQU "1" echo [Completed MAP Updates]
  112. if /I "%MAPUPDATE%" EQU "1" cd ..
  113. echo [Loading MariaDB]
  114. cd mariadb\bin
  115. start db.bat
  116. echo [You Can Press Any Key To Continue Once MYSQL has Completed Loading]
  117. timeout /t 60
  118. echo [MariaDB Loaded]
  119. cd ..\..
  120. if /I "%LSUPDATE%" EQU "1" echo [Updating LoginServer SQL]
  121. if /I "%LSUPDATE%" EQU "1" cd server
  122. if /I "%LSUPDATE%" EQU "1" mkdir oldfiles
  123. if /I "%LSUPDATE%" EQU "1" echo [Saving Character and WorldServer Data before Import]
  124. if /I "%LSUPDATE%" EQU "1" ..\mariadb\bin\mysqldump -ueq2emu -peq2emu eq2ls login_characters > lschars.sql
  125. if /I "%LSUPDATE%" EQU "1" ..\mariadb\bin\mysqldump -ueq2emu -peq2emu eq2ls login_worldservers >> lschars.sql
  126. if /I "%LSUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate https://zeklabs.com/dl/eq2emulssql.rar
  127. if /I "%LSUPDATE%" EQU "1" ..\unrar x -y -inul eq2emulssql.rar
  128. if /I "%LSUPDATE%" EQU "1" ..\mariadb\bin\mysql -ueq2emu -peq2emu --database=eq2emu < eq2emulssql.sql
  129. if /I "%LSUPDATE%" EQU "1" echo [Importing old character data (if any)]
  130. if /I "%LSUPDATE%" EQU "1" ..\mariadb\bin\mysql -ueq2emu -peq2emu --database=eq2ls <lschars.sql
  131. if /I "%LSUPDATE%" EQU "1" echo [Characters Backported to DB]
  132. if /I "%LSUPDATE%" EQU "1" echo [Making sure opcode table is correct]
  133. if /I "%LSUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate https://zeklabs.com/dl/ls.sql
  134. if /I "%LSUPDATE%" EQU "1" ..\mariadb\bin\mysql -ueq2emu -peq2emu --database=eq2ls <ls.sql
  135. if /I "%LSUPDATE%" EQU "1" del /f /q lschars.sql
  136. if /I "%LSUPDATE%" EQU "1" del /f /q ls.sql
  137. if /I "%LSUPDATE%" EQU "1" move eq2emuls* oldfiles/
  138. if /I "%LSUPDATE%" EQU "1" echo [Completed Updating LoginServer SQL]
  139. if /I "%LSUPDATE%" EQU "1" cd ..
  140. if /I "%SENDBUGS%" EQU "1" echo [Uploading BUG Reports to Devn00b]
  141. if /I "%SENDBUGS%" EQU "1" cd mariadb\bin\
  142. if /I "%SENDBUGS%" EQU "1" mysqldump -ueq2emu -peq2emu --no-create-db --no-create-info --complete-insert --skip-add-locks --skip-add-drop-table --skip-comments --compact eq2emu bugs >bugs.sql
  143. if /I "%SENDBUGS%" EQU "1" mysql -ueq2emu -pidontgive2shits --host=eq2db.devn00b.com --database=eq2emu <bugs.sql
  144. if /I "%SENDBUGS%" EQU "1" mysql -ueq2emu -peq2emu --database=eq2emu < options\clearbugs.sql
  145. if /I "%SENDBUGS%" EQU "1" del bugs.sql
  146. if /I "%SENDBUGS%" EQU "1" echo [Completed BUG Report Upload. Thank You.]
  147. if /I "%SENDBUGS%" EQU "1" cd ..\..
  148. if /I "%SQLUPDATE%" EQU "1" echo [Importing Full DB Update]
  149. if /I "%SQLUPDATE%" EQU "1" cd mariadb\bin\
  150. if /I "%SQLUPDATE%" EQU "1" echo [Deleting Character and Guild Info]
  151. if /I "%SQLUPDATE%" EQU "1" mysql -ueq2emu -peq2emu --database=eq2emu <..\..\eq2emu.sql
  152. if /I "%SQLUPDATE%" EQU "1" cd ..\..
  153. if /I "%SQLUPDATE%" EQU "1" del eq2emudb.rar
  154. if /I "%SQLUPDATE%" EQU "1" del eq2emu.sql
  155. if /I "%SQLUPDATE%" EQU "1" SET FIRSTRUN=1
  156. if /I "%SQLUPDATE%" EQU "1" echo [Flag set to import default LS/Characters]
  157. if /I "%SQLUPDATE%" EQU "1" echo [Completed Full DB Update]
  158. if /I "%SQLUPDATE%" EQU "2" echo [Importing Partial DB Update]
  159. if /I "%SQLUPDATE%" EQU "2" cd mariadb\bin\
  160. if /I "%SQLUPDATE%" EQU "2" mysql -ueq2emu -peq2emu --database=eq2emu <..\..\eq2dbupdate.sql
  161. if /I "%SQLUPDATE%" EQU "2" cd ..\..
  162. if /I "%SQLUPDATE%" EQU "2" del eq2dbupdate.rar
  163. if /I "%SQLUPDATE%" EQU "2" del eq2dbupdate.sql
  164. if /I "%SQLUPDATE%" EQU "2" echo [Completed Partial DB Update]
  165. if /I "%FIRSTRUN%" EQU "1" echo [Inserting Starter Admin Account]
  166. if /I "%FIRSTRUN%" EQU "1" cd mariadb\bin\
  167. if /I "%FIRSTRUN%" EQU "1" ..\..\wget -q --no-check-certificate https://www.zeklabs.com/dl/eq2emu-account-insert.sql
  168. if /I "%FIRSTRUN%" EQU "1" mysql -ueq2emu -peq2emu <eq2emu-account-insert.sql
  169. if /I "%FIRSTRUN%" EQU "1" del /f /q eq2emu-account-insert.sql
  170. if /I "%FIRSTRUN%" EQU "1" cd ..\..
  171. if /I "%FIRSTRUN%" EQU "1" echo [Starter Account Inserted. Username: eq2emu Password: eq2emu Character: Eqtwoemu]
  172. if /I "%FIRSTRUN%" EQU "1" echo [Starter Account Inserted. Username: eq2emu Password: eq2emu Character: Eqtwoemu] > options\ranonce.txt
  173. if /I "%FIRSTRUN%" EQU "1" echo [Fixing Windows Bug With Hostname]
  174. if /I "%FIRSTRUN%" EQU "1" cd server
  175. if /I "%FIRSTRUN%" EQU "1" ..\wget -q --no-check-certificate https://www.zeklabs.com/dl/fart.exe
  176. if /I "%FIRSTRUN%" EQU "1" FOR /F "usebackq" %%i IN (`hostname`) DO SET HOSTNAME=%%i
  177. if /I "%FIRSTRUN%" EQU "1" fart loginserver.ini 127.0.0.1 %HOSTNAME%
  178. if /I "%FIRSTRUN%" EQU "1" echo [Hostname Should now be %HOSTNAME%]
  179. if /I "%FIRSTRUN%" EQU "1" cd ..
  180. echo [Starting World And Login]
  181. start srvls.bat
  182. start srvwrld.bat
  183. exit