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

Fix PlayerAuthInput Packet #33

Open
theaddonn opened this issue Aug 1, 2024 · 6 comments
Open

Fix PlayerAuthInput Packet #33

theaddonn opened this issue Aug 1, 2024 · 6 comments
Labels
Bug Something isn't working C-Proto Category: Protocol Help wanted Extra attention is needed P-High Priority: High

Comments

@theaddonn
Copy link
Member

The packet does mostly work, but other cases such as when inventory transactions or block actions should be read additionally are not properly handled

@theaddonn theaddonn added Bug Something isn't working Help wanted Extra attention is needed C-Proto Category: Protocol P-High Priority: High labels Aug 1, 2024
@theaddonn theaddonn moved this to Todo in Roadmap RAstra Aug 1, 2024
@ismaileke
Copy link
Contributor

This is irrelevant, but

PocketMine->BedrockProtocol

$out->putUnsignedVarInt($this->interactionMode); <----
if($this->playMode === PlayMode::VR){
    assert($this->vrGazeDirection !== null);
    $out->putVector3($this->vrGazeDirection); <----
}
let play_mode = match VAR::<u32>::proto_deserialize(stream)?.into_inner() {
0 => PlayMode::Normal,
            1 => PlayMode::Teaser,
            2 => PlayMode::Screen,
            3 => PlayMode::Viewer,
            4 => {
                let vr_gaze_direction = ProtoCodec::proto_deserialize(stream)?; <-------------------------------

                PlayMode::Reality(vr_gaze_direction)
            }
            5 => PlayMode::Placement,
            6 => PlayMode::LivingRoom,
            7 => PlayMode::ExitLevel,
            8 => PlayMode::ExitLevelLivingRoom,
            other => {
                return Err(ProtoCodecError::InvalidEnumID(
                    other.to_string(),
                    String::from("PlayMode"),
                ))
            }
        };
        let interaction_model = InteractionModel::proto_deserialize(stream)?; <--------------

Shouldn't you put vr_gaze_direction after the interaction_model variable?

If I'm wrong, it's probably due to my rust knowledge. 🛠️

@theaddonn
Copy link
Member Author

You are completely correct!
Thanks for pointing it out
image

@theaddonn
Copy link
Member Author

if would be really helpful if someone could do a pr for this!

@theaddonn
Copy link
Member Author

theaddonn commented Aug 24, 2024

One fix has been implemented #47

but other cases such as when inventory transactions or block actions should be read additionally are not properly handled

This is still an issue though

@RadiatedMonkey
Copy link
Contributor

One fix has been implemented #47

but other cases such as when inventory transactions or block actions should be read additionally are not properly handled

This is still an issue though

What is the exact issue here? I should have a fully working PlayerAuthInput packet in my software so I could take a look at this and see if I can fix it

@theaddonn
Copy link
Member Author

Well, Block actions and Inventoty actions are not handled at all right now. They should be variants with extra structs that store the data in the InputData enum...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working C-Proto Category: Protocol Help wanted Extra attention is needed P-High Priority: High
Projects
None yet
Development

No branches or pull requests

3 participants