Giter Club home page Giter Club logo

mirai's People

Contributors

dependabot[bot] avatar meteoroidshot avatar radiatedmonkey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

radiatedmonkey

mirai's Issues

Replace lazy_static

The lazy_static crate is deprecated and should be replaced with std::sync::OnceLock.

Acknowledgement batching

Acknowledgements should be batched instead of sending a separate acknowledgement for each received reliable packet.

Client-bound packet fragmentation

Currently the server does not support spitting packets yet. This should be supported when the server starts sending chunk packets.

Incorrect checksums for split packets

When packets are fragmented due to them exceeding the MTU, the encryption checksums will no longer be correct. This causes Minecraft to get stuck on the "locating server" screen when the server attempts to send a CreativeContent packet.

I have suspicions that this is related to either data not being split correctly, therefore becoming corrupted when reassembling compounds, or the send counter not being incremented properly.

It is also possible that every packet fragment needs to be encrypted separately, but this seems unlikely since it would interfere with the RakNet implementation.

Snappy compression

The server currently only supports Deflate compression. Snappy is another supported algorithm in the protocol, it should be implemented.

`StartGame` is not fully implemented

Since the codebase switched to using the new BinaryWrite and BinaryRead traits and removed the old NBT serialiser, the StartGame packet hasn't been fully implemented.

This packet needs to be implemented to complete the rest of the login sequence.

Typos in documentation

Describe the bug
There are several typos in the documentation of some types and methods. For example, it seems like a search and replace may have replaced a lot of occurrences of "packets" with "raknet" instead.

Implement a general `nbt::Value` type

Some NBT types don't have clearly defined structures. The BlockStates type in pyro_level is an example of this. Instead of storing every single possible key, there should be some general nbt::Value type that can be stored in a map.

Spawn a new task for every received packet

Currently a single task handles the received packets in serial. This completely freezes processing a for a single client if some packet takes long to process, therefore a new task should be spawned for every received packet. The downside I see to this is that this might not preserve ordering of packets, due to the unpredictable nature of multithreading.

The RakNet layer could keep using a single task for processing as I don't see any issues with that and no packets take a long time to process since it's all just preprocessing anyways.

Decrease shared state

Decrease the amount of shared state in the server and instead use smaller workers with messaging channels. Since the Raknet and Bedrock separation, this has already been partially implemented for the clients.

An example I also thought of is getting rid of the Arc that currently wraps a user and send commands to the session instead of calling its functions directly.

LevelDB FFI errors unsound

Often when an error occurs with the database, complete garbage will be printed to the terminal. I assume this has to do with a bug in how the errors are translated and passed to Rust

Adjust README to include contribution and changes

Describe the bug
Since the removal of the Redis replication layer, the build and run instructions in the README are outdated. The Docker compose command will not work because the compose file has been removed. And it is no longer necessary to set up Redis.

Additionally, a call for contribution should be added and a list of contributors can be added to the bottom to reward contributors.

Resource pack support

Add support for resource packs by properly implementing ResourcePacksInfo, ResourcePackStack and ResourcePackClientResponse.
Currently the server skips most of this.

The implementation for this should also include a fix for the unexpected packet issue. Currently the server assumes it will receive a cache status packet while sometimes the client may send a resource pack response instead.

Disconnect client on version mismatch

The client sends its protocol version in the RequestNetworkSettings packet.
If this version does not match the server's, the client should be disconnected using a PlayStatus packet.

Encryption

Implement packet encryption and decryption

Memory arenas/pools

Instead of performing many allocations, memory should be stored in some kind of arena or pool

Identity data does not exist when it should

Sometimes connecting fails with the following error:

thread '[5]' panicked at core\src\network\user.rs:304:29:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This only seems to happen when the client for some reason fails to connect the first time and then you try to connect again. I assume this might be caused by Minecraft trying to continue where it left off previously (in this case it didn't manage to send the login packet) instead of fully reconnecting. So Minecraft would have already sent a disconnect packet causing the server to fully destroy all client data, but then on the second connection attempt, Minecraft immediately sends a login packet instead of first initiating the RakNet connection.

This seems more like a bug in the game than in the server and should probably be explicitly handled by the server by simply disconnecting the client and forcing them to fully reconnect.

Implement custom command permissions

Is your feature request related to a problem? Please describe.
Currently every command is available to all players regardless of their permissions.

Describe the solution you'd like
Ideally the server should understand completely arbitrary permissions that can alter access to individual commands, i.e. a user could create a "kick" permission that allows all users that have this permission to use the /kick command.

Describe alternatives you've considered
Alternatively, we could also implement the three different permission levels implemented by the base game, but I think that would be too restrictive for larger custom servers.

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.