Git Product home page Git Product logo

server's Introduction

Server

GitHub Workflow Status (with branch) GitHub last commit Jitpack CI Status

BlueDragon Logo

BlueDragon's Minestom implementation. It currently includes:

  • Creating isolated instances for different game types and modes
  • A modular system for adding functionality to games
    • This allows for a very high degree of code reusability and simplicity, and makes rapid prototyping of games very quick and easy.
  • System for handling player punishments
  • Database support linked to every Player using a player provider
  • Synchronization with other servers using gRPC messaging and a Mongo database
  • Routing players to the correct instance when they join
  • Separated, per-instance chat and tablist functionality
  • Basic commands

Minestom is a Minecraft server library targeted at developers. Their wiki is available here.

Usage

Build with ./gradlew build and run the JAR created at build/libs/Server-x.x.x-all.jar. Requires Java 21 or higher.

Development

This can be built as a docker container with the following command:

$ DOCKER_BUILDKIT=1 docker build -t bluedragonmc/server:testing .

This uses the Dockerfile in the current directory to build an image with the version string "testing". Note: A game named Lobby must be present for the server to run!

Environment variables:

  • PUFFIN_VELOCITY_SECRET - Your Velocity proxy forwarding secret (optional). If not specified, Mojang authentication will be enabled.
  • BLUEDRAGON_AGONES_HEALTHCHECK_INTERVAL_MS - The amount of time in between Agones healthcheck pings, in milliseconds.
  • BLUEDRAGON_AGONES_RESERVATION_TIME_MS - The amount of time in between Agones server reservations, in milliseconds.
  • BLUEDRAGON_AGONES_DISABLED - Disables Agones integration if set to any value.
  • BLUEDRAGON_ENV_TYPE - Set to "DEV" to enable development mode.
  • BLUEDRAGON_QUEUE_TYPE - Set to "IPC" to use Puffin or "TEST" for the TestQueue. If not present, a default value is inferred.
  • BLUEDRAGON_MONGO_CONNECTION_STRING - The connection string used to connect to MongoDB.
  • BLUEDRAGON_PUFFIN_HOSTNAME - The hostname used to connect to Puffin.
  • BLUEDRAGON_LUCKPERMS_HOSTNAME - The hostname used to connect to LuckPerms.
  • HOSTNAME - Used to determine the server name. Provided by default in Docker or Kubernetes environments.
  • SERVER_INSTANCE_MIN_INACTIVE_TIME - The amount of time that an instance must be inactive before it is cleaned up.
  • SERVER_INSTANCE_CLEANUP_PERIOD - The amount of time in between instance cleanup tasks.
  • BLUEDRAGON_PUFFIN_PORT - The port used to connect to Puffin. Defaults to 50051.
  • BLUEDRAGON_GRPC_SERVER_PORT - The port used to create a gRPC server. Defaults to 50051.

Tip

If you are running Puffin, Komodo, or multiple game server instances on the same machine without some kind of networking isolation, you must change the BLUEDRAGON_GRPC_SERVER_PORT environment variable for each server to prevent port conflicts.

Implementation

To learn how to integrate other server software with BlueDragon's systems, see the Integration Guide

Creating a Game

To learn how to create a game using this library, see our ExampleGame repository. It has guides and documentation for creating a simple game.

Project Structure

The project contains a common subproject, which is used by all games as an API to compile against. This subproject also contains many useful game modules that most games use.

The testing subproject contains testing fixtures and utilities for running automated tests.

The main subproject (in src/*) contains all the code necessary to start the server, load plugins, and connect with external services like databases and IPC/messaging systems. It also contains all the global commands and translations.

server's People

Contributors

ex4dev avatar fluxcapacitor2 avatar littlechest avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

server's Issues

Punishments System

Punishments will be stored in the database under each player's document. They are already serialized by the Punishment class in a list contained in every player's PlayerDocument.

Necessary features:

  • When the player joins, they should be checked for active bans and should not be able to login if they are banned. This should be implemented on the backend server and, eventually, the proxy as well.
  • Players should not be able to type in chat when they are muted, and they will be notified of their mute status and time remaining.
  • Players should be kicked from servers if their MongoDB document fails to load, and they should not be able to perform any actions until the data is loaded. There should also be some sort of ratelimit on fetching this data.
  • Players should be notified when they are punished with a chat message and title. They should also be able to check their punishment history using a command which opens a GUI listing their previous punishments, their reasons, durations, etc.

Commands to implement:

  • /ban <player> <time> <reason>
  • /mute <player> <time> <reason>
  • /kick <player> <reason> (These do not have to be logged)
  • /punishment list <player> - Lists the player's past punishments in a book or paginated chat message
  • /punishment view <id> - Displays a punishment's reason, timestamp, duration, user, and moderator given the punishment ID.
  • /punishment forgive <id> - Makes a punishment's effects go away for the player. This sets a flag on the punishment, but its duration is not changed and it is not removed from their record. Can be aliased to /unban, /unmute, etc

Useful integrations

  • Bans page on the BlueDragon website: ⏳️ Waiting on forums

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.