Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0.3 #9

Merged
merged 5 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
![GrowtopiaJS](/assets/images/banner.png)
![Github Stars](https://img.shields.io/github/stars/StileDevs/growtopia.js?style=flat-square&link=https%3A%2F%2Fgithub.com%2FStileDevs%2Fgrowtopia.js)
![NPM Version](https://img.shields.io/npm/v/growtopia.js?style=flat-square&link=https%3A%2F%2Fnpmjs.com%2Fpackage%2Fgrowtopia.js)
![NPM Downloads](https://img.shields.io/npm/dw/growtopia.js?link=https%3A%2F%2Fnpmjs.com%2Fpackage%2Fgrowtopia.js&color=blue)
![NPM Minified](https://img.shields.io/bundlephobia/min/growtopia.js?style=flat-square&link=https%3A%2F%2Fnpmjs.com%2Fpackage%2Fgrowtopia.js&color=blue)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/StileDevs/growtopia.js/CI.yml?branch=main&link=https%3A%2F%2Fgithub.com%2FStileDevs%2Fgrowtopia.js%2Factions)

![Github Version](https://img.shields.io/github/package-json/v/jadlionhd/growtopia.js?style=flat-square)
![NPM Version](https://img.shields.io/npm/v/growtopia.js?style=flat-square)
![NPM Minified](https://img.shields.io/bundlephobia/min/growtopia.js?style=flat-square)

A Node.js & Bun.js ENet framework to create growtopia private server that written in Rust.
A Rust based, cross-platform, high-performance Growtopia private server ENet framework utilizing Node.js, Bun.js.

## Features

Expand All @@ -20,11 +21,12 @@ npm i growtopia.js
## Example

```js
import { Client, TextPacket, Peer } from "growtopia.js";
const { Client, TextPacket, Peer } = require("growtopia.js");

const client = new Client({
enet: {
ip: "0.0.0.0"
ip: "0.0.0.0",
port: 17091
}
});

Expand All @@ -46,10 +48,10 @@ client.on("disconnect", (netID) => {
console.log(`Disconnected netID ${netID}`);
});

client.on("raw", (netID, data) => {
client.on("raw", (netID, channelID, data) => {
const peer = new Peer(client, netID);
console.log("raw", data);
console.log(peer.ping, peer.state);
console.log(peer.enet.address, peer.port);
});

client.listen();
Expand Down
Binary file modified assets/images/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 8 additions & 15 deletions docs/assets/highlight.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@
--dark-hl-1: #D4D4D4;
--light-hl-2: #A31515;
--dark-hl-2: #CE9178;
--light-hl-3: #AF00DB;
--dark-hl-3: #C586C0;
--light-hl-4: #001080;
--dark-hl-4: #9CDCFE;
--light-hl-5: #0000FF;
--dark-hl-5: #569CD6;
--light-hl-6: #0070C1;
--dark-hl-6: #4FC1FF;
--light-hl-3: #0000FF;
--dark-hl-3: #569CD6;
--light-hl-4: #0070C1;
--dark-hl-4: #4FC1FF;
--light-hl-5: #001080;
--dark-hl-5: #9CDCFE;
--light-hl-6: #098658;
--dark-hl-6: #B5CEA8;
--light-hl-7: #000000FF;
--dark-hl-7: #D4D4D4;
--light-hl-8: #098658;
--dark-hl-8: #B5CEA8;
--light-code-background: #FFFFFF;
--dark-code-background: #1E1E1E;
}
Expand All @@ -30,7 +28,6 @@
--hl-5: var(--light-hl-5);
--hl-6: var(--light-hl-6);
--hl-7: var(--light-hl-7);
--hl-8: var(--light-hl-8);
--code-background: var(--light-code-background);
} }

Expand All @@ -43,7 +40,6 @@
--hl-5: var(--dark-hl-5);
--hl-6: var(--dark-hl-6);
--hl-7: var(--dark-hl-7);
--hl-8: var(--dark-hl-8);
--code-background: var(--dark-code-background);
} }

Expand All @@ -56,7 +52,6 @@
--hl-5: var(--light-hl-5);
--hl-6: var(--light-hl-6);
--hl-7: var(--light-hl-7);
--hl-8: var(--light-hl-8);
--code-background: var(--light-code-background);
}

Expand All @@ -69,7 +64,6 @@
--hl-5: var(--dark-hl-5);
--hl-6: var(--dark-hl-6);
--hl-7: var(--dark-hl-7);
--hl-8: var(--dark-hl-8);
--code-background: var(--dark-code-background);
}

Expand All @@ -81,5 +75,4 @@
.hl-5 { color: var(--hl-5); }
.hl-6 { color: var(--hl-6); }
.hl-7 { color: var(--hl-7); }
.hl-8 { color: var(--hl-8); }
pre, code { background: var(--code-background); }
10 changes: 5 additions & 5 deletions docs/classes/Client.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/classes/Host.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/classes/ItemsDat.html

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/classes/Peer.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/classes/TankPacket.html

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/classes/TextPacket.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/classes/Variant.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/enums/PacketTypes.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/enums/VariantTypes.html

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions docs/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/Caching.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/ClientOptions.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/ENetServerOptions.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/ItemDefinition.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/ItemsDatMeta.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/LoginInfo.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/NativePeerData.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/PeerData.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/StringOptions.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/Tank.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/VariantOptions.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/VariantTypeBase.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/VariantTypeFloat.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/VariantTypeNumber.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/VariantTypeString.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/Sendable.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Sendable | growtopia.js</title><meta name="description" content="Documentation for growtopia.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">growtopia.js</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">growtopia.js</a></li><li><a href="Sendable.html">Sendable</a></li></ul><h1>Type Alias Sendable</h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">Sendable</span><span class="tsd-signature-symbol">:</span> <br/><span>    </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">Buffer</span><br/><span>    </span><span class="tsd-signature-symbol">| </span><a href="../classes/TextPacket.html" class="tsd-signature-type tsd-kind-class">TextPacket</a><br/><span>    </span><span class="tsd-signature-symbol">| </span><a href="../classes/TankPacket.html" class="tsd-signature-type tsd-kind-class">TankPacket</a><br/><span>    </span><span class="tsd-signature-symbol">| </span><a href="../classes/Variant.html" class="tsd-signature-type tsd-kind-class">Variant</a></div><div class="tsd-comment tsd-typography"><p>Represents the available type of Objects that are sendable to peers.</p>
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StileDevs/growtopia.js/blob/ff79f9dda886c4f7406dfe3a010381a36be678b5/types/index.d.ts#L160">types/index.d.ts:160</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>growtopia.js</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StileDevs/growtopia.js/blob/d1719ba47e0ef316a6a20fe65034635b5423a327/types/index.d.ts#L160">types/index.d.ts:160</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>growtopia.js</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
Loading