haxball.js 1.0.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,14 +10,14 @@
10
10
 
11
11
  ### 🔖 Table Of Contents
12
12
 
13
- - 🤔 [How To Use](#how-to-use)
14
- - 🚀 [Technologies](#technologies)
15
- - 🌱 [Minimal Requirements](#minimal-requirements)
16
- - 🎊 [Features](#features)
17
- - 💡 [How To Contribute](#how-to-contribute)
18
- - 🤗 [Contributors](#contributors)
19
- - 👤 [Author](#author)
20
- - 🔏 [License](#license)
13
+ - 🤔 [How To Use](#how-to-use)
14
+ - 🚀 [Technologies](#technologies)
15
+ - 🌱 [Minimal Requirements](#minimal-requirements)
16
+ - 🎊 [Features](#features)
17
+ - 💡 [How To Contribute](#how-to-contribute)
18
+ - 🤗 [Contributors](#contributors)
19
+ - 👤 [Author](#author)
20
+ - 🔏 [License](#license)
21
21
 
22
22
  ---
23
23
 
@@ -34,32 +34,36 @@ npm install haxball.js
34
34
  ```js
35
35
  const HaxballJS = require("haxball.js");
36
36
 
37
- const room = new HaxballJS.Room({
38
- roomName: "Room Name",
39
- playerName: "Haxball.JS",
37
+ HaxballJS.then((HBInit) => {
38
+ // All is same as Haxball Headless Host Documentation
39
+ const room = HBInit({
40
+ roomName: "Haxball.JS",
40
41
  maxPlayers: 16,
41
42
  public: true,
42
- token: "token"
43
- });
43
+ noPlayer: true,
44
+ token: "TOKEN", // Required
45
+ });
44
46
 
45
- room.once("ready", (link) => {
46
- console.log(`Room created ${link}`);
47
- });
47
+ room.setDefaultStadium("Big");
48
+ room.setScoreLimit(5);
49
+ room.setTimeLimit(0);
48
50
 
49
- room.on("onPlayerChat", (player, message) => {
50
- if (message === "ping") {
51
- room.send("pong");
52
- }
51
+ room.onRoomLink = function (link) {
52
+ console.log(link);
53
+ };
53
54
  });
54
-
55
- room.create();
56
55
  ```
57
56
 
58
57
  ---
59
58
 
60
59
  <h2 id="technologies">🚀 Technologies</h2>
61
60
 
62
- - Puppeteer
61
+ - wrtc - WebRTC implementation for NodeJS
62
+ - ws - Websocket Connection
63
+ - JSON5 - JSON Helper Module
64
+ - @peculiar/webcrypto - Webcrypto implementation for NodeJS
65
+ - pako - ZLIP Port for NodeJS
66
+ - node-fetch - HTTP Requests
63
67
 
64
68
  [Back To The Top](#title)
65
69
 
@@ -67,8 +71,8 @@ room.create();
67
71
 
68
72
  <h2 id="minimal-requirements">🌱 Minimal Requirements</h2>
69
73
 
70
- - NPM
71
- - NodeJs
74
+ - NPM
75
+ - NodeJs
72
76
 
73
77
  [Back To The Top](#title)
74
78
 
@@ -76,9 +80,9 @@ room.create();
76
80
 
77
81
  <h2 id="features">🎊 Features</h2>
78
82
 
79
- - [x] Promise based
80
- - [x] Synchronous
81
- - [x] Performant
83
+ - [x] Promise based
84
+ - [x] Synchronous
85
+ - [x] Performant
82
86
 
83
87
  [Back To The Top](#title)
84
88
 
@@ -86,13 +90,13 @@ room.create();
86
90
 
87
91
  <h2 id="how-to-contribute">💡 How To Contribute</h2>
88
92
 
89
- - Make a fork of this repository
90
- - Clone to you machine and entry on respective paste
91
- - Create a branch with your resource: `git checkout -b my-feature`
92
- - Commit your changes: `git commit -m 'feat: My new feature'`
93
- - Push your branch: `git push origin my-feature`
94
- - A green button will appear at the beginning of this repository
95
- - Click to open and fill in the pull request information
93
+ - Make a fork of this repository
94
+ - Clone to you machine and entry on respective paste
95
+ - Create a branch with your resource: `git checkout -b my-feature`
96
+ - Commit your changes: `git commit -m 'feat: My new feature'`
97
+ - Push your branch: `git push origin my-feature`
98
+ - A green button will appear at the beginning of this repository
99
+ - Click to open and fill in the pull request information
96
100
 
97
101
  <p align="center">
98
102
  <i>Contributions, issues and features requests are welcome!</i><br />
@@ -117,17 +121,6 @@ room.create();
117
121
 
118
122
  ---
119
123
 
120
- <h2 id="author">👤 Author</h2>
121
-
122
- 🤓 **Mertushka <mertushkaonline@gmail.com>**
123
-
124
- - Instagram: [@mertushka](https://instagram.com/mertushka)
125
- - Github: [@mertushka](https://github.com/mertushka)
126
-
127
- [Back To The Top](#title)
128
-
129
- ---
130
-
131
124
  <h2 id="license">🔏 License</h2>
132
125
 
133
126
  Copyright © 2021 [Mertushka <mertushkaonline@gmail.com>](https://github.com/mertushka)
package/package.json CHANGED
@@ -1,39 +1,37 @@
1
1
  {
2
- "name": "haxball.js",
3
- "version": "1.0.3",
4
- "description": "A powerful library for interacting with the Haxball Headless API",
5
- "main": "src/index.js",
6
- "scripts": {
7
- "test": "echo 'who needs test when you can code' && exit 0",
8
- "lint": "npx eslint src test",
9
- "lint:fix": "npm run lint -- --fix",
10
- "prettier": "npx prettier src test --check",
11
- "prettier:fix": "npm run prettier -- --write",
12
- "format": "npm run prettier:fix && npm run lint:fix"
13
- },
14
- "keywords": [
15
- "haxball",
16
- "bot",
17
- "room"
18
- ],
19
- "author": "mertushka",
20
- "license": "MIT",
21
- "dependencies": {
22
- "@discordjs/collection": "^0.2.0",
23
- "puppeteer": "^10.1.0"
24
- },
25
- "devDependencies": {
26
- "eslint": "^7.31.0",
27
- "eslint-config-prettier": "^8.3.0",
28
- "prettier": "2.3.2",
29
- "prettier-eslint": "^12.0.0"
30
- },
31
- "repository": {
32
- "type": "git",
33
- "url": "git+https://github.com/mertushka/haxball.js.git"
34
- },
35
- "bugs": {
36
- "url": "https://github.com/mertushka/haxball.js/issues"
37
- },
38
- "homepage": "https://github.com/mertushka/haxball.js#readme"
2
+ "name": "haxball.js",
3
+ "version": "2.0.0",
4
+ "description": "A powerful library for interacting with the Haxball Headless API",
5
+ "main": "src/index.js",
6
+ "scripts": {
7
+ "test": "mocha --recursive --exit"
8
+ },
9
+ "keywords": [
10
+ "haxball",
11
+ "headless",
12
+ "bot",
13
+ "room"
14
+ ],
15
+ "author": "mertushka",
16
+ "license": "MIT",
17
+ "dependencies": {
18
+ "@peculiar/webcrypto": "^1.3.3",
19
+ "json5": "^2.2.1",
20
+ "node-fetch": "^2.6.6",
21
+ "pako": "^2.0.4",
22
+ "wrtc": "^0.4.7",
23
+ "ws": "^8.5.0"
24
+ },
25
+ "devDependencies": {
26
+ "mocha": "^9.2.2",
27
+ "node-pre-gyp": "^0.17.0"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/mertushka/haxball.js.git"
32
+ },
33
+ "bugs": {
34
+ "url": "https://github.com/mertushka/haxball.js/issues"
35
+ },
36
+ "homepage": "https://github.com/mertushka/haxball.js#readme"
39
37
  }