netrexmc / netrex Goto Github PK
View Code? Open in Web Editor NEWA powerful minecraft bedrock software written in Rust and Typescript with a powerful Typescript plugin API.
Home Page: https://discord.gg/y4aWA5MQxK
License: Apache License 2.0
A powerful minecraft bedrock software written in Rust and Typescript with a powerful Typescript plugin API.
Home Page: https://discord.gg/y4aWA5MQxK
License: Apache License 2.0
Event Function not mutable with current implementation.
Currently, we have an issue with how RakNet handles events. (this may be moved to raknet after further analysis)
The issuing being, the event subscriber function must be able to verify that the instance of the Server lives statically, which is unfortunately not possible. In the context of code, this looks like:
struct Server;
impl Server {
fn start(&mut self, address: &str) {
// We can try to create an "Arc" which references self directly
let self_ref = Arc::new(&self);
// However we can not validate that this will live statically, which
// is required by raknet.
let mut rak_server = RakNetServer::new(address.to_string());
let (_send, _work) = raknet_start!(raknet, move |event: &RakNetEvent| {
match event.clone() {
RakNetEvent::GamePacket(address, buf) => {
// Error: self may not live for the entirety of this thread.
self_ref;
Some(RakResult::Motd(Motd::default()))
}
_ => None
}
});
}
}
I'm still currently brainstorming how we could solve this issue, as it's something that affects the servers functionality entirely.
1. Basic implementation of packets required to log in via Protocol
2. Login authenticator: Handles logins (such as XBL validation)
3. Pesudo packet implementation
4. Start Game Packet:
Should the server itself tick? I'm thinking probably not because each world should be reliable for ticking, as ticking on the server (because it's a mutex) will hold a handle to everything for the duration of that tick, when we only need to tick worlds as they are open.
Please provide input here ๐
To remove redundancies and allow more control on debugging vs actual prints there should be a logger crate that can be used in all sub-crates of netrex like raknet and protocol.
You're using TypeScript. Why use #
to initialize a private property when you can just use the private
type.
#network: RakServer
can be private network: RakServer
Issue / Question:
Currently, we do not use results, and as a result, a simple function such as u32::compose(&[0, 0, 0, 1], &mut 0)
may panic, and kill the main thread. We expect a possible error here therefore it should NOT terminate the main thread, but rather just error in console, with a description of what happened.
Proposals / Details:
In places where an unwrap
or any function that has the potential to voluntarily panic we should be using results. Consider the following potentially erroneous code:
fn do_read(some_bytes: &[u8]) -> String {
// read the first byte (length) of the string.
let length = some_bytes[0];
// now read for length
let contents = &some_bytes(1..length);
String::from_utf8(contents).unwrap()
}
This proposal would change the potentially erroneous code above to:
fn do_read(some_bytes: &[u8]) -> Result<String, ErrorEnum> {
// read the first byte (length) of the string.
let length = some_bytes[0]?;
// now read for length
let contents = &some_bytes(1..length);
String::from_utf8(contents)?
}
1. Basic implementation of packets required to handle entities via Protocol
2. Skins (or related)
3. Entity NBT
4. Entity Ticking
Rust is fast, and allows us to practice better memory practicing, allowing us to write efficient code with incredible speed.
I plan on keeping a maintained branch with a similar api to the incoming changes for the rust version; this is because I am not set on removing the TypeScript version, as I think it would be a good reference for benchmarking the rust version, as well as offering an opportunity for more people to contribute to it.
While the core code will be migrated to rust, we will still be using a TypeScript plugin API integrated with Deno. The plugin API will be isolated, meaning each plugin will run in it's own "context" to allow full usage of Deno's "secure by default" motive as well as better control of developing and debugging plugins.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.