Skip to content

longfin/9c-launcher

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nine Chronicles Launcher

Overview

This is an electron based multi-platform launcher to run Nine Chronicles. The basic structure is as follows:

./src
|   +-- resources
|   +-- styles
|   +-- views
|   |   +-- MainView.tsx
|   |   +-- LoginView.tsx
|   |   +-- LobbyView.tsx
|   +-- main-process.ts
|   +-- App.tsx

Installation

First, install all dependencies required for development.

npm install

In addition, there are two binaries required:

  • 9C Headless (Standalone): can be built with npm run build-headless (.NET Core SDK required)
  • 9C Unity Player (9c.exe/9c.app): can be downloaded with npm run bundle-player
    • npm run bundle-player downloads the CI-built binary from the NineChronicles repository based on the NineChronicles git submodule commit hash.
    • Download may fail if the CI-build hasn't been completed. In this case, you can directly build to dist as the output directory with Unity Editor.

Place the two binaries in the exact path as visualized below:

./src
./dist
|   +-- 9c.(exe|app) // 9C Unity Player
|   +-- publish // 9C Headless (Standalone)
|   |   +-- Libpalnet.dll
|   |   +-- Grpc.Core.dll
|   |   +-- ...
|   |   +-- NineChronicles.Standalone.Executable(.exe)

After, run the following command.

npm run dev

Development

The basic frontend has webpack-hot-reload, which automatically reflects code changes. Developing the renderer process does not require electron relaunch. However, when there's a change in the main process, electron relaunch is required.

mobx-devtools

mobx-devtools can be used in this project. First, install a standalone mobx-devtools.

npm install -g mobx-devtools

After, run mobx-devtools.

mobx-devtools

Run npm run server & npm run start. The global state will appear on mobx-devtools.

Build

npm install
npm run build  # development build
npm run build-headless  # 9C Headless (Standalone) build (.NET Core SDK required)
npm run bundle-player  # 9C Unity Player download
APV_SIGN_KEY=... APV_NO=... npm run sign-apv  # APV sign (planet command required)
npm run build-prod  # production build

Packaging

# generate/sign a new APV with the given private key and pack
APV_SIGN_KEY=... npm run pack-all
# generate/sign a specific APV with the given private key and pack
APV_SIGN_KEY=... APV_NO=1234 npm run pack-all
# pack with the given APV
APV=... npm run pack-all
# pack without APV (for reusing the APV of the latest release)
npm run pack-all

Packaging requires the following environment variables. If both the APV and APV_SIGN_KEY are ommited, APV(App Protocol Version) signing will not take place.

Replacing config.json content after packaging

For replacing the configuration content of config.json in the already packed Windows.zip or macOS.tar.gz, it's convenient to use the scripts/extract-config.sh and scripts/replace-config.sh scripts.

# extract config.json content from package (supports Windows.zip and macOS.tar.gz)
scripts/extract-config.sh path/Windows.zip > config.json
# replace config.json content in package (supports Windows.zip and macOS.tar.gz)
scripts/replace-config.sh path/Windows.zip < config.json

Packaging with electron-builder

# Windows (nsis)
# macOS (dmg, zip)
npm run pack-all:electron-builder

Log Path

Logs are saved in the following paths:

- on macOS: ~/Library/Logs/{app name}/{process type}.log
- on Windows: %USERPROFILE%\AppData\Roaming\{app name}\logs{process type}.log

Code Style Formatting

npx pretty-quick --staged

Visual Studio Code Extensions

Install the following extensions in the Visual Studio Code extensions page(Windows: ⇧⌃X, macOS: ⇧⌘X):

About

Nine Chronicles Launcher

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 89.2%
  • JavaScript 5.0%
  • Shell 3.2%
  • PowerShell 1.5%
  • Other 1.1%