Giter Site home page Giter Site logo

atralupus / 9c-launcher Goto Github PK

View Code? Open in Web Editor NEW

This project forked from planetarium/9c-launcher

0.0 0.0 0.0 95.85 MB

Nine Chronicles Launcher

License: GNU General Public License v3.0

Shell 1.32% JavaScript 2.40% PowerShell 0.47% TypeScript 91.23% HTML 0.23% SCSS 4.36%

9c-launcher's Introduction

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.

yarn

In addition, there are two binaries required.

  • 9C Headless (Standalone): can be built with yarn build-headless (.NET Core SDK required)
  • 9C Unity Player (9c.exe/9c.app): can be downloaded with yarn bundle-player
    • yarn 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.

Before build 9C Headless and Unity Player, you should download these source from git submodule: git submodule update --recursive

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.

yarn dev

위 명령은 내부적으로 알아서 NineChronicles.Headless 서버도 함께 실행합니다.

별도로 띄워둔 NineChronicles.Headless 서버에 붙이고 싶을 경우, NC_RPC_SERVER_HOST, NC_RPC_SERVER_PORT, NC_GRAPHQL_SERVER_HOST, NC_GRAPHQL_SERVER_PORT 환경 변수를 활용할 수 있습니다. (넷 중 하나만 설정되어도 커스텀 RPC 서버 모드로 동작합니다.)

NC_RPC_SERVER_HOST=127.0.0.1 \
NC_RPC_SERVER_PORT=23142 \
NC_GRAPHQL_SERVER_HOST=127.0.0.1 \
NC_GRAPHQL_SERVER_PORT=23061 \
yarn 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.

yarn global add mobx-devtools

After, run mobx-devtools.

mobx-devtools

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

Build

git submodule update --recursive # Download 9C Headless and Unity Player build source

yarn
yarn build  # development build
yarn build-headless  # 9C Headless (Standalone) build (.NET Core SDK required)
yarn bundle-player  # 9C Unity Player download. if you not want to test game, you can skip this step.
APV_SIGN_KEY=... APV_NO=... yarn sign-apv  # APV sign (planet command required)
yarn build-prod  # production build

Packaging

# generate/sign a new APV with the given private key and pack
APV_SIGN_KEY=... yarn pack-all
# generate/sign a specific APV with the given private key and pack
APV_SIGN_KEY=... APV_NO=1234 yarn pack-all
# pack with the given APV
APV=... yarn pack-all
# pack without APV (for reusing the APV of the latest release)
yarn 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)
yarn 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):

9c-launcher's People

Contributors

akiacode avatar area363 avatar basixkor avatar boscohyun avatar cirnov avatar dahlia avatar dependabot[bot] avatar earlbread avatar greymistcube avatar ipdae avatar limebell avatar longfin avatar moreal avatar mu-hun avatar namyujeong avatar planet-submodule-updater avatar riemannulus avatar sonohoshi avatar unengine avatar youngkiu avatar ysjk2003 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.