Coder Social home page Coder Social logo

rkh-leung / sw-exporter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xzandro/sw-exporter

1.0 1.0 0.0 3.14 MB

This tool will parse intercepted data from Summoners War and extract information on the monsters and runes of the user.

License: Apache License 2.0

JavaScript 99.06% HTML 0.24% CSS 0.70%

sw-exporter's Introduction

Summoner's War Exporter

This tool will parse intercepted data from Summoner's War and extract information on the monsters and runes of the user. It works just like SWProxy and the focus was to write a smooth proxy, that runs fast and to fix common glitches with SWProxy (SW starting problems, errors on event pages etc.). You can even turn on Summoners War Exporter for normal surfing, because it doesnt really influence other pages much.

swex

Downloading and Installation

  1. Go to the latest release.
  2. Download the package for your computer OS. Windows also offers a portable version which does not require installation.
  3. Run it!

Further instructions are available in the Help section of Summoner's War Exporter

Developing Plugins

You can create your own plugins that will receive in-game events and data. What you do with that data is up to your imagination. There are two options for creating a plugin - a single javascript file, or a full NPM package. Your plugin must export the following by default:

module.exports = {
  defaultConfig: {
    enabled: true,
    // any other options for your plugin here
    // Must be simple value types - string, number, boolean
  },
  defaultConfigDetails: {
    // Provides some customization for the form input. Match keys from defaultConfig
  },
  pluginName: <string>,
  pluginDescription: <string>,
  init: function(proxy, config)
}

The NodeJS 10 standard library is available to use within your plugin. To receive game events, you must subscribe to events from proxy. See the example plugin for the two options to receive events - every game event, or specific events. proxy is an EventEmitter. config is the configuration for the full SW-Exporter application. You can access your specific plugin's configuration like this: config.Config.Plugins[<pluginName>]. When in doubt, browse through the prepackaged plugins for examples.

Single Javascript File

The example plugin details a barebones plugin with no external dependencies.

Full NPM package

See this example repo for a plugin that requires the request module as a dependency to do something. As long as your package's default export matches the form specified above, you can do anything you like within your package, including external dependencies. These dependencies must be in a node_modules folder within your plugin directory. The full file structure would look something like this:

> Summoners War Exporter Files\plugins\my-fancy-plugin
> Summoners War Exporter Files\plugins\my-fancy-plugin\index.js
> Summoners War Exporter Files\plugins\my-fancy-plugin\other-plugin-code.js
> Summoners War Exporter Files\plugins\my-fancy-plugin\node_modules

Packaging

You can place your plugin as a folder of files in the plugins directory and it will work. However, it is recommended for distribution to package your plugin as an asar file.

To correctly package your plugin, run $ asar pack <plugin-folder-name> <plugin-name>.asar. Your asar archive should include all of your javascript code files and a node_modules folder with your dependencies. To install your packaged plugin, simply drop the plugin.asar into the plugins folder. The directory structure will look like this:

Summoners War Exporter Files\plugins\my-fancy-plugin.asar

Developing SW-Exporter

Install node.js.

$ git clone https://github.com/Xzandro/sw-exporter.git
$ cd sw-exporter
$ npm install
$ npm run dev
$ npm start

And you are ready to develop. We use ESLint for linting so make sure there are no linting errors before you submit a PR please.

Building Packages

At first you need to keep in mind that you can only build packages for your current used OS!

It is also important that the bundle.js is generated & update-to-date. You can accomplish that via

$ npm run dev

to start the Development script or just do

$ webpack

After that you have several possibilities.

Windows

For Windows you can build a Portable or Setup version (default: Both will build). That's changeable via the package.json.

"win": {
  "target": [
    "nsis"
  ]
}

Just change nsis to portable.

Building the packages (ia32 & x64 will be included in one executable automatically)

$ npm run dist

Linux

An AppImage & snap package file will be build which is compatible with most common linux os.

$ npm run dist

Mac

A typical DMG package file and a zip file will be build.

$ npm run dist

Setting up on a VPS

Basically the same like for the Development environment, but you need to set two process enrionment variables:

  1. port (set this to your liking)
  2. autostart (set this to true or 1, so that the proxy will start automatically)

Make sure you open the specific port in your firewall. This isnt ideal, because the UI, chromium, electron and the frontend will be loaded regardless. It's the best we can get without splitting off electron though.

sw-exporter's People

Contributors

xzandro avatar peteandersen avatar fabulouscupcake avatar dependabot[bot] avatar lanthos avatar yahehe avatar demonskye avatar chinleung avatar claytondaley avatar eytanmorg avatar hugoj-goncalves avatar kmorton1988 avatar psifour avatar quatzo avatar fnk93 avatar mskato avatar

Stargazers

Roman avatar

Watchers

James Cloos 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.