Code Monkey home page Code Monkey logo

cubic-server's People

Contributors

eldonad avatar emneo-dev avatar fluffyloafie avatar matthieu-sauer avatar pierrickmarguin avatar spectrapulse avatar stmiki avatar thomas-harit avatar trompettesib avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cubic-server's Issues

Block despawn

Version tested :

  • Beta 1

Steps :

  • Build something
  • Go away (300 blocks)
  • Come back

Issue :

  • All the placed block are no longer here.

Compression incompatibility with Krypton

The network compression introduced by #205 is currently not working when using the Krypton mod, why it is not working is unknown but it is working with any clients not using this mod.

Note: It might be worth testing cubic-server behind Velocity as Krypton uses their implementation of packet compression/decompression.

Key binding for the command textbox in the interface

For now, the binding of the 'Enter' key is to be fixed, as the binding works with other keys (such as 'Esc' key (current binding)). As sending commands with the 'Esc' key instead of the 'Enter' one is not user-friendly, a fix is needed.

BlockStates code generation

We need to generate some code to translate protocol ids to internal structures and vice versa, something like this :

#include <cstdint>
#include <unordered_map>
#include <string>

using namespace std;

enum class Blocks {
    MINECRAFT_ACACIA_PRESSURE_PLATE,
};

struct Block {
    Blocks type;
    SomeMapType properties;
    constexpr string toName() const {
        switch (this->type) {
        case Blocks::MINECRAFT_ACACIA_PRESSURE_PLATE:
            return "minecraft:acacia_pressure_plate";
        }
    }

    constexpr uint64_t toProtocol() const {
        switch (this->type) {
        case Blocks::MINECRAFT_ACACIA_PRESSURE_PLATE:
            if constexpr (this->properties == SomeMapType({
                {"powered", "true"}
                }))
                return 4186;
            if constexpr (this->properties == SomeMapType({
                {"powered", "false"}
                }))
                return 4187;
        }
    }
};

// "minecraft:acacia_pressure_plate": {
//     "properties": {
//       "powered": [
//         "true",
//         "false"
//       ]
//     },
//     "states": [
//       {
//         "id": 4186,
//         "properties": {
//           "powered": "true"
//         }
//       },
//       {
//         "default": true,
//         "id": 4187,
//         "properties": {
//           "powered": "false"
//         }
//       }
//     ]
//   },

Should be done next sprint

constexpr for packet parsing

Currently the code for parsing a packet is as follow

static const auto h = ParsePacket<Handshake>()
                              .prop<int32_t>(popVarInt, offsetof(Handshake, prot_version))
                              .prop<std::string>(popString, offsetof(Handshake, addr))
                              .prop<uint16_t>(popUnsignedShort, offsetof(Handshake, port))
                              .prop<int32_t>(popVarInt, offsetof(Handshake, next_state));

return h.parse(buffer);

What would be really nice is to find a way to make the parser creation completely at compile time, but I currently do not have the knowledge to do so.

The main problem would be the functions passed as parameters of prop, as the value of function pointers is determined at link time and not compile time, which fails the constexpr.

Embed JSON files inside the executable binary.

Heyo,

There's an issue with the binary, since it requires blocks-x.xx.x.json & registries-x.xx.x.json, where x.xx.x is the actual Minecraft version.

How about embeding those config files inside the binary so the user / sysadmin musn't move them into the workdir too?

Eventually look for those files in /usr/share/cubic-server if the above solution is impossible.

Encryption is extremely unreliable

It might work but if a lot of data has to be sent undefined behaviour starts to appear, from a client crashing to the whole server soft locking.

Here are some screenshots of it hapenning:

image
image
image
image
image
image

Quality of life changes

  • Add a simpler way to add a config entry
  • Logger - the code is... Well... Bad.
  • Player.cpp file LOL (>1k lines)
  • Force quit when smashing ctrl + c multiple times
  • Remove Global from identifier in types.hpp
  • Vector return reference on operator overlaod
  • Add logger level NETWORK and maybe DEV
  • Improve call to Message
  • Change where the soundSystem is tick
  • Make all enum streamable
  • Add a common header file for define used everywhere
  • Change the way the height map are calculated (do a new function set block without height map calculation and an other function update height maps)
  • Rework some function naming (Player.cpp playerPickupItem())

Sometimes the server might iterate over a client getting instantiated

In Server::_gameTick the server might iterate over a client that is getting instantiated which can result in a crash (You can trigger it pretty easily by removing the sleep in Server::_gameLoop).
Add a mutex on the client list might fix it, but that begs the question if we need a mutex for all the containers accessed from multiple threads... To be seen I guess

Crash on void linux+musl

Crash happening on master when starting software.

Compilation using cmake + g++12

Launch with no arguments (will investigate and try to fix the issue)

Accept ipv6 connections

Currently only ipv4 connections are accepted by the server, but it must also support ipv6

AUR package.

Heyo,

Is AUR package from cubic-server will be available in the future?

Proper argument parser

Currently there is one argument being parsed and it is the -h, it is using a simple strcmp but a whole argument parser would be better for future arguments.

ConfigHandler in case file does not exist

What the ConfigHandler has to do if the file does not exist ?
For now, it just print in std::cerr the error

Does it have to create a new file ?
Does it have to crash and tell the user that the file does not exist ?

Add caching for MojangAPI calls

We are currently calling the Mojang API like crazy while not caring for rate limits, this should be addressed at some point.

Workflows Name

Change the main "CMake" workflow to several workflows with explicit names

Server exits when config file is missing a line

If one of the required lines does not exist/is not filled out in the config file, the server stops with an exception thrown (and caught).
image
It would be better if the line was created with a default value, or at least the thrown exception would specify the missing line for the user to add it by hand.

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.