The first fully opensource Skyblock mod backend lol.

Related tags

Miscellaneous dws
Overview

DWS

The first fully opensource Skyblock mod backend lol.

Running

export BROADCAST_SECRET="supersecretkey"
export PORT="3000"
export HOST="0.0.0.0"
export DISCORD_PUBLIC_KEY=
export DISCORD_TOKEN=
export DISCORD_CLIENT_ID=
cargo run --release

Features

  • Discord bot
  • Cosmetics
  • Checking if players are online
  • Irc
  • Prometheus metrics
  • Discord linking
  • Admin dashboard

Rest

GET /cosmetics

{
  "cosmetics": [
    {
      "data": "&a",
      "description": "Prefix: invis_test1",
      "id": 0,
      "name": "invis_test1",
      "required_flags": 2,
      "type": 1
    },
    {
      "data": "§e",
      "description": "Prefix: supporter2",
      "id": 1,
      "name": "supporter2",
      "required_flags": 32,
      "type": 1
    },
    {
      "data": "§b[l'élite]",
      "description": "Prefix: invis_plexus3",
      "id": 2,
      "name": "invis_plexus3",
      "required_flags": 2,
      "type": 2
    }
  ],
  "users": { "41a9b6aa-168a-4be8-8df8-cac17daf7384": 1 }
}

POST /broadcast

info this is a dashboard endpoint

to requires a list of uuids or nothing to send to all users.

{
  "message": "Hello world",
  "to": []
}

Ok

GET /metrics

info this is a dashboard endpoint

Returns a bunch of prometheus metrics

GET /users

info this is a dashboard endpoint

Returns the list of connected and saved user

DELETE /users?uuid=$uuid

info this is a dashboard endpoint

Deletes a user from the database

POST /users

info this is a dashboard endpoint

Create & Edit a user, payload: https://github.com/dg-continuum/dws/blob/master/src/admin/users.rs#L13-L20

GET /cosmetics

info this is a dashboard endpoint

Returns the list of cosmetics

DELETE /cosmetics?id=$id

info this is a dashboard endpoint

Deletes a cosmetic from the database

POST /cosmetics

info this is a dashboard endpoint

Creates a cosmetic, payload: https://github.com/dg-continuum/dws/blob/master/src/admin/cosmetics.rs#L11-L20

Websockets

See the insomnia example for more detailed info, Nonces are a optional field

Connecting

for development none of this validated. server_id is expected to be a hashed server id that is needed for https://wiki.vg/Protocol_Encryption#Authentication

{
  "t": "/connect",
  "c": {
    "server_id": "Hello world from irc ws lol",
    "username": "trickedmc"
  }
}

{
  "t": "/connected",
  "c": true
}

Requesting user status

{
  "t": "/is_online",
  "c": { "uuid": "41a9b6aa-168a-4be8-8df8-cac17daf6324", "nonce": "HI!" }
}

{
  "t": "/is_online",
  "c": {
    "is_online": true,
    "uuid": "41a9b6aa-168a-4be8-8df8-cac17daf6324",
    "nonce": "HI!"
  }
}

Requesting user status bulk

{
  "t": "/is_online/bulk",
  "c": { "uuids": ["41a9b6aa-168a-4be8-8df8-cac17daf6324"], "nonce": "HI!" }
}

{
  "t": "/is_online/bulk",
  "c": {
    "users": {
      "41a9b6aa-168a-4be8-8df8-cac17daf6324": true
    },
    "nonce": "HI!"
  }
}

Pings

{
  "t": "/ping"
}

{
  "t": "/pong"
}

Update cosmetic

{
  "t": "/cosmetics/update",
  "c": {
    "cosmetic_id": 1,
    "nonce": "hi1"
  }
}

{
  "t": "/cosmetics/updated",
  "c": {
    "cosmetic_id": 1,
    "nonce": "hi1"
  }
}

Cosmetic Ack event

It is suggested to update cosmetics between 1-5 minutes after this event is received to account for any other updates and to not trigger ddos protection.


{
  "t": "/cosmetics/ack"
}

Irc

The irc chat can be linked to discord and you can blacklist uuids from the irc using /irc blacklist Add <uuid>, if a user is blacklisted irc messages send by this user will be silently ignored.

{
  "t": "/irc/create",
  "c": {
    "message": "HI!"
  }
}

{
  "t": "/irc/created",
  "c": {
    "message": "HI!",
    "sender": "41a9b6aa-168a-4be8-8df8-cac17daf7384",
    "date": 1668109163235
  }
}

Broadcasts

Broadcasts are only received not send you can view the broadcast post request to find out how those work


{
  "t": "/broadcast",
  "c": "Hello world"
}

Errors

Errors are only recieved and look like this, errors can include a nonce for when necessary


{
  "t": "/error",
  "c": {
    "error": "Already connected"
  }
}

Cosmetics

A cosmetics file looks something like this, The ran instance uses type 1 to identify colors and type 2 prefixes

{
  "cosmetics": [
    {
      "data": "&a",
      "description": "Prefix: invis_test1",
      "id": 0,
      "name": "invis_test1",
      "required_flags": 2,
      "type": 1
    },
    {
      "data": "§e",
      "description": "Prefix: supporter2",
      "id": 1,
      "name": "supporter2",
      "required_flags": 32,
      "type": 1
    },
    {
      "data": "§b[l'élite]",
      "description": "Prefix: invis_plexus3",
      "id": 2,
      "name": "invis_plexus3",
      "required_flags": 2,
      "type": 2
    }
  ],
  "users": {
    "a1937b73-ecff-4d6c-aa7b-6702b957dbd6": {
      "flags": 8,
      "enabled_prefix": 8
    },
    "4e29caf5-9317-454b-8863-eca22877e0ec": {
      "flags": 8,
      "enabled_prefix": 12
    }
  }
}

Dashboard

DWS has a simple dashboard that is enabled by default and on the next port the websocket/api is running this dashboard can be disabled by setting the ADMIN_DASH var to false, It is not secured you are supposed to secure it with nginx or cloudflare zero trust. The dashboard also exposes 4 api endpoints for creating/modifying users, deleting them, and adding cosmetics and deleting those.

image

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. To test out the websocket server you can use either insomnia or the provided test.ts tool with Deno, The tool automatically picks up the requests from the README file.

License

We use the Mozilla Public License 2.0. MPL tries to find a balance between permissive (MIT, Apache, Zlib) and copyleft licenses (GPL, LGPL). MORE INFO

You might also like...
A backend API starter with Rust & postgres

Rust backend starter Rust backend starter with OpenAPI spec & swagger with rocket_okapi

A Litecord compatible/inspired OSS implementation of Discord's backend for fun and profit.

A Litecord compatible/inspired OSS implementation of Discord's backend for fun and profit.

A boilerplate++ for a minimal rust web backend

Boiler room A boilerplate++ for a minimal rust web backend Just fork/clone/download this repo and build your backend on it. Why? Both routing and erro

A complete, rate-limiting, asynchronous Rust wrapper of the Hypixel Public API with extensive SkyBlock support

rs-pixel   A complete, rate-limiting, asynchronous Rust implementation of the Hypixel Public API with extensive SkyBlock support. [dependencies] rs-pi

Opensource diagnostic software for Daimler vehicles, inspired by Xentry and DAS, written in Rust

OPENSTAR An opensource diagnostic application for Daimler vehicles inspired by DAS and Xentry. Some of the work here is based on OpenVehicleDiag If yo

Download Apple's open source code from opensource.apple.com

Apple Open Source Downloader This repository defines a Rust crate and CLI program to automate the downloading of Apple's open source code from https:/

TIF is a terminal_image_format. (theres no TIF editor, so i made TIF images through a hex editor lol)

Colors these are the colors you can use when displaying images on the terminal BYTES: 5A = BLUE 5B = BLACK 5C = RED 5D = GREEN 5E = PURPLE 5F = WHITE

quiz app? i dunno lol

quiz it's all kinda shoddy right now but, assuming sqlx cli is installed, and npm on lts or something recent-ish cd api docker-compose up -d sqlx data

Memory.lol - a tiny web service that provides historical information about social media accounts

memory.lol Overview This project is a tiny web service that provides historical information about social media accounts. It can currently be used to l

🔍 Fully-featured metrics collection agent for First Tech Challenge competitions. Supports Prometheus.

Scout Scout is a fully-featured free and open source metrics collector for FTC competitions. The project is licensed under the GNU LGPLv3 license. Fea

A render-backend independant egui backend for sdl2

A Sdl2 + Egui Backend An egui backend for sdl2 unbound to any renderer-backend. You can include it like so: [dependencies] egui_sdl2_platform = "0.1.0

⚙️ Workshop Publishing Utility for Garry's Mod, written in Rust & Svelte and powered by Tauri
⚙️ Workshop Publishing Utility for Garry's Mod, written in Rust & Svelte and powered by Tauri

⚙️ gmpublisher Currently in Beta development. A powerful and feature-packed Workshop publisher for Garry's Mod is finally here! Click for downloads Ar

🐱‍👤 Drop-in HTTP replacement module for Garry's Mod

🐱‍👤 gmsv_reqwest This module is a drop-in replacement for Garry's Mod's HTTP function, inspired by gmsv_chttp created by timschumi. The module uses

⚡ Garry's Mod module that boosts performance by moving -condebug file I/O to a separate thread

This is a Garry's Mod server module that moves -condebug file I/O out of the main thread, which should significantly improve performance for noisy servers.

📦 Pack hundreds of Garry's Mod Lua files into just a handful
📦 Pack hundreds of Garry's Mod Lua files into just a handful

📦 gluapack gluapack is a program that can pack hundreds of Garry's Mod Lua files into just a handful. Features Quick, easy and portable - perfect for

A swiss army knife for creating binary modules for Garry's Mod in Rust.

A swiss army knife for creating binary modules for Garry's Mod in Rust.

🐱‍👤 Cross-language static library for accessing the Lua state in Garry's Mod server plugins

gmserverplugin This is a utility library for making Server Plugins that access the Lua state in Garry's Mod. Currently, accessing the Lua state from a

A very simple Among Us mod launcher

Sussy Launcher ඞ A very simple mod launcher/loader for the game Among Us (Also referred to as Amogus ඞ). This Project is written with the Rust program

🌈 Brings back colour console to Win64 for Garry's Mod SRCDS
🌈 Brings back colour console to Win64 for Garry's Mod SRCDS

🌈 gmsv_concolormsg This module for Garry's Mod fixes x86-64 Windows 64-bit SRCDS not displaying colours. Why does it do that? Who knows! But it's eas

Owner
null
Download Apple's open source code from opensource.apple.com

Apple Open Source Downloader This repository defines a Rust crate and CLI program to automate the downloading of Apple's open source code from https:/

Gregory Szorc 6 Aug 19, 2022
Memory.lol - a tiny web service that provides historical information about social media accounts

memory.lol Overview This project is a tiny web service that provides historical information about social media accounts. It can currently be used to l

Travis Brown 317 Jul 12, 2023
A Garry's Mod module that lets you check which fonts are available on the system

gm_fontsx Since apparently we're never getting a proper way to check for installed fonts on Garry's Mod, this has to exist ?? Usage require("fontsx")

Earu 4 Mar 14, 2022
A simple, fast and fully-typed JSPaste API wrapper for Rust

rspaste A simple, fast and fully-typed JSPaste API wrapper for Rust. aidak.tk » Installation Put the desired version of the crate into the dependencie

Aidak 2 May 17, 2022
Shows only the first page of rustc output

cargo-first-page Shows only the first page of rustc output. Installation cargo install cargo-firstpage Usage Prefix the cargo command by firstpage: T

Cecile Tonglet 11 Dec 19, 2021
Try to find the correct word with only first letter and unknown letter count

Try to find the correct word with only first letter and unknown letter count

Alexandre 6 Apr 11, 2022
First Git on Rust is reimplementation with rust in order to learn about rust, c and git.

First Git on Rust First Git on Rust is reimplementation with rust in order to learn about rust, c and git. Reference project This project refer to the

Nobkz 1 Jan 28, 2022
The most primitive and the fastest implementation of a fixed-size last-in-first-out stack on stack in Rust, for Copy-implementing types

This is the simplest and the fastest (faster than Vec!) implementation of a last-in-first-out stack data structure, on stack, when stack elements are

Yegor Bugayenko 10 Jun 18, 2023
unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.

unflow 是一个低代码、无代码设计语言。unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.

Inherd OS Team (硬核开源小组) 70 Nov 27, 2022
The 峨眉 (EMei) JIT/AOT backend framework.

emei The 峨眉 (EMei) JIT/AOT backend framework. Support Instructions x86_64 mov mov mov_zero_extend_bit8/16 mov_sign_extend_bit8/16/32 mov_rev movs(is m

Lyzh 14 Apr 11, 2022