Giter VIP home page Giter VIP logo

modcolle-port's Introduction

Modcolle Port Build Status

Modcolle does not encourage botting or cheating Kancolle by any means. Modcolle aims to resolve common frustrations for both old and new players and to enhance user expierence. Modcolle does not intend to compete with other Kancolle viewers as they solve a different problem entirely, but to run in harmony among those viewers.

A microservice of Modcolle provides value of api_port back to a client. When accessing Port page, client doesn't have to adjust their machine time to match with Japan timezone (Asia/Tokyo UTC+09). api_port is a seemingly random signature of numbers created by Kancolle Dev to prevent botting and cheating. This signature, however, prevent players who doesn't have their clock synchronized with Japan timezone from accessing Kancolle API api_port/port endpoint. They will receive catbomb over and over again.

Modcolle doesn't care how Kancolle's api_port signature system is implemented. It only calls Kancolle's internal actionscript method which is responsible for generating the signature through custom written scripts. The script will be injected to Core.as inside Core.swf on Docker deployment.

Signature changes when there is a new release happened during Kancolle maintenace. Modcolle Port doesn't handle this situation yet, but will do in a future release.

Installation

Deploying on Docker

In this repository, run

docker build -t port .

Then, run the image expose port 5000

docker run -d -p 5000:5000 --name modcolle-port port

Let's call its API. In the browser type

http://localhost:5000/act?role=api_port&cmd=calculate&memberId=123456

You will get a JSON response. The value varies

{"api_port":"414563189173858047892811761507"}

Developing locally

If you prefer not to use docker, you can install it manually. You can follow scripts defined in .travis.yml or Dockerfile if you are on a Linux Ubuntu machine. If you are running on Windows or other Linux distros, please follow these steps

Prerequisites

You need

Inject Core.swf

  1. Download Core.swf from any Kancolle server
  2. Launch FFDec, go to settings -> Advance Settings -> Paths -> Flex SDK directory path point path to any existing empty folder
  3. Go to %AppData%\Macromedia\Flash Player\macromedia.com\support\flashplayer\sys (windows) ~/Macromedia/Flash_Player/macromedia.com/support/flashplayer/sys (linux) and paste settings.sol inside. This allows any swf file to make http request from your machine. If you are concerned about flash security, please configure flash player to trust bin/Core.swf
  4. Open command line, go to this repo inside build, and run inject-core.bat <path-core-swf> <path-ffdec> replace <path-core-swf> with absolute path to Core.swf and <path-ffdec> with absolute path to FFDec. For example local-dev.bat "C:\Core.swf" "C:\Program Files\FFDec". Injected Core.swf will appear inside the bin folder.

Install Application's dependencies

npm install

Starting Application

If you don't have pm2, please install

npm install -g pm2

Run

pm2 start process.yml

Testing

You have to set environment variables first before testing

PORT=5000 ETIMEOUT=5000 FLASH_PLAYER=bin/flashplayerdebugger KANCOLLE_CORE_SWF=bin/Core.swf TIMEZONE=Asia/Tokyo DEBUG=modcolle:* npm run test

Environment Variables

Can be configured inside process.yml

  • PORT exposed port number
  • ETIMEOUT operation timeout in milliseconds
  • FLASH_PLAYER path to flashplayer
  • KANCOLLE_CORE_SWF path to decoded and injected Core.swf
  • TIMEZONE IANA timezone
  • DEBUG shows debug info according to npm debug package

modcolle-port's People

Contributors

makemek avatar

Watchers

 avatar  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.