Code Monkey home page Code Monkey logo

n2's Introduction

n2

A collection of modules for building clientless applications for Realm of the Mad God.

CodeFactor Build Status

Contents

Foreword

This project is still in early development. First and foremost, this means that breaking changes are going to be quite common. While the project is still on v0, a breaking change will only constitute a minor version increment. When v1.0.0 is released, all breaking changes will go back to being a major version increment.

Being in early development also means that documentation (including usage guides) may not be as comprehensive until later in the development process.

As always, feel free to report bugs or submit feature requests on the GitHub issues page.

Installing

First, clone this repository.

git clone https://github.com/thomas-crane/n2

Change the current working directory of the console to the n2 folder.

cd n2

Then install the dependencies.

npm install

Building

npm run gulp

Note that if gulp-cli is globally installed, this, and subsequent mentions of npm run gulp can simply be replaced with

gulp

This will clean and rebuild all n2 modules. To rebuild or clean an individual module, its name can be provided in the build gulp script.

npm run gulp build:core

Will rebuild just the n2/core module.

Other gulp tasks

There are several other gulp tasks which the main build tasks are composed of.

gulp clean

Will delete the build artifacts in every module. A single module can be cleaned by providing its name, e.g. gulp clean:net.

gulp compile

Will compile all modules. Like the other commands, a single module can be compiled by using its name. e.g. gulp compile:common.

Note that because of dependencies, the build order is

  1. n2/common
  2. n2/net
  3. n2/updater & n2/core

n2/updater and n2/core are able to compile in parallel, however they both depend on n2/common and n2/net.

Each module, except for n2/updater, hs an npm script which is used to generate the index.ts files. It can be invoked by using

npm run index

From the module's root folder.

The gulp commands are mirrored in package.json to provide npm script commands to invoke the gulp tasks. This means that

  • npm run clean is the same as npm run gulp clean
  • npm run compile is the same as npm run gulp compile
  • npm run build is the same as npm run gulp build

The only difference is that module names cannot be provided with the npm script commands, e.g. npm run build:net will not work.

There are also a few other scripts in the package.json scripts,

  • npm run docs - This runs TypeDoc to generate the API documentation.
  • npm test - This runs all of the unit tests with Mocha.

Modules

n2 contains several modules which can be used separately or in combination with one another to build clientless applications.

The updater module contains a utility class for downloading assets, and extracting packet IDs from the game client.

The core module is a good starting point for a clientless application. It contains a lightweight client class which can be extended.

The net module contains all networking related code for clientless applications. This includes packets and a packet IO class.

The common module contains interfaces and other classes which are used throughout other n2 modules.

Use

Each module has its own readme where you will find more information about using the specific modules. As a brief overview,

  • n2/common contains the http and logger utilities, and a handful of interfaces and classes that represent RotMG entities.
  • n2/net contains all of the packets and networking code. This is a good starting point for applications with custom client implementations.
  • n2/updater contains an updater utility which can download the game assets and client, and extract the latest packet IDs.
  • n2/core contains several parser utitlities, and most importantly a lightweight client class. This class has bare minimum to stay connected, and a few convenient properties. It also contains extensions to this client through the stdlib.

Acknowledgements

This project uses the following open source software

n2's People

Contributors

thomas-crane avatar

Stargazers

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