跳转到内容

打包日志

This document summarizes the steps taken to successfully package the student project with an embedded, slimmed-down MySQL database into a self-contained ZIP file.

1. Created Distribution Files & Directory Structure

Section titled “1. Created Distribution Files & Directory Structure”

Constructed the main application folder dist/genshinrpg/ containing:

  • run.bat (Entry point for the user)
  • start_mysql.bat (Port detection, dynamic my.ini creation, and initialization)
  • stop_mysql.bat (Graceful shutdown using process ID)
  • README.txt (Clear requirements and troubleshooting steps)
  • .gitignore (Ignores temporary database run logs and config files)

Copied E:\SQL\mysql and pruned its size by 92%:

  • Deleted all debug files (*.pdb) and unnecessary helper utilities (*.exe).
  • Excluded dynamic runtime artifacts (ib_logfile*, undo_*, auto.cnf, etc.).
  • Removed Japanese morphological analysis files (lib/mecab).
  • Restructured mysql to consume only ~80 MB uncompressed and 27 MB zipped.

Adjusted only the database process paths in com.genshin.rpg.dao.DBConnector.java from hardcoded absolute paths E:\\SQL\\mysql\\ to relative paths under mysql/. All passwords, connection strings, and other business logic were left completely untouched.

Pre-compiled the refactored Java files using javac into bin/com/genshin/rpg/, removing the requirement for the end-user to compile code themselves.

Due to host-level port exclusions blocking TCP port 3306, we set up a SOCKS5 proxy in Python and mapped it to port 3600. The verification succeeded:

  • First Run: --initialize-insecure generated a fresh database directory, and the Java application automatically created the genshin_rpg schema, generated all tables, and seeded characters and monsters data.
  • Second Run: The port detection mechanism correctly detected the open port and skipped initialization.

All outputs are saved under E:\AI\zcode\object\ke-she\dist\:

  • GenshinRPG.zip - The final zip package (~27.0 MB).
  • PACK_NOTE.md - Detail log of file sizes, kept/deleted files, and test results.