improve formatting and fix typos

This commit is contained in:
nilsraccoon 2024-10-16 14:18:40 +02:00
parent 05bcde494e
commit 319117a3a0
5 changed files with 58 additions and 64 deletions

View File

@ -2,13 +2,12 @@
Here, I compare common Minecraft servers against Pumpkin. Here, I compare common Minecraft servers against Pumpkin.
Is this comparison fair?. Not really. While you could say Pumpkin currently has way fewer features than other Servers which should use less resources, You should also consider that other Servers had already Years for Is this comparison fair? Not really. While Pumpkin currently has far fewer features than other servers, which might suggest it uses fewer resources, it's important to consider that other servers have had years for optimization. Especially vanilla forks, which don’t need to rewrite the entire vanilla logic, can focus exclusively on optimizations.
Optimizations, Especially Vanilla forks, which don't have to go through the pain of rewriting the entire vanilla logic, are free to focus on optimizations
ALL TESTS HAVE BEEN RAN MULTIPLE TIMES TO GUARANTEE CONSISTENT RESULTS ALL TESTS HAVE BEEN RAN MULTIPLE TIMES TO GUARANTEE CONSISTENT RESULTS
ALL PLAYERS DID NOT MOVE WHEN SPAWNING, ONLY THE INITIAL 8 CHUNKS WERE LOADED, THAT'S ALSO THE REASON CPU MAX IS USUALLY HIGH ON THE FIRST PLAYER ALL PLAYERS DID NOT MOVE WHEN SPAWNING, ONLY THE INITIAL 8 CHUNKS WERE LOADED, THAT'S ALSO THE REASON CPU MAX IS USUALLY HIGH ON THE FIRST PLAYER
ALL SERVERS USED ITS OWN TERRAIN GENERATION, NO WORLD WAS PRE-LOADED ALL SERVERS USED THEIR OWN TERRAIN GENERATION, NO WORLD WAS PRE-LOADED
![Screenshot From 2024-10-15 16-42-53](https://github.com/user-attachments/assets/e08fbb00-42fe-4479-a03b-11bb6886c91a) ![Screenshot From 2024-10-15 16-42-53](https://github.com/user-attachments/assets/e08fbb00-42fe-4479-a03b-11bb6886c91a)
@ -49,7 +48,7 @@ ALL SERVERS USED ITS OWN TERRAIN GENERATION, NO WORLD WAS PRE-LOADED
- Online mode: false - Online mode: false
- Rcon: false - Rcon: false
<sub><sup>online mode was disabled, so i can easier test with non premium accounts</sup></sub> <sub><sup>online mode was disabled for easier testing with non-premium accounts</sup></sub>
## Pumpkin ## Pumpkin
@ -73,7 +72,7 @@ Run args:
| 5 | 26,0MB | 0,0% | 1,0% | | 5 | 26,0MB | 0,0% | 1,0% |
| 10 | 27,1MB | 0,0% | 1,5% | | 10 | 27,1MB | 0,0% | 1,5% |
<sub><sup>pumpkin does cache already loaded chunks, resulting in no extra RAM besides player data and minimal CPU usage</sup></sub> <sub><sup>pumpkin does cache already loaded chunks, resulting in no extra RAM usage besides player data and minimal CPU usage</sup></sub>
#### Compile time #### Compile time
Compiling from Nothing Compiling from Nothing

View File

@ -9,16 +9,16 @@ git clone https://github.com/Snowiiii/Pumpkin.git
cd Pumpkin cd Pumpkin
``` ```
You may also have to [install rust](https://www.rust-lang.org/tools/install) when you don't already have it. You may also have to [install rust](https://www.rust-lang.org/tools/install) if you don't already have it.
You can place a vanilla world into the Pumpkin/ directory when you want. Just name the World to `world` You can place a vanilla world into the Pumpkin/ directory if you want. Just name the World `world`
Then run: Then run:
> [!NOTE] > [!NOTE]
> This can take a while. Because we enabled heavy optimizations for release builds > This can take a while because we enabled heavy optimizations for release builds
> >
> To apply further optimizations specfic to your CPU and use your CPU features. You should set the target-cpu=native > To apply further optimizations specific to your CPU and use your CPU features, you should set the target-cpu=native
> Rust flag. > Rust flag.
```shell ```shell
@ -34,7 +34,7 @@ The image is currently not published anywhere, but you can use the following com
docker build . -t pumpkin docker build . -t pumpkin
``` ```
To run, it use the following command: To run it, use the following command:
```shell ```shell
docker run --rm -p 25565:25565 -v "./world:/pumpkin/world" pumpkin docker run --rm -p 25565:25565 -v "./world:/pumpkin/world" pumpkin

View File

@ -2,44 +2,39 @@
### Why Authentication ### Why Authentication
Minecraft is the most Popular game out there, And is very easy to play it without paying for it. In Fact, you don't pay for the Game, You pay for a Minecraft Account. Minecraft is the most popular game out there and is very easy to play without paying for it. In fact, you don't pay for the game; you pay for a Minecraft account. People who don't buy the game but play it online are using [Cracked Accounts](#cracked-accounts).
People who don't buy the Game, but play it online are using [Cracked Accounts](#cracked-accounts)
#### Cracked Accounts #### Cracked Accounts
- Don't cost any Money - Don't cost any money.
- Everyone can set their own Nickname - Everyone can set their own nickname.
- Have no UUID - Have no UUID.
- Have no Skin/Cape - Have no skin/cape.
- Not Secure - Not secure.
The Problem is that everyone can name themselves however they want, by, for example, allowing them to Join the Server as a Staff Member for example and having extended permissions. The problem is that everyone can name themselves however they want, which allows them to join the server as a staff member, for example, and have extended permissions. Cracked accounts are also often used for botting and [Denial of Service](https://de.wikipedia.org/wiki/Denial_of_Service) attacks.
Cracked accounts are also often used for Botting and [Denial of Service](https://de.wikipedia.org/wiki/Denial_of_Service) attacks.
### Cracked Server ### Cracked Server
By default, the `online_mode` is enabled in the configuration, This enables Authentication disabling [Cracked Accounts](#cracked-accounts). When you are willing to allow Cracked Accounts, you can disable `online_mode` By default, `online_mode` is enabled in the configuration. This enables authentication, disabling [Cracked Accounts](#cracked-accounts). If you want to allow cracked accounts, you can disable `online_mode` in the `configuration.toml`.
in the `configuration.toml`
### How Mojang Authentication works ### How Mojang Authentication Works
To ensure a player has a premium accounts: To ensure a player has a premium account:
1. A client with a premium account sends a login request to the Mojang session server. 1. A client with a premium account sends a login request to the Mojang session server.
2. **Mojang's servers** verify the client's credentials and add the player to their servers. 2. **Mojang's servers** verify the client's credentials and add the player to their servers.
3. Now, our server will send a Request to the Session servers and check if the Player has joined the Session Server. 3. Our server sends a request to the session servers to check if the player has joined the session server.
4. If the request is successful, It will give use more information about the Player (e.g. UUID, Name, Skin/Cape...) 4. If the request is successful, it will provide more information about the player (e.g., UUID, name, skin/cape...).
### Custom Authentication Server ### Custom Authentication Server
Pumpkin does support custom Authentication servers, You can replace the Authentication URL in `features.toml`. Pumpkin does support custom authentication servers. You can replace the authentication URL in `features.toml`.
#### How Pumpkin Authentication Works #### How Pumpkin Authentication Works
1. **GET Request:** Pumpkin sends a GET request to the specified authentication URL. 1. **GET Request:** Pumpkin sends a GET request to the specified authentication URL.
2. **Status Code 200:** If the authentication is successful, the server responds with a status code of 200. 2. **Status Code 200:** If the authentication is successful, the server responds with a status code of 200.
3. **Parse JSON Game Profile:** Pumpkin parses the JSON game profile returned in the response. 3. **Parse JSON Game Profile:** Pumpkin parses the JSON game profile returned in the response.
#### Game Profile #### Game Profile
@ -49,7 +44,7 @@ struct GameProfile {
id: UUID, id: UUID,
name: String, name: String,
properties: Vec<Property>, properties: Vec<Property>,
profile_actions: Option<Vec<ProfileAction>>, // Optional, Only present when actions are applied profile_actions: Option<Vec<ProfileAction>>, // Optional, only present when actions are applied
} }
``` ```

View File

@ -1,6 +1,6 @@
### Networking ### Networking
Most of the Networking code in Pumpkin, can be found at [Pumpkin-Protocol](https://github.com/Snowiiii/Pumpkin/tree/master/pumpkin-protocol) Most of the Networking code in Pumpkin can be found at [Pumpkin-Protocol](https://github.com/Snowiiii/Pumpkin/tree/master/pumpkin-protocol)
Serverbound: Client→Server Serverbound: Client→Server
@ -16,11 +16,11 @@ Packets in the Pumpkin protocol are organized by functionality and state.
### States ### States
**Handshake**: Always the first packet being sent from the Client. This begins also determines the next state, usually to indicate if the player wants to perform a Status Request, Join the Server or want to be transferred. **Handshake**: Always the first packet being sent from the Client. This also determines the next state, usually to indicate if the player wants to perform a Status Request, join the server or wants to be transferred.
**Status**: Indicates the Client wants to see a Status response (MOTD). **Status**: Indicates the Client wants to see a Status response (MOTD).
**Login**: The Login sequence. Indicates the Client wants to join to the Server **Login**: The Login sequence. Indicates the Client wants to join to the Server.
**Config**: A sequence of Configuration packets is mostly sent from the Server to the Client. (Features, Resource Pack, Server Links, etc.) **Config**: A sequence of Configuration packets is mostly sent from the Server to the Client. (Features, Resource Pack, Server Links, etc.)
@ -29,7 +29,7 @@ Packets in the Pumpkin protocol are organized by functionality and state.
### Minecraft Protocol ### Minecraft Protocol
You can find all Minecraft Java packets at https://wiki.vg/Protocol. There you also can see in which [State](#States) they are. You can find all Minecraft Java packets at https://wiki.vg/Protocol. There you also can see in which [State](#States) they are.
You can also can see all the information the Packets have, which we can either Write or Read depending on whether they Serverbound or Clientbound You can also can see all the information the Packets have, which we can either Write or Read depending on whether they are Serverbound or Clientbound.
### Adding a Clientbound Packet ### Adding a Clientbound Packet
@ -49,7 +49,7 @@ You can also can see all the information the Packets have, which we can either W
> [!IMPORTANT] > [!IMPORTANT]
> Please start the Packet name with "C" for Clientbound. > Please start the Packet name with "C" for Clientbound.
> Also please add the State to the packet if its a Packet sended in multiple States, For example there are 3 Disconnect Packets. > Also please add the State to the packet if its a Packet sent in multiple States, For example there are 3 Disconnect Packets.
> >
> - CLoginDisconnect > - CLoginDisconnect
> - CConfigDisconnect > - CConfigDisconnect
@ -69,7 +69,7 @@ pub struct CPlayDisconnect {
} }
``` ```
4. Also don't forgot to impl a new function for Clientbound Packets so we can actually send them by putting in the values 4. Also don't forgot to impl a new function for Clientbound Packets so we can actually send them by putting in the values.
Example: Example:
@ -81,7 +81,7 @@ impl CPlayDisconnect {
} }
``` ```
5. At the End, everything should come together. 5. In the end, everything should come together.
```rust ```rust
#[derive(Serialize)] #[derive(Serialize)]
@ -97,7 +97,7 @@ impl CPlayDisconnect {
} }
``` ```
6. You can also Serialize the Packet manually, Which can be useful if the Packet is more complex 6. You can also Serialize the Packet manually, which can be useful if the Packet is more complex.
```diff ```diff
-#[derive(Serialize)] -#[derive(Serialize)]
@ -128,7 +128,7 @@ impl CPlayDisconnect {
> [!IMPORTANT] > [!IMPORTANT]
> Please start the Packet name with "S" for Serverbound. > Please start the Packet name with "S" for Serverbound.
> Also please add the State to the packet if its a Packet sended in multiple States. > Also please add the State to the packet if its a Packet sent in multiple States.
Create fields within your packet structure to represent the data that will be sent to the client. Create fields within your packet structure to represent the data that will be sent to the client.
@ -146,7 +146,7 @@ pub struct SPlayerPosition {
} }
``` ```
4. At the End, everything should come together. 4. In the end, everything should come together.
```rust ```rust
#[derive(Deserialize)] #[derive(Deserialize)]
@ -159,7 +159,7 @@ pub struct SPlayerPosition {
} }
``` ```
5. You can also Deserialize the Packet manually, Which can be useful if the Packet is more complex 5. You can also Deserialize the Packet manually, which can be useful if the Packet is more complex
```diff ```diff
-#[derive(Deserialize)] -#[derive(Deserialize)]
@ -267,9 +267,10 @@ For Players:
``` ```
### Compression ### Compression
Minecraft Packets **can** use the ZLib compression for decoding/ encoding. There is usually a threshold set when compression is applied, This most often affects Chunk Packets. Minecraft Packets **can** use the ZLib compression for decoding/encoding. There is usually a threshold set when compression is applied, this most often affects Chunk Packets.
### Porting ### Porting
To port to a new Minecraft version, You can compare difference in Protocol on wiki.vg https://wiki.vg/index.php?title=Protocol&action=history To port to a new minecraft version, you can compare difference in Protocol on [wiki.vg](https://wiki.vg/index.php?title=Protocol&action=history)
Also change the `CURRENT_MC_PROTOCOL` in `src/lib.rs` Also change the `CURRENT_MC_PROTOCOL` in `src/lib.rs`

View File

@ -2,40 +2,39 @@
### What is RCON ### What is RCON
RCON (Remote Console) is a protocol designed by Valve to allow administrators to control and manage game servers remotely. RCON (Remote Console) is a protocol designed by Valve to allow administrators to control and manage game servers remotely. It provides a way to execute commands on a server from a different location, such as a phone or a separate computer.
It provides a way to execute commands on a server from a different location, such as a phone or a separate computer.
### Why RCON ### Why RCON
- Convenience: Manage your server from anywhere with an internet connection. - **Convenience:** Manage your server from anywhere with an internet connection.
- Flexibility: Execute commands without needing to be physically present at the server's location. - **Flexibility:** Execute commands without needing to be physically present at the server's location.
- Efficiency: Automate tasks and streamline server management. - **Efficiency:** Automate tasks and streamline server management.
### SSH vs RCON ### SSH vs RCON
**SSH** **SSH**
- Offers strong encryption to protect data transmitted between the client and server - Offers strong encryption to protect data transmitted between the client and server.
- Primarily designed for secure remote login and execution of commands on a remote machine - Primarily designed for secure remote login and execution of commands on a remote machine.
- Common for managing Linux/Unix systems, configuring networks, and running scripts. - Commonly used for managing Linux/Unix systems, configuring networks, and running scripts.
- Provides a shell-like environment, allowing you to execute various commands and interact with the remote system - Provides a shell-like environment, allowing you to execute various commands and interact with the remote system.
**RCON** **RCON**
- Specifically designed for remote administration of game servers, allowing you to control and manage the server's settings and operations - Specifically designed for remote administration of game servers, allowing you to control and manage the server's settings and operations.
- Typically less secure than SSH, as it often relies on plain text passwords - Typically less secure than SSH, as it often relies on plain text passwords.
- Primarily used by game server administrators to manage game servers - Primarily used by game server administrators to manage game servers.
- Limited set of game-specific commands - Has a limited set of game-specific commands.
### Packets ### Packets
RCON is a very simple Protocol it has a few Packets. That's how a RCON Packet looks RCON is a very simple protocol with a few packets. Here's how an RCON packet looks:
| Field | Description | | Field | Description |
| ----- | ----------------------------------------------- | | ----- | ----------------------------------------------- |
| ID | For example used when auth failed or succeed | | ID | Used to indicate whether authentication failed or succeeded |
| Type | That way we know what Packet this is | | Type | Identifies the packet type |
| Body | A Message (String) (e.g. A Command, A Password) | | Body | A message (String), e.g., a command or a password |
#### Server Bound Packets <sub><sub>(Client→Server)</sub></sub> #### Server Bound Packets <sub><sub>(Client→Server)</sub></sub>
@ -51,15 +50,15 @@ RCON is a very simple Protocol it has a few Packets. That's how a RCON Packet lo
| 2 | AuthResponse | | 2 | AuthResponse |
| 0 | Output | | 0 | Output |
### How RCON works ### How RCON Works
1. Authentication: 1. **Authentication:**
- The RCON client sends an authentication packet with the desired password. - The RCON client sends an authentication packet with the desired password.
- The server verifies the password and responds with an authentication response packet. - The server verifies the password and responds with an authentication response packet.
- If successful, the response packet includes the same ID as the client send. If unsuccessful, the ID is -1. - If successful, the response packet includes the same ID as the one sent by the client. If unsuccessful, the ID is -1.
2. Command Execution: 3. **Command Execution:**
- The authenticated client can now send command execution packets, Each packet contains the command to be executed. - The authenticated client can now send command execution packets, with each packet containing the command to be executed.
- The server processes the command and sends back an output packet containing the result or any error messages. - The server processes the command and sends back an output packet containing the result or any error messages.