LAUNCH EQ2EMU.bat 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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.
  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 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.
  20. rem On each load delete options.bat and re-download it.
  21. powershell write-host -fore Blue [Making sure you have an updated Options.bat]
  22. move options.bat options.old
  23. wget -q -N --no-check-certificate https://www.zeklabs.com/dl/Options.bat
  24. echo [Completed Option.bat Update]
  25. echo  
  26. rem check if first run, if it is deal with it
  27. SET FIRSTRUN=0
  28. if not exist options\ranonce.txt SET FIRSTRUN=1
  29. 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 ************
  30. if /I "%SQLUPDATE%" EQU "1" powershell write-host -fore Red ******** Pausing for 10 seconds. If you wish to cancel press CTL-C NOW!! ************
  31. if /I "%SQLUPDATE%" EQU "1" timeout /t 10
  32. if /I "%SQLUPDATE%" EQU "1" echo [Checking for SQL Full Update and Downloading]
  33. if /I "%SQLUPDATE%" EQU "1" wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://zeklabs.com/dl/eq2emudb.rar
  34. if /I "%SQLUPDATE%" EQU "1" unrar x -y -inul eq2emudb.rar
  35. if /I "%SQLUPDATE%" EQU "1" del eq2emudb.rar
  36. if /I "%SQLUPDATE%" EQU "1" echo [Completed Download of SQL Full Update]
  37. if /I "%SQLUPDATE%" EQU "2" echo [Checking for SQL Update and Downloading]
  38. if /I "%SQLUPDATE%" EQU "2" wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://zeklabs.com/dl/eq2dbupdate.rar
  39. if /I "%SQLUPDATE%" EQU "2" unrar x -y -inul eq2dbupdate.rar
  40. if /I "%SQLUPDATE%" EQU "2" del eq2dbupdate.rar
  41. if /I "%SQLUPDATE%" EQU "2" echo [Completed Download of SQL Update]
  42. if /I "%EXEUPDATE%" EQU "1" echo [Checking for EXE Updates. **NOTE** If something goes wrong, backups files can be found in the oldfiles folder]
  43. if /I "%EXEUPDATE%" EQU "1" cd server
  44. if /I "%EXEUPDATE%" EQU "1" mkdir oldfiles
  45. if /I "%EXEUPDATE%" EQU "1" move eq2*.exe oldfiles
  46. if /I "%EXEUPDATE%" EQU "1" wget -q http://cutpon.com:3000/devn00b/EQ2EMu/raw/master/server/EQ2Login__Debug64.exe
  47. if /I "%EXEUPDATE%" EQU "1" wget -q http://cutpon.com:3000/devn00b/EQ2EMu/raw/master/server/EQ2World__Debug_x64.exe
  48. if /I "%EXEUPDATE%" EQU "1" echo [New EXE Could Mean NEW Structs. Checking...]
  49. if /I "%EXEUPDATE%" EQU "1" move SpawnStructs.xml oldfiles/
  50. if /I "%EXEUPDATE%" EQU "1" move WorldStructs.xml oldfiles/
  51. if /I "%EXEUPDATE%" EQU "1" move EQ2_Structs.xml oldfiles/
  52. if /I "%EXEUPDATE%" EQU "1" move ItemStructs.xml oldfiles/
  53. if /I "%EXEUPDATE%" EQU "1" move LoginStructs.xml oldfiles/
  54. if /I "%EXEUPDATE%" EQU "1" move CommonStructs.xml oldfiles/
  55. if /I "%EXEUPDATE%" EQU "1" wget -q http://cutpon.com:3000/devn00b/EQ2EMu/raw/master/server/SpawnStructs.xml
  56. if /I "%EXEUPDATE%" EQU "1" wget -q http://cutpon.com:3000/devn00b/EQ2EMu/raw/master/server/WorldStructs.xml
  57. if /I "%EXEUPDATE%" EQU "1" wget -q http://cutpon.com:3000/devn00b/EQ2EMu/raw/master/server/EQ2_Structs.xml
  58. if /I "%EXEUPDATE%" EQU "1" wget -q http://cutpon.com:3000/devn00b/EQ2EMu/raw/master/server/ItemStructs.xml
  59. if /I "%EXEUPDATE%" EQU "1" wget -q http://cutpon.com:3000/devn00b/EQ2EMu/raw/master/server/LoginStructs.xml
  60. if /I "%EXEUPDATE%" EQU "1" wget -q http://cutpon.com:3000/devn00b/EQ2EMu/raw/master/server/CommonStructs.xml
  61. if /I "%EXEUPDATE%" EQU "1" echo [Completed Struct Updates]
  62. if /I "%EXEUPDATE%" EQU "1" echo [Completed EXE Updates]
  63. if /I "%EXEUPDATE%" EQU "1" cd ..
  64. if /I "%LUAUPDATE%" EQU "1" echo [Checking for LUA Updates]
  65. if /I "%LUAUPDATE%" EQU "1" echo [This will take a moment due to number of files]
  66. if /I "%LUAUPDATE%" EQU "1" cd server
  67. if /I "%LUAUPDATE%" EQU "1" wget -q -N --no-check-certificate --show-progress --progress=bar:force:noscroll https://zeklabs.com/dl/eq2emulua.rar
  68. if /I "%LUAUPDATE%" EQU "1" ..\unrar x -y -inul eq2emulua.rar
  69. if /I "%LUAUPDATE%" EQU "1" del eq2emulua.rar
  70. if /I "%LUAUPDATE%" EQU "1" echo [Completed LUA Updates]
  71. if /I "%LUAUPDATE%" EQU "1" cd ..
  72. if /I "%MAPUPDATE%" EQU "1" echo [Checking for MAP Updates]
  73. if /I "%MAPUPDATE%" EQU "1" echo [This will take a LONG time. The maps are 2+ GB in size.]
  74. if /I "%MAPUPDATE%" EQU "1" cd server
  75. 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
  76. 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
  77. 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
  78. 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
  79. 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
  80. 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
  81. 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
  82. 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
  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.part09.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.part10.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.part11.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.part12.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.part13.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.part14.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.part15.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.part16.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.part17.rar
  92. if /I "%MAPUPDATE%" EQU "1" echo [Any downloads below here means NEW maps!]
  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.part18.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.part19.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.part20.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.part21.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.part22.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.part23.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.part24.rar
  100. 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
  101. if /I "%MAPUPDATE%" EQU "1" ..\unrar x -o+ -inul eq2emumaps*.rar
  102. if /I "%MAPUPDATE%" EQU "1" del /f /q eq2emumaps*.rar
  103. if /I "%MAPUPDATE%" EQU "1" echo [Completed MAP Updates]
  104. if /I "%MAPUPDATE%" EQU "1" cd ..
  105. echo [Loading MariaDB]
  106. if /I "%FIRSTRUN%" EQU "1" wget -q --no-check-certificate https://www.zeklabs.com/dl/startdb.bat
  107. start startdb.bat
  108. echo [You Can Press Any Key To Continue Once MYSQL has Completed Loading]
  109. timeout /t 60
  110. echo [MariaDB Loaded]
  111. if /I "%LSUPDATE%" EQU "1" echo [Updating LoginServer SQL]
  112. if /I "%LSUPDATE%" EQU "1" cd server
  113. if /I "%LSUPDATE%" EQU "1" mkdir oldfiles
  114. if /I "%LSUPDATE%" EQU "1" echo [Saving Character and World Data before Import]
  115. if /I "%LSUPDATE%" EQU "1" ..\mariadb\bin\mysqldump -ueq2emu -peq2emu eq2ls login_characters > lschars.sql
  116. if /I "%LSUPDATE%" EQU "1" ..\mariadb\bin\mysqldump -ueq2emu -peq2emu eq2ls login_worldservers >> lschars.sql
  117. if /I "%LSUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate https://zeklabs.com/dl/eq2emulssql.rar
  118. if /I "%LSUPDATE%" EQU "1" ..\unrar x -y -inul eq2emulssql.rar
  119. if /I "%LSUPDATE%" EQU "1" ..\mariadb\bin\mysql -ueq2emu -peq2emu --database=eq2emu < eq2emulssql.sql
  120. if /I "%LSUPDATE%" EQU "1" echo [Importing old character data (if any)]
  121. if /I "%LSUPDATE%" EQU "1" ..\mariadb\bin\mysql -ueq2emu -peq2emu --database=eq2ls <lschars.sql
  122. if /I "%LSUPDATE%" EQU "1" echo [Characters Backported to DB]
  123. if /I "%LSUPDATE%" EQU "1" echo [Making sure opcode table is correct]
  124. if /I "%LSUPDATE%" EQU "1" ..\wget -q -N --no-check-certificate https://zeklabs.com/dl/ls.sql
  125. if /I "%LSUPDATE%" EQU "1" ..\mariadb\bin\mysql -ueq2emu -peq2emu --database=eq2ls <ls.sql
  126. if /I "%LSUPDATE%" EQU "1" del /f /q lschars.sql
  127. if /I "%LSUPDATE%" EQU "1" del /f /q ls.sql
  128. if /I "%LSUPDATE%" EQU "1" move eq2emuls* oldfiles/
  129. if /I "%LSUPDATE%" EQU "1" echo [Completed Updating LoginServer SQL]
  130. if /I "%LSUPDATE%" EQU "1" cd ..
  131. if /I "%SENDBUGS%" EQU "1" echo [Uploading BUG Reports to Devn00b]
  132. if /I "%SENDBUGS%" EQU "1" cd mariadb\bin\
  133. 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
  134. if /I "%SENDBUGS%" EQU "1" mysql -ueq2emu -pidontgive2shits --host=eq2db.devn00b.com --database=eq2emu <bugs.sql
  135. if /I "%SENDBUGS%" EQU "1" mysql -ueq2emu -peq2emu --database=eq2emu < options\clearbugs.sql
  136. if /I "%SENDBUGS%" EQU "1" del bugs.sql
  137. if /I "%SENDBUGS%" EQU "1" echo [Completed BUG Report Upload. Thank You.]
  138. if /I "%SENDBUGS%" EQU "1" cd ..\..
  139. if /I "%SQLUPDATE%" EQU "1" echo [Importing Full DB Update]
  140. if /I "%SQLUPDATE%" EQU "1" cd mariadb\bin\
  141. if /I "%SQLUPDATE%" EQU "1" echo [Deleting Character and Guild Info]
  142. if /I "%SQLUPDATE%" EQU "1" mysql -ueq2emu -peq2emu --database=eq2emu <..\..\eq2emu.sql
  143. if /I "%SQLUPDATE%" EQU "1" cd ..\..
  144. if /I "%SQLUPDATE%" EQU "1" del eq2emudb.rar
  145. if /I "%SQLUPDATE%" EQU "1" del eq2emu.sql
  146. if /I "%SQLUPDATE%" EQU "1" SET FIRSTRUN=1
  147. if /I "%SQLUPDATE%" EQU "1" echo [Flag set to import default LS/Characters]
  148. if /I "%SQLUPDATE%" EQU "1" echo [Completed Full DB Update]
  149. if /I "%SQLUPDATE%" EQU "2" echo [Importing Partial DB Update]
  150. if /I "%SQLUPDATE%" EQU "2" cd mariadb\bin\
  151. if /I "%SQLUPDATE%" EQU "2" mysql -ueq2emu -peq2emu --database=eq2emu <..\..\eq2dbupdate.sql
  152. if /I "%SQLUPDATE%" EQU "2" cd ..\..
  153. if /I "%SQLUPDATE%" EQU "2" del eq2dbupdate.rar
  154. if /I "%SQLUPDATE%" EQU "2" del eq2dbupdate.sql
  155. if /I "%SQLUPDATE%" EQU "2" echo [Completed Partial DB Update]
  156. if /I "%FIRSTRUN%" EQU "1" echo [Inserting Starter Admin Account]
  157. if /I "%FIRSTRUN%" EQU "1" cd mariadb\bin\
  158. if /I "%FIRSTRUN%" EQU "1" ..\..\wget -q --no-check-certificate https://www.zeklabs.com/dl/eq2emu-account-insert.sql
  159. if /I "%FIRSTRUN%" EQU "1" mysql -ueq2emu -peq2emu <eq2emu-account-insert.sql
  160. if /I "%FIRSTRUN%" EQU "1" del /f /q eq2emu-account-insert.sql
  161. if /I "%FIRSTRUN%" EQU "1" cd ..\..
  162. if /I "%FIRSTRUN%" EQU "1" echo [Starter Account Inserted. Username: eq2emu Password: eq2emu Character: Eqtwoemu]
  163. if /I "%FIRSTRUN%" EQU "1" echo [Starter Account Inserted. Username: eq2emu Password: eq2emu Character: Eqtwoemu] > options\ranonce.txt
  164. echo [Starting World And Login]
  165. start srvls.bat
  166. start srvwrld.bat
  167. exit