Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Velocity Support #139

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open

Conversation

GStudiosX2
Copy link

@GStudiosX2 GStudiosX2 commented Dec 10, 2024

features

  • Velocity modern forwarding
    # Velocity configuration
    [velocity]
    enabled = false
    # The key from forwarding.secret
    secret = ""
  • Tablist lists players

changes

  • Send chunk at 0, 0 on join so player doesn't fall through (it doesn't work 100% all the time)
  • Spawn player at highest air block with MOTION_BLOCKING heightmap
  • Triggering a event returns Result<Self::Data, Self::Error> now (is this considered a breaking change?)
  • New login process event ferrumc_net::connection::PlayerStartLoginEvent
    Used by whitelist.rs and velocity.rs
  • whitelist is now handled in bin/src/packet_handlers/whitelist.rs
  • New EventsError Other
    Not sure why I added this I don't think I use it but could be for custom event errors I guess?
  • New NetError Kick
    NetError::Kick(TextComponentBuilder::text("Hello, World!").build())
    NetError::kick("Hello, World!".to_string())

breaking changes

  • LengthPrefixedVec now supports all functions from Vec via Deref & DerefMut
  • terminate_connection has been replaced with ferrumc_net::utils::state::TerminateConnectionPlayerExt
  • In Event trait changed type Data: Send + Sync; to type Data: Event; this is so I could use is_cancelled if there's another way please suggest changes

Copy link
Member

@Sweattypalms Sweattypalms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found some stuff I would like to be changed. I'll try see if I can find more

src/lib/net/src/connection.rs Outdated Show resolved Hide resolved
@0xnim
Copy link
Contributor

0xnim commented Dec 10, 2024

This should possibly be mostly in lib

@GStudiosX2
Copy link
Author

GStudiosX2 commented Dec 10, 2024

This should possibly be mostly in lib

It's so small that I don't think it deserves a separate lib but possibly could move the key stuff I guess to a different crate but I probably won't do it

@GStudiosX2 GStudiosX2 marked this pull request as ready for review December 10, 2024 16:52
@0xnim
Copy link
Contributor

0xnim commented Dec 14, 2024

This could possibly be merged after authentication is implemented?

@GStudiosX2
Copy link
Author

This could possibly be merged after authentication is implemented?

It really doesn't matter but I want #140 to be merged before this so I might mark this back as a draft not 100% sure

@GStudiosX2 GStudiosX2 marked this pull request as draft December 16, 2024 08:31
@GStudiosX2 GStudiosX2 changed the title feat: Velocity Support Velocity Support + Player Entity Spawning Dec 16, 2024
This reverts commit 13bf0b5.
@GStudiosX2
Copy link
Author

GStudiosX2 commented Dec 16, 2024

That test commit wasn't supposed to be here 😭

edit: I don't think the code test commit pushed even worked and I want to figure out how to have the API and how to parse it right now anyway minimessage stuff I think want to be in a separate pr

@GStudiosX2 GStudiosX2 changed the title Velocity Support + Player Entity Spawning Velocity Support (#152 for player spawning) Dec 31, 2024
@GStudiosX2 GStudiosX2 changed the title Velocity Support (#152 for player spawning) Velocity Support Dec 31, 2024
@0xnim
Copy link
Contributor

0xnim commented Jan 2, 2025

This is on by default?

@GStudiosX2 GStudiosX2 marked this pull request as ready for review January 2, 2025 14:57
@GStudiosX2
Copy link
Author

Pretty much ready

@Eveeifyeve
Copy link

I am going to try this with two servers.

@Eveeifyeve
Copy link

Eveeifyeve commented Jan 19, 2025

Could you rebase your branch @GStudiosX2 on the latest master? As there was a big change to the the repo for proc macros.

@Eveeifyeve
Copy link

This will solve the github action failures.

@Eveeifyeve
Copy link

You also might want to consider squashing before merge as there is a lot of commits.

@GStudiosX2
Copy link
Author

You also might want to consider squashing before merge as there is a lot of commits.

Could you rebase your branch @GStudiosX2 on the latest master? As there was a big change to the the repo for proc macros.

I'm not sure why but I can't rebase so I'll just have to do a regular merge commit I think

@GStudiosX2
Copy link
Author

You also might want to consider squashing before merge as there is a lot of commits.

Isn't squashing something for when this pr is being merged by someone with merge perms?

@Eveeifyeve
Copy link

Eveeifyeve commented Jan 19, 2025

You also might want to consider squashing before merge as there is a lot of commits.

Isn't squashing something for when this pr is being merged by someone with merge perms?

Well it's ment to squash commits to keep the merge commits small that it's job.
Read more about this here: https://git-scm.com/docs/git-rebase

You also might want to consider squashing before merge as there is a lot of commits.

Could you rebase your branch @GStudiosX2 on the latest master? As there was a big change to the the repo for proc macros.

I'm not sure why but I can't rebase so I'll just have to do a regular merge commit I think

git pull --rebase origin master

@GStudiosX2
Copy link
Author

GStudiosX2 commented Jan 19, 2025

Could you rebase your branch @GStudiosX2 on the latest master? As there was a big change to the the repo for proc macros.

I'm not sure why but I can't rebase so I'll just have to do a regular merge commit I think

git pull --rebase origin master

Well anyway the fix wasn't merged lol
And I don't want to bring up termux right now I couldn't rebase on the GitHub UI here it talked about some conflicts not sure but a regular merge commit worked 🤷

And I have also fucked up all rebase merges I've done that has conflicts so I'd rather not do it

@Eveeifyeve
Copy link

Could you rebase your branch @GStudiosX2 on the latest master? As there was a big change to the the repo for proc macros.

I'm not sure why but I can't rebase so I'll just have to do a regular merge commit I think

git pull --rebase origin master

Well anyway the fix wasn't merged lol And I don't want to bring up termux right now I couldn't rebase on the GitHub UI here it talked about some conflicts not sure but a regular merge commit worked 🤷

And I have also fucked up all rebase merges I've done that has conflicts so I'd rather not do it

Well either way it's failing at:

error[E0277]: the trait bound `proc_macro2::TokenStream: proc_macro::ToTokens` is not satisfied
  --> src/lib/derive_macros/src/profiling/mod.rs:7:5
   |
7  | /     quote! {
8  | |         #[tracing::instrument(name = $name)]
9  | |         $item
10 | |     }
   | |     ^
   | |     |
   | |_____the trait `proc_macro::ToTokens` is not implemented for `proc_macro2::TokenStream`
   |       required by a bound introduced by this call
   |
   = help: the following other types implement trait `proc_macro::ToTokens`:
             &T
             &mut T
             bool
             char
             f32
             f64
             i128
             i16
           and 24 others
   = note: this error originates in the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)

@GStudiosX2
Copy link
Author

GStudiosX2 commented Jan 19, 2025

Yeah as I just mentioned the fix has not been merged yet either grab the fix and implement it or downgrade your rust compiler

I think it's fixed in like two prs right now not sure

I think it's #161 and #162

@ReCore-sys
Copy link
Collaborator

Yeah as I just mentioned the fix has not been merged yet either grab the fix and implement it or downgrade your rust compiler

I think it's fixed in like two prs right now not sure

I think it's #161 and #162

#162 got merged so is now fixed on main

@GStudiosX2
Copy link
Author

GStudiosX2 commented Jan 21, 2025

This merge was kinda fucked git is so annoying sometimes

@GStudiosX2
Copy link
Author

GStudiosX2 commented Jan 21, 2025

Where the fuck did the commit go to fix conflicts and merge 😭

@GStudiosX2
Copy link
Author

GStudiosX2 commented Jan 21, 2025

I hopefully fixed the merge though I forgot to remove those 5 duplicate commits but eh idrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants