Skip to content

Commit

Permalink
Merge pull request #2 from MisledWater79/main
Browse files Browse the repository at this point in the history
Refactor and Starting RakNet Doc
  • Loading branch information
theaddonn authored Nov 6, 2024
2 parents 9437281 + 8e49d9c commit bd99d13
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 29 deletions.
60 changes: 43 additions & 17 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,41 @@ export default defineConfig({
themeConfig: {
logo: "/logo.png",

sidebar: generateSidebar({
documentRootPath: "docs/",
collapsed: true,
capitalizeEachWords: true,
excludePattern: [ "public/" ]
}),
sidebar: [
{
text: 'Information',
collapsed: false,
items: [
{ text: 'Contributing', link: '/info/contributing' },
{ text: 'Learn', link: '/info/learn' },
]
},
{
text: 'Raknet Protocol',
collapsed: false,
items: [
{ text: 'Start Here!', link: '/raknet/start' },
{ text: 'Data Types', link: '/raknet/data-types' },
]
},
{
text: 'Bedrock Protocol',
collapsed: false,
items: [
{ text: 'Start Here!', link: '/bedrock/start' },
{ text: 'Codec', link: '/bedrock/codec' },
{ text: 'NBT', link: '/bedrock/nbt' },
{ text: 'Login', link: '/bedrock/login' },
]
},
{
text: 'NetherNet Protocol',
collapsed: false,
items: [
{ text: 'Start Here!', link: '/nethernet/start' },
]
}
],

search: {
provider: 'local'
Expand All @@ -28,12 +57,8 @@ export default defineConfig({

nav: [
{
text: "Contribute",
link: "/about/contribute",
},
{
text: "Discord",
link: "https://discord.gg/7jHNuwb29X",
text: "Learn",
link: "/info/learn"
},
{
text: "Bedrock Wiki",
Expand All @@ -53,7 +78,8 @@ export default defineConfig({
],

footer: {
message: "Released under the Apache-2.0 License.",
message: 'Not affiliated with Mojang Studios or Microsoft Corporation.',
copyright: "Released under the Apache-2.0 License. Copyright @ 2024-present",
},

editLink: {
Expand All @@ -66,7 +92,7 @@ export default defineConfig({
formatOptions: {
dateStyle: "medium",
timeStyle: "medium",
},
},
},
})
}
}
}
})
File renamed without changes.
29 changes: 20 additions & 9 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,30 @@ layout: home
hero:
name: 'Bedrock'
text: 'Protocol Wiki'
tagline: 'The entire Bedrock Protocol and more, all documented in one place!'
tagline: "The entirety of MInecraft Bedrock's Protocol! All documented in one place!"
actions:
- theme: brand
text: Start here!
link: /info/learn
- theme: alt
text: Contribute
link: /info/contributing
- theme: alt
text: GitHub
link: https://github.com/bedrock-crustaceans/protocol-wiki

features:
- title: Bedrock Protocol
icon: ⚙️
details: The Bedrock Protocol is the essential part keeping the game running.
link: /bedrock
- title: RakNet
# Un-sure on the best way to word this/explain it.
details: The Bedrock Protocol is the Minecraft's protocol, the packets and data sent to and from clients.
link: /bedrock/start
- title: RakNet Protocol
icon: 🛠️
details: RakNet is the most used transport layer used for external Servers.
link: /raknet
- title: NetherNet
details: RakNet Protocol is the transport layer used for pinging and connecting to servers.
link: /raknet/start
- title: NetherNet Protocol
icon: 🌍
details: NetherNet is brand new, mostly used for Xbox Live Sessions.
link: /nethernet
details: NetherNet Protocol is a new transport layer, used for in-game friend sessions.
link: /nethernet/start
---
4 changes: 2 additions & 2 deletions docs/about/contribute.md → docs/info/contributing.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Contribute Guide

Welcome to our community!
Welcome to the community!

Spotted an error, have suggestions for improvements, or want to add something entirely new?
Spotted an error? Have suggestions for improvements? or want to add something entirely new?
Here’s your go-to reference for contributing!

## About the Project
Expand Down
21 changes: 21 additions & 0 deletions docs/info/learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
next:
text: 'Learning RakNet'
link: '/raknet/start'
---

# Learning Minecraft Bedrock Protocol

Welcome! We are so glad you decided to learn Minecraft Bedrock protocol!

Here you can, and will, learn how MCBE protcol works! It all starts with the [RakNet Protocol](/raknet/start) & [NetherNet Protocol](/nethernet/start). From those, you recieve the [Bedrock Protocol](/bedrock/start). This will guide you and give you proper and up-to-date documentation!

## FAQ

#### What is the difference between RakNet & NetherNet?

RakNet is the base transport layer, uses UDP, and is open source. NetherNet is a newer transport layer that is only used for Xbox Live sessions, uses WebRTC, and is built by Mojang (Which means it's not open source).

#### Is NetherNet replacing RakNet?

Not entirely, NetherNet is not meant to (and can't) replace all of RakNet. It is only used for LAN games, and any friend games (Xbox or In-Game) which both use to use RakNet.
Empty file removed docs/nethernet/libraries.md
Empty file.
File renamed without changes.
1 change: 1 addition & 0 deletions docs/raknet/data-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Data Types
1 change: 0 additions & 1 deletion docs/raknet/index.md

This file was deleted.

53 changes: 53 additions & 0 deletions docs/raknet/start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
prev:
text: 'Learning MCBE Protocol'
next:
text: 'Learning Data Types'
link: '/raknet/data-types'
---

# RakNet Protocol

Latest documentation on the RakNet protocol mainly for Minecraft Bedrock Edition(s). Explains packets, their data types, and their formatation.

## What is RakNet?

RakNet is a UDP transfer layer. It is mainly used in Minecraft Bedrock, but is used in and can be used in other games. This document will cover RakNet as a whole, but the main focus is MCBE implementation.

## How does RakNet work?

Again, RakNet protocol uses UDP, this means that the [Packets]() that are sent, might not always make it. Things like [Pings]() and [Pongs](), this doesn't matter! But for more important information, we want to make sure the clients(players) get that data. To combat this, RakNet uses [Frame Set]() packets. These split data up if its too big and also keeps track of what data didn't make it to the client and will resend it. This uses [ACK]() & [NACK]() packets which the client sends to either say it got this part of the data or is missing this part of the data.

## Handshake sequence

This is what happens for every client wanting to connect.

---

* Clients Ping the server, and the Server sends back Pongs
* A client would then send a [Open Connection Request 1]()
* Server responds by sending a [Open Connection Reply 1]()
* Client sends a [Open Connection Request 2]()
* Server replys with a [Open Connection Reply 2]()

> [!NOTE]
> From here, the connection is made and now we start sending packets in [Frame Sets]()
* Clients send Connected Pings, and the Server back send Connected Pongs (If stopped we lost connection)
* Client sends a [Connection Request]()
* Server responds with a [Connection Request Accepted]()
* Lastly, Client sends a [New Incoming Connection]()

---

Now, all data recieved from frame sets are a [Game Packet](). The data recieve from the game packet is now delt with by the [Bedrock Protocol]() (We will go over it after RakNet).

This is the barebones of RakNet, so do not worry if you do not understand. Our next part is going to go over the [Data Types]() used by RakNet.

---

#### Resources

[[Jenkin Software RakNet Docs](http://www.jenkinssoftware.com/raknet/manual/systemoverview.html)]: Information on how RakNet works & communicates

[[wiki.vg](https://wiki.vg/Raknet_Protocol)]: Information on handshake sequence
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"preview": "vitepress preview docs"
},
"dependencies": {
"pnpm": "^9.12.3",
"vitepress": "^1.4.1",
"vitepress-sidebar": "^1.28.0"
}
Expand Down

0 comments on commit bd99d13

Please sign in to comment.