docs: Add RCON

also more grammer fixes
This commit is contained in:
Snowiiii 2024-10-16 11:40:29 +02:00
parent 85fc81a74f
commit 05bcde494e
11 changed files with 136 additions and 72 deletions

View File

@ -25,20 +25,6 @@ There are several ways you can contribute to Pumpkin:
Ensure your code adheres to our project structure and style guidelines. Ensure your code adheres to our project structure and style guidelines.
Write clear and concise commit messages that describe your changes. Write clear and concise commit messages that describe your changes.
### Faster Compiles
We use extism for our plugins, unfortunately extism has quite a hefty impact on compile times, which can increase it by several minutes on release mode. To run Pumpkin without plugins, run the following:
```shell
cargo run --no-default-features
```
And in release:
```shell
cargo run --no-default-features --release
```
### Docs ### Docs
The Documentation of Pumpkin can be found at https://snowiiii.github.io/Pumpkin/ The Documentation of Pumpkin can be found at https://snowiiii.github.io/Pumpkin/

View File

@ -19,12 +19,12 @@ and customizable experience. It prioritizes performance and player enjoyment whi
- **Performance**: Leveraging multi-threading for maximum speed and efficiency. - **Performance**: Leveraging multi-threading for maximum speed and efficiency.
- **Compatibility**: Supports the latest Minecraft server version and adheres to vanilla game mechanics. - **Compatibility**: Supports the latest Minecraft server version and adheres to vanilla game mechanics.
- **Security**: Prioritizes security by preventing known exploits. - **Security**: Prioritizes security by preventing known exploits.
- **Flexibility**: Highly configurable with the ability to disable unnecessary features. - **Flexibility**: Highly configurable, with the ability to disable unnecessary features.
- **Extensibility**: Provides a foundation for plugin development. - **Extensibility**: Provides a foundation for plugin development.
## What Pumpkin will not ## What Pumpkin will not
- Be a drop-in replacement for vanilla or other servers - Be a drop-in replacement for Vanilla or other servers
- Be compatible with plugins or mods for other servers - Be compatible with plugins or mods for other servers
- Function as a framework for building a server from scratch. - Function as a framework for building a server from scratch.

View File

@ -31,6 +31,8 @@ export default defineConfig({
{ text: "Introduction", link: "/developer/introduction" }, { text: "Introduction", link: "/developer/introduction" },
{ text: "Networking", link: "/developer/networking" }, { text: "Networking", link: "/developer/networking" },
{ text: "Authentication", link: "/developer/authentication" }, { text: "Authentication", link: "/developer/authentication" },
{ text: "RCON", link: "/developer/rcon" },
], ],
}, },

View File

@ -75,6 +75,17 @@ Run args:
<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 besides player data and minimal CPU usage</sup></sub>
#### Compile time
Compiling from Nothing
**Debug:** 10.35sec
**Release:** 38.40sec
Recompilation (pumpkin crate)
**Debug:** 1.82sec
**Release:** 28.68sec
## Vanilla ## Vanilla
Release: [1.21.1](https://piston-data.mojang.com/v1/objects/59353fb40c36d304f2035d51e7d6e6baa98dc05c/server.jar) Release: [1.21.1](https://piston-data.mojang.com/v1/objects/59353fb40c36d304f2035d51e7d6e6baa98dc05c/server.jar)

View File

@ -10,7 +10,7 @@ and customizable experience. It prioritizes performance and player enjoyment whi
- **Performance**: Leveraging multi-threading for maximum speed and efficiency. - **Performance**: Leveraging multi-threading for maximum speed and efficiency.
- **Compatibility**: Supports the latest Minecraft server version and adheres to vanilla game mechanics. - **Compatibility**: Supports the latest Minecraft server version and adheres to vanilla game mechanics.
- **Security**: Prioritizes security by preventing known exploits. - **Security**: Prioritizes security by preventing known exploits.
- **Flexibility**: Highly configurable with the ability to disable unnecessary features. - **Flexibility**: Highly configurable, with the ability to disable unnecessary features.
- **Extensibility**: Provides a foundation for plugin development. - **Extensibility**: Provides a foundation for plugin development.
## What Pumpkin will not ## What Pumpkin will not

View File

@ -2,14 +2,14 @@
There are currently no release builds, because there was no release :D. There are currently no release builds, because there was no release :D.
To get Pumpkin running you first have to clone it: To get Pumpkin running, you first have to clone it:
```shell ```shell
git clone https://github.com/Snowiiii/Pumpkin.git git clone https://github.com/Snowiiii/Pumpkin.git
cd Pumpkin cd Pumpkin
``` ```
You also may have to [install rust](https://www.rust-lang.org/tools/install) when you don't already have. You may also have to [install rust](https://www.rust-lang.org/tools/install) when 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 when you want. Just name the World to `world`
@ -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

@ -4,7 +4,7 @@
`proxy` `proxy`
Wether Proxy Configuration is enabled Whether Proxy Configuration is Enabled
```toml ```toml
enabled=false enabled=false
@ -14,7 +14,7 @@ enabled=false
`proxy.velocity` `proxy.velocity`
Wether [Velocity](https://papermc.io/software/velocity) Proxy is enabled Whether [Velocity](https://papermc.io/software/velocity) Proxy is enabled
> [!IMPORTANT] > [!IMPORTANT]
> Velocity support is currently WIP > Velocity support is currently WIP
@ -35,7 +35,7 @@ secret=
`authentication` `authentication`
Wether Authentication is enabled Whether Authentication is enabled
```toml ```toml
enabled=false enabled=false
@ -151,7 +151,7 @@ cape=true
#### Elytra #### Elytra
Use player elytras Use player elytras
(i didn't know myself that there are custom elytras) (I didn't know myself that there are custom elytras)
```toml ```toml
elytra=true elytra=true
@ -161,7 +161,7 @@ elytra=true
`packet_compression` `packet_compression`
Wether Packet Compression is enabled Whether Packet Compression is enabled
```toml ```toml
enable=true enable=true
@ -171,7 +171,7 @@ enable=true
#### Threshold #### Threshold
The compression threshold used when compression is enabled The compression threshold is used when compression is enabled
```toml ```toml
threshold=256 threshold=256
@ -196,7 +196,7 @@ level=4
`resource_pack` `resource_pack`
Wether a Resource Pack is enabled Whether a Resource Pack is enabled
```toml ```toml
enable=false enable=false
@ -248,7 +248,7 @@ use_console=true
### Log Console ### Log Console
Should be commands from players be logged in console Should commands from players be logged into the console?
```toml ```toml
log_console=true log_console=true
@ -258,7 +258,7 @@ log_console=true
`rcon` `rcon`
Wether RCON is enabled Whether RCON is enabled
```toml ```toml
enable=false enable=false
@ -362,7 +362,7 @@ knockback=true
### Swing ### Swing
Should player swing when attacking Should players swing when attacking?
```toml ```toml
swing=true swing=true
@ -396,7 +396,7 @@ Trace
### Env ### Env
Enables the user to choose log level by setting `RUST_LOG=<level>` environment variable Enables the user to choose log level by setting the `RUST_LOG=<level>` environment variable
```toml ```toml
env=false env=false

View File

@ -2,8 +2,8 @@
### Why Authentication ### Why Authentication
Minecraft is the most Popular game out there, And is is very easy to play it without paying for it. In Fact you don't pay for the Game, You pay for an Minecraft Account. 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.
People who don't bough the Game but play 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
@ -13,12 +13,12 @@ People who don't bough the Game but play online are using [Cracked Accounts](#cr
- Have no Skin/Cape - Have no Skin/Cape
- Not Secure - Not Secure
The Problem is that everyone can name themself how they want, Allowing 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, by, for example, allowing them to Join the Server as a Staff Member for example and having 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 disallowing [Cracked Accounts](#cracked-accounts). When you are willing to allow Cracked Accounts, you can dissable `online_mode` 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`
in the `configuration.toml` in the `configuration.toml`
### How Mojang Authentication works ### How Mojang Authentication works
@ -26,9 +26,9 @@ in the `configuration.toml`
To ensure a player has a premium accounts: To ensure a player has a premium accounts:
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 the 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. Now, our server will send a Request to the Session servers and check if the Player has joined the Session Server.
4. If the request was successfull, It will give use more information about the Player (e.g. UUID, Name, Skin/Cape...) 4. If the request is successful, It will give use more information about the Player (e.g. UUID, Name, Skin/Cape...)
### Custom Authentication Server ### Custom Authentication Server

View File

@ -2,9 +2,9 @@
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
Clientbound: Server->Client Clientbound: Server→Client
### Structure ### Structure
@ -16,30 +16,30 @@ Packets in the Pumpkin protocol are organized by functionality and state.
### States ### States
**Handshake**: Always the first packet being send from the Client. This begins also determins the next state, usally to indicate if the player thans perform a Status Request, Join the Server or wants to be transfered. **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.
**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 beining mostly send from the Server to the Client. (Features, Resource Pack, Server Links...) **Config**: A sequence of Configuration packets is mostly sent from the Server to the Client. (Features, Resource Pack, Server Links, etc.)
**Play**: The final state which indicate the Player is now ready to Join in also used to handle all other Gameplay packets. **Play**: The final state, which indicates the Player is now ready to join, is also used to handle all other Gameplay packets.
### 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 also can see all the information the Packets has which we can either Write or Read depending if its 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 Serverbound or Clientbound
### Adding a Clientbound Packet ### Adding a Clientbound Packet
1. Adding a Packet is easy. First you have to derive serde Serialize for packets. 1. Adding a Packet is easy. First, you have to derive serde Serialize for packets.
```rust ```rust
#[derive(Serialize)] #[derive(Serialize)]
``` ```
2. Next you have set the packet id using the packet macro 2. Next, you have set the packet ID using the packet macro
```rust ```rust
#[packet(0x1D)] #[packet(0x1D)]
@ -69,7 +69,7 @@ pub struct CPlayDisconnect {
} }
``` ```
4. Also don't forgot to impl a new function for Clientbound Packets so we can actaully send then 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. At 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 usefull 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)]
@ -112,13 +112,13 @@ impl CPlayDisconnect {
### Adding a Serverbound Packet ### Adding a Serverbound Packet
1. Adding a Packet is easy. First you have to dereive serde Deserialize for packets. 1. Adding a Packet is easy. First, you have to derive serde Deserialize for packets.
```rust ```rust
#[derive(Deserialize)] #[derive(Deserialize)]
``` ```
2. Next you have set the packet id using the packet macro 2. Next, you have set the packet ID using the packet macro
```rust ```rust
#[packet(0x1A)] #[packet(0x1A)]
@ -146,7 +146,7 @@ pub struct SPlayerPosition {
} }
``` ```
4. At the End everything should come together, 4. At 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 usefull 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)]
@ -179,7 +179,7 @@ pub struct SPlayerPosition {
### Client ### Client
Pumpkin has stores Client and Players seperatly, Everything what is not reached the Play State is a Simple Client. Here are the Differences Pumpkin has stores Client and Players separately. Everything that is not in the Play State is a Simple Client. Here are the Differences
**Client** **Client**
@ -267,7 +267,7 @@ For Players:
``` ```
### Compression ### Compression
Minecraft Packets **can** use the ZLib compression for decoding/encoding there is usally 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

65
docs/developer/rcon.md Normal file
View File

@ -0,0 +1,65 @@
### RCON
### What is RCON
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.
### Why RCON
- Convenience: Manage your server from anywhere with an internet connection.
- Flexibility: Execute commands without needing to be physically present at the server's location.
- Efficiency: Automate tasks and streamline server management.
### SSH vs RCON
**SSH**
- 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
- Common 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
**RCON**
- 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
- Primarily used by game server administrators to manage game servers
- Limited set of game-specific commands
### Packets
RCON is a very simple Protocol it has a few Packets. That's how a RCON Packet looks
| Field | Description |
| ----- | ----------------------------------------------- |
| ID | For example used when auth failed or succeed |
| Type | That way we know what Packet this is |
| Body | A Message (String) (e.g. A Command, A Password) |
#### Server Bound Packets <sub><sub>(Client→Server)</sub></sub>
| Type | Packet |
| ---- | ----------- |
| 2 | Auth |
| 3 | ExecCommand |
#### Client Bound Packets <sub><sub>(Server→Client)</sub></sub>
| Type | Packet |
| ---- | ------------ |
| 2 | AuthResponse |
| 0 | Output |
### How RCON works
1. Authentication:
- The RCON client sends an authentication packet with the desired password.
- 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.
2. Command Execution:
- The authenticated client can now send command execution packets, Each packet contains the command to be executed.
- The server processes the command and sends back an output packet containing the result or any error messages.

View File

@ -1,33 +1,33 @@
### Common Issues ### Common Issues
1. ### Broken Chunk Lighting 1. ### Broken Chunk Lighting
See [#93](https://github.com/Snowiiii/Pumpkin/issues/93) See [#93](https://github.com/Snowiiii/Pumpkin/issues/93)
**Issue:** Broken chunk lighting in your Minecraft server. **Issue:** Broken chunk lighting on your Minecraft server.
**Cause:** The server is currently not calculating lighting for chunks, we working on that. **Cause:** The server is currently not calculating lighting for chunks, we're working on that.
**Temporary Fix:** Use a full-bright resource pack. This will temporarily resolve the issue by making all chunks appear brightly lit. You can find many full-bright resource packs online. **Temporary Fix:** Use a full-bright resource pack. This will temporarily resolve the issue by making all chunks appear brightly lit. You can find many full-bright resource packs online.
2. ### I can place blocks inside me 2. ### I can place blocks inside me
See [#49](https://github.com/Snowiiii/Pumpkin/issues/49) See [#49](https://github.com/Snowiiii/Pumpkin/issues/49)
**Issue:** Players are able to place block in them. **Issue:** Players are able to place blocks in them.
**Cause:** The server is currently not calculating hitboxes for blocks, we working on that. **Cause:** The server is currently not calculating hit boxes for blocks, we're working on that.
3. ### Server is unresponsive 3. The Server is unresponsive
**Issue:** You have to wait before reconnect or can't do basic things while chunks are loading. **Issue:** You have to wait before reconnecting or can't do basic things while chunks are loading.
**Cause:** The server has currently blocking issues, we working on that. **Cause:** The server has currently blocking issues, we're working on that.
4. ### Failed to verify username 4. ### Failed to verify username
**Issue:** Some players reported having issues loggin into the Server, Having "Failed to verify username" error. **Issue:** Some players reported having issues logging into the Server, including a "Failed to verify username" error.
**Cause:** This has to do with Authentication, Usally with the prevent proxy connections setting. **Cause:** This has to do with Authentication, Usually with the prevent proxy connections setting.
**Fix:** Disable `prevent_proxy_connections` in `features.toml` **Fix:** Disable `prevent_proxy_connections` in `features.toml`