Commit Graph

57 Commits

Author SHA1 Message Date
Alexander Medvedev
575f17948f Inline format arguments
Looks much nicer and more readable
2025-05-10 15:22:06 +02:00
Liyan Zhao
0ee0702b5d Read commands from stdin (#782) 2025-05-02 12:03:20 -10:00
Alvsch
b811ab57d7 Add whitelist feature (#741)
* added whitelist feature

* add whitelist command
2025-04-25 09:43:45 -10:00
Andrew Neeley
055a5d0feb Various essential chat improvements (#692)
* fully validate chat messages

* remove unnecessary stuff

* remove lies

* building errors

* Separate last_seen from signature_cache to mirror Vanilla behavior

* full cache management

* better obj management

* change inline values to const

* change unneccesary new to default

* better comments

* derive defaults

* remove random debugs

* Fix magic numbers

* pretty sure an EnumSet should be u8

* Add assert for allow_chat_reports config option

* Verify chat message expiry and order

* Implement chat session validation

* Set all `ChatError` to `Level::Warn`

* Truncate full_cache correctly

* move java hash functions together

* remove extra use

* `full_cache` as `VecDeque`

* Set `full_cache` capacity

* Remove length check for `key_signature`

* Move `PlayerInfoFlags`

* Move `fetch_mojang_public_keys`

* clippy fix
2025-04-05 22:23:24 +02:00
Gabeperson
e03e05ddad Refactor unnecessary unsafe code and add safety comments (#698)
* refactor unsafe code

* fix unwrap in forbidden block
2025-04-04 08:25:36 +02:00
Alexander Medvedev
bfdd57b88f added some fun
😉
2025-04-01 15:45:23 +02:00
Andrew Neeley
a63b49a095 add Secure Chat (#656)
* Add secure chat configuration option

* Add secure chat bool to login packet

* change name of config flag

* add packet deserializer for player session packet

* make session update async

* Change config option

* Formatting

* Add chat configuration option

* Basic custom chat formatting

* formatting

* Add chat session to Player

* fix duplicate imports

* Formatting

* chat validation mostly working

* add registry for custom raw message

* chat formatting working with secure chat

* don't share session tokens if reporting blocked

* add received message index

* add custom registry without modifying asset files

* resolve color decorator before MESSAGE so player can't inject color codes by default

* move comment

* update all player sessions on join

* better previous message handling

* fix multiplayer bugs

* send new players existing signatures

* clean stuff up

* only send ChatSession if reports are enabled

* make clippy happy
2025-03-30 21:31:55 +02:00
Hugo Planque
4672f61965 feat(player-data): Support saving and loading player NBT Data (#600)
* feat(player-data): Support saving and loading player NBT Data

* fix(player_data): ensure player data is save before continuing

* fix(player_data): implement NBTStorage for hunger data

* feat(player-data): allow setting world name in config

* fix(player-data): use correct method to retrieve world_name

* feat(player-data): move PlayerDataStorage to pumpkin-world

* fix(player-data): ci not building

* fix(player-data): ci not building

* feat(player-data): support inventory saving + review fix

* fix(player-data): forgot the format

* some fixes

* fix clippy

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-03-24 20:55:41 +01:00
Epix
93510eecd5 Grammar fixes, terminology change (#633)
* Major grammar sweep

* Remove extra backtick

* Use more specific terminology for chunk data storage

* Forgor to cargofmt

* Fix typo "thier"

* Fix typo "clousures"

* Try new terminology

* Forgor to cargofmt

* Use "Subchunks" instead of "Heterogeneous" for ChunkBlocks variant

* Fix variable name

* Forgor to change comment
2025-03-16 10:40:17 +01:00
kralverde
300ccde108 ChunkIO api and world saving optimizations (#624) 2025-03-12 08:40:53 -10:00
ht06
52e48ec0bd Add /defaultgamemode command (#588)
* Add Defaultgamemode command

* add force_gamemode in configuration.toml
Check if the force_gamemode is enabled while doing the command

* Delete useless import + adapt to the new TextComponent::translate.

* add a space...

* Save the default gamemode in the server

* refactor + delete a .clone

* Add #[must_use]
2025-03-02 15:02:11 +01:00
kralverde
7c3487e9c1 revert resource pack names (#587) 2025-02-24 06:17:45 -10:00
Luis
160d98d5c7 fix: encode Uuid correctly (fixes #454) (#583)
* fix: encode Uuid correctly (fixes #454)

* chore: use default implementation for #is_human_readable

* chore: override #is_human_readable to always return false

* fix resource packs

* fix spelling

---------

Co-authored-by: kralverde <github@email.kralverde.dev>
2025-02-23 13:09:41 -10:00
Alexander Medvedev
1fb2be46d4 Update to Rust edition 2024 2025-02-20 18:42:20 +01:00
Alexander Medvedev
2e2fe83720 Add Hunger 2025-02-07 00:22:52 +01:00
Alexander Medvedev
3d789f7450 Some Renames 2025-02-05 23:12:16 +01:00
Mili
12866bce36 feat: add linear chunk format (#494)
* feat: add linear chunk format with zstd lib dependency

* fixing a typo

* refactor: rename file handling methods for clarity and more lint fixes

* refactor: improve clarity on validation methods

* fix: invert version check in LinearFile header validation

* fix: remove leading dot from file path formatting in LinearChunkFormat

* refactor: improve error handling and method naming in LinearFile operations

* fix: ensure file is flushed after writing in LinearFile operations

* fix: lints and warnings

* fix: more lints

* refactor: streamline LinearFile structure and improve header management

* refactor: change chunks_headers to use Box for improved memory management and use exception to know if file exist

* refactor: update path parameter types to PathBuf for consistency and improved usability

* refactor: update path parameter types to Path avoiding uknown changes and adjust file truncation logic

* fix: avoid using the same path for different tests

* fix: fix some bytes sizes for the header based on the spec

* refactor: enable file truncation when opening for writing and simplify save method

* fix: removing IoSlices for windows issues.

* fix: clippy lints

* refactor: improve incompatible files cheking, some documentation and variable nameing

* feat: add file_format to ChunkConfig and implement format handling in Level

* feat: add error logging for invalid file headers and data size checks in LinearFile and tmp filenames on write

* feat: implement file locking mechanism for concurrent chunk read/write operations

* fix: bug at desserializing the chunks headers.

* Refactor chunk file locking mechanism to use DashMap for improved concurrency and simplify read/write guard management

* docs: Update documentation for LinearVersion enum with format references

* re-check workflows

* re-check lints 2

* rename config values

* Some doc improvements

---------

Co-authored-by: Mili <santiagoogle@hotmail.com>
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-02-05 22:28:20 +01:00
suprohub
186e846858 Plugin event rewrite (#513)
* simplify all

* fmt

* Consider using derive macro

* Add new events

* Add events call

* minor fixes

* minor fixes

* fix

* optimize code

* big changes

* fix skill issue

* fix

* Consider not specify patch version

* make logger shared

* i want test one thing

* Add one useful function

* add little amouth of docs

* use config instead

* revert changes

* fmt

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2025-02-01 18:14:28 +01:00
Alexander Medvedev
41fac573ba Fix some typos 2025-01-28 14:05:17 +01:00
Alexander Medvedev
c4364d5d67 Translate authentication errors 2025-01-23 20:17:58 +01:00
Alexander Medvedev
23dbb72bbe rename WorldPosition 2025-01-12 16:45:22 +01:00
Alexander Medvedev
ee485056fb rename pumpkin-core to pumpkin-util
I see that there is an confusion between the pumpkin-core crate,  People often think that this is the most important one
2025-01-09 13:12:57 +01:00
Matin Mohammadi
9cfbb323a3 Fix misspelled word "probably" (#468) 2025-01-08 16:06:07 +01:00
Alexander Medvedev
ad39b28d6d move some config things into networking 2025-01-02 22:42:56 +01:00
Alexander Medvedev
c5c7e897cb Update website and repo links 2024-12-29 12:40:22 +01:00
Kris
205191b194 Added default op level (#426) 2024-12-28 17:46:25 +01:00
Kyle Davis
6a5add8de5 Added native operator permission management (#348)
* Starting work on Operator permission system

This commit adds the ops.json configuration found in vanilla
servers, and updates the basic configuration to handle the default
permission level.

Server now uses ops file and defaults players to op level 0

The /op command has been added but needs players to rejoin for now.

* Clippy Fix + need to Rejoin after /op removed

I found the source of the DeadLock. Updated set permission function.

Fix cargo formatting issues and clippy issues.

* Remove temp warn message

* Move OperatorConfig to server

As Snowiii pointed out, OperatorConfig is runtime data.

Revert most changes in pumpkin-config.

op_permission_level must say in the basic configuration for
parity with Minecraft.

* cargo fmt + cargo clippy

* Sync permission change with client

* Fixs issues @Commandcracker found in review

- Move PermissionLvl to core and removed OpLevel
- Move ops.json to /data/ops.json
- Fix permissions issue with /op command
- Shorten /op command description

* refactor into `data` folder

* create data dir when needed

* add to readme

* fix: conflicts

---------

Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2024-12-27 17:22:19 +01:00
Alexander Medvedev
f5c20fb5d9 Create configs in a folder (#407)
* create configs in a folder

* use `env::current_dir()`
2024-12-24 20:02:27 +01:00
Alexander Medvedev
cc0f30848e More clippy lints
Also made some vars NonZero
2024-12-19 01:25:19 +01:00
Snowiiii
2ee2cc06dd fix some typos 2024-12-11 16:15:31 +01:00
Commandcracker
0cc693e4b2 Add Server Links (#307)
* Add Server Links

* Use config phase

---------
2024-11-26 21:28:59 +01:00
we sell insurance
7d15442ffd Make auth urls optional, fix issues in prevent proxy connections (#332) 2024-11-25 21:07:13 +01:00
Commandcracker
d4c20cf43e Add lan broadcast (#299)
* Add lan broadcast

* Update port comment in pumpkin-config/src/lan_broadcast.rs

Co-authored-by: we sell insurance <72574589+neeleshpoli@users.noreply.github.com>

* Fallback to default motd

* Add Multicast address info to broadcast adress in pumpkin/src/lan_broadcast.rs

Co-authored-by: DataModel <183248792+DataM0del@users.noreply.github.com>

* update config

* Update pumpkin/src/lan_broadcast.rs

Co-authored-by: we sell insurance <72574589+neeleshpoli@users.noreply.github.com>

* Update pumpkin/src/lan_broadcast.rs

Co-authored-by: we sell insurance <72574589+neeleshpoli@users.noreply.github.com>

* not need now but better not to forget it late

---------

Co-authored-by: we sell insurance <72574589+neeleshpoli@users.noreply.github.com>
Co-authored-by: DataModel <183248792+DataM0del@users.noreply.github.com>
2024-11-19 22:23:22 +01:00
Commandcracker
5cd460f4a4 config: remove serde-inline-default (#303)
* Cleanup pumpkin-config

* Forgot to add #[serde(default)]
2024-11-19 22:17:03 +01:00
we sell insurance
93c6da993f Implement Query protocol (#218)
* Add query options to config
Added packet data types
Correctly parse a handshake packet
Add tokio to pumpkin protocol for `AsyncReadExt` convenience functions

* Add repr(u8) so that PacketType is a byte

* Respond to handshake correctly

* Allow for proper decoding of status packets and properly handle errors in decoding

* Implement challange tokens and verify with token and address

* Encode Basic status packet
Switch to CString since its better to and null errors higher up the code

* Encode Full status packet

* Add forgotten fields to full status packet

* Correctly respond to query clients when requesting full status

* Return actual address and port of server
Respect config options
Remove uncessary debug derives

* Remove packet type as it is redundant/unnecssary

* Implement basic status request
Refactor code for better error handling

* Update README

* Show players correctly in full status packet

* Store all packets in structs instead of enums
Break up en/decoding for each packet
Reduce client tracking
Get rid of QueryClients struct
Stop storing of magic value and check during decoding
Added tests for all decoding and encoding
Fix all sugestions from @StripedMonkey
2024-11-05 20:07:31 +01:00
lokka30
15d9920826 Implement max player limit (#194)
* Implement max player limit

* Removed unnecessary `return`.

* Moved server full check to start of `handle_login_start`

Also removed unnecessary debug log.

* Use  instead of  for max players; add disable logic

* Fix semicolon missing
2024-10-27 16:18:28 +01:00
Snowiiii
287f466ae1 More workspace dependencies 2024-10-21 19:36:42 +02:00
Snowiiii
bb050958a2 Add Tick system 2024-10-21 13:25:04 +02:00
kralverde
086e347d3a rework favicon selection process 2024-10-18 16:53:49 -04:00
kralverde
f54f6aa123 add favicon to config 2024-10-17 20:19:38 -04:00
Snowiiii
15832078af Add: Bungeecord support 2024-10-16 21:51:09 +02:00
Snowiiii
c5fdb39d6a Fix: forgot serde_inline_default in config 2024-10-14 22:09:04 +02:00
Alexander Medvedev
ee4db10d5e Merge pull request #115 from kralverde/ip_scrub
Add config option to scrub ips from logs
2024-10-14 21:05:35 +01:00
Snowiiii
47f149d154 Support custom authentication servers 2024-10-13 12:15:16 +02:00
kralverde
fd13333d03 scrub ipds 2024-10-12 19:56:24 -04:00
Snowiiii
d8220bf49b docs: Overhaul 2024-10-12 17:39:43 +02:00
lukas0008
7db8c0ed97 Add serde defaults for logging 2024-10-11 17:12:35 +02:00
lukas0008
68ab173ee8 Merge branch 'master' into config-serde-defaults 2024-10-11 17:08:07 +02:00
lukas0008
5adaf5aa17 Add default values for config 2024-10-11 16:59:59 +02:00
Snowiiii
bcbde20623 Make Logging configurable 2024-10-11 16:41:52 +02:00