Coder Social home page Coder Social logo

xzandro / sw-exporter Goto Github PK

View Code? Open in Web Editor NEW
407.0 46.0 191.0 2.71 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.19% HTML 0.21% CSS 0.60%

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

Auto Updates

External plugins can utilize auto updates. Auto updates for plugins are only available if you pack your plugin as an asar file. You would need to add more information to your index.js file.

module.exports = {
  // ... other config
  version: '2.0.0',
  autoUpdate: {
    versionURL: 'https://example.com/latest.yml',
  },
};

version and autoUpdate.versionURL need to be present. Version follows the semver specs. autoUpdate.versionURL needs to be a valid URL, starting with https and ending with .yml.

The .yml file needs to have a specific schema.

version: 2.1.0
file: plugin-name.asar
url: https://example.com/plugin-name.asar
sha512: 1e2bb05da57d1ed20dcd751abcf670b67f6f848c9a3278b7a631e414b41545ac07fca47d5f8eeb638ea61047c54a45df16a0301079909e14ac362b6d264bb93b
size: 827
releaseDate: 2024-02-04T03:53:12.848Z

url needs to be valid, starting with https and ending with .asar. sha512 is basically that, sha512 hash represented as hex.

SWEX will call your .yml version file, looks up the versions, checks if the remote version is newer than the local one and then downloads the plugin itself. SWEX will also check the sha512 hash. If the hash of the downloaded file and the one from the .yml does not match, the plugin will not be updated.

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

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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sw-exporter's Issues

Are you going to implement a way to load custom plugins?

See title.
I wrote some custom-stuff for SW-Proxy mostly for guild-management(i have a script for example which logs automatically if someone of the guild got more than the 6 bonuspoints in guildwar) and i would like to migrate to your tool. I am new to javascript, nodejs and so on. I saw your post on reddit:

install node.js (v7.4.0)
git clone https://github.com/Xzandro/sw-exporter.git
npm install
npm run dev
npm start

Are you planning to do it like SWProxy in the future, so that you throw a script into a folder and it just works or will it always be it the way that you need to build it from scratch? If you are planning a custom plugin-system i am going to wait for that otherwise i am going to try it out the other way with a custom build.

Problems connecting to Wifi on device using http proxy

My first time trying to do this. I am using v0.0.17 on Mac. Firewall is deactivated.
When I try connecting on my phone (iOS), Wifi does alright UNTIL I enter proxy data (triple-checked correct IP and Port). After this the Wifi connection seems maintained, but I can't load any network features (let alone open the game).
Dont know whether this is relevant or not, but right now I am using a hotel wifi (which has that inconvenient login page). Both my mac and device were properly connected when I began.

Don't get the .json file on new account

I got SWEX working on previous accounts normally, but now with the new account I cannot.
I get all logs and no .json File even the app saved profile data.
The account its already with Hive, facebook and google synched.
Using the latest release on Mac.
On others accounts the file appears normally.

Sorry about English, its not my language.
Thanks

Game wont start

I'm using Iphone 5 and after enabling the proxy, the game would start with the com2us logo and for there just a black screen, only after i turn the proxy off it will start normal.

Proxy want start

IM using a emulator for summoners war. Can't get them to connect and finnaly got the port number for computer but now the proxy button will not work.

Switch for FullLogger

Can someone add a switch for deleting "full_log" on closing Summoners War Exporter?

Thx

Error Loggin In

When I set up the proxy and try to log on, I get Hive errors.

failed to load the page, please try again later

After setting my wifi settings to the one of sw exporter, i launch summoners war and click touch to start. Then, it leads me to this error screen that says Failed to load the page. Please try again later. Retry. On the top right there's back to game and top left it says hive.

Elemental Rift Dungeons not logging

I have switched from the SWProxy and I am not sure if I have something set wrong. It is logging all of my dungeon runs except for the Rift Dungeons. I am attaching a screenshot to show what I have checked in settings.

Do I need to change something?

settings

Rework plugin system

  • Plugins that are not in the same folder like the other electron files only have access to native node.js libs
  • Non-native plugins will not be found via require currently and are only available via parameters, not good!

Specify default network interface in options?

Not sure if this would be possible, but from having some virtual machine adapters, I'm always having to select from multiple IP addresses. Would be very nice if possible to set to always use a specific interface.

A JavaScript Error occured in the process - fixed? Nintendo Switch used proxy

Hello Xzandro,

great project here!
I love how handy this programm is compared to the problem haunted sw proxy, that I stopped using about 2 months ago and switched to your tool after over 1¼yeah of using the proxy.

This message occured now during playing, and will repeat all the time when confirmed:
screenshot_500

Any ideas?

(€dit: Maybe I should take a look if there is an Java Update available )

Best regards,
Hordil

Modify network connection

Hi, I'm having a problem getting my phone to accept the proxy information. I'm using a Samsung Note 3. I go into the networks Advanced Options, but as soon as i change the proxy from "none" to "manual," the save option greys out. No matter what information I fill into advanced options, It wont let me save it. Any fix for this?

I cant go in sw

when i run the proxy and start sw. hive pops up and say failed to log in.
may i know if i did anything wrong? previous version i used had no issues!

Forced Update Loop

When I try to use the exporter, summoners war says that "an update to the latest version is required.

My file is fully updated.

When I turn off the proxy, I can use summoners war fine.

Proxy issue

I set up the proxy on my iphone ip is set up as well port all correct i go to run game but it fails to connect as if the internet isnt there so idk what i have to do.

Rune CSV file

I liked the Runes and Monster CSV files that the SWProxy would export. Is it possible to have that with this as well?

Cannot pull account logs mac

Not sure how to pull the account logs. Seems like it should happen upon login but I'm not getting anything. I am able to log friend visits, dungeon runs, and black market just fine. This happening to anyone else? Please advise!

Using version 14 on Mac / iOS

Crafting runes causes an error message to pop up

Everytime you craft a rune ingame there is a short delay and almost instantly an error message pops up on SW Exporter saying:
image
Only tested it on fatal runes "high runes".

Sw Exporter throws the error but after clicking ok it still works and is still connected. The log says:
image

Proxy Not Working

I've been trying to set up the proxy for summoners war for a few days now, and it has not worked. Every time I have started the process, the proxy started up, my phone connected just fine, but when I try to startup summoners war it gives me an error that says it can't connect to host server or network delayed try again later. Please help me with this asap.

Enable "runs.csv" output from swproxy

One of the key components to an addon I was writing was the runes output, in the current format it's not easily possible to analyze the most recently dropped rune in the logs generated by this plugin.

Failure to run on ARM linux (rPi 2)

App threw an error during load Error: Cannot find module './binaries/key-linux-arm' at Module._resolveFilename (module.js:470:15) at Function.Module._resolveFilename (/home/pi/sw-exporter/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12) at Function.Module._load (module.js:418:25) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object.<anonymous> (/home/pi/sw-exporter/app/proxy/smon_decryptor.js:3:20) at Object.<anonymous> (/home/pi/sw-exporter/app/proxy/smon_decryptor.js:25:3) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) A JavaScript error occurred in the main process Uncaught Exception: Error: Cannot find module './binaries/key-linux-arm' at Module._resolveFilename (module.js:470:15) at Function.Module._resolveFilename (/home/pi/sw-exporter/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12) at Function.Module._load (module.js:418:25) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object.<anonymous> (/home/pi/sw-exporter/app/proxy/smon_decryptor.js:3:20) at Object.<anonymous> (/home/pi/sw-exporter/app/proxy/smon_decryptor.js:25:3) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32)

Not connecting

I've been using this for a while now but all of a sudden today my phone cannot connect to the proxy. The only thing different is that I am now using an iPhone. I've tried using the up address given from the exporter and my computers my. Is there any tips?

ProfileExport not exporting anything

Not getting an exported profile. I am getting activity in the full_log.txt, and ProfileExport is enabled.

I don't get any error pop-ups and am not seeing any errors in the full_log either.

Is there anything else I can do to troubleshoot ?

Javascript error, uncaught exception v0.0.14

This error is occuring in the Windows 64-bit portable exe.

[Main Instruction]
A JavaScript error occurred in the main process

[Content]
Uncaught Exception:
TypeError: "port" option should be a number or string: null
at lookupAndConnect (net.js:961:13)
at Socket.connect (net.js:939:5)
at Object.exports.connect.exports.createConnection (net.js:74:35)
at Server. (C:\Users\rmatt\AppData\Local\Temp\nsuE5E1.tmp\app\resources\app.asar\app\proxy\SWProxy.js:108:27)
at emitThree (events.js:116:13)
at Server.emit (events.js:194:7)
at onParserExecuteCommon (_http_server.js:459:14)
at onParserExecute (_http_server.js:418:3)

Javascript error dialog thrown occasionally

The following are thrown occasionally:
uncaught exception:
TypeError: Cannot read property 'crate' of undefined
at Object.logCraftRune
at Object.processCommand
at SWProxy.proxy.on

Not getting any files

Hello,

For the past few days since the update of summoners war (3.4.5), I am not being able to receive any information from the exporter. I configure my mobile (iOS iPhone 6) with the ip address and the port exactly matching the one that is written on the exporter, then i start the proxy. When the game is done loading I got nothing, the logs are just "now listening to the port..." and there are no profiles saved on my folder. I already reset my wifi and set the password again, typed the ip address and the port 50 times.

Please if someone could help.

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.