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

ReplayMod Compat #317

Merged
merged 1 commit into from
Jan 21, 2024
Merged

ReplayMod Compat #317

merged 1 commit into from
Jan 21, 2024

Conversation

Smartin-b
Copy link

Changed Logic so Animation Paket is also send to the client it originated from. Clients now disregard Pakets about themselfs. This makes replaymod compatible since it simply records all Pakets the Client recieved.

@Smartin-b Smartin-b mentioned this pull request Dec 30, 2023
@ZsoltMolnarrr
Copy link
Owner

Hello!
Thank you for the contribution.
I will review and test this as soon as I can.

}
} catch (Exception e){
e.printStackTrace();
}
Copy link
Owner

Choose a reason for hiding this comment

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

As far as I understand, the changes in this file are the ones to truly fix the problem. Specifically Line 68-75.
Would it be possible to put this into an mod install check, and still have it work in every scenario?
Like

if(Platform.isModInstalled("replay-mod-id") {
   ...
}

Copy link
Author

Choose a reason for hiding this comment

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

No. the way Replay mod works is by rolling back the packets send to the client by the server.
Checking if Replay Mod is installed on the server is kinda pointless, it would only fix the issue in singleplayer.

Copy link
Owner

Choose a reason for hiding this comment

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

Okay.
What I am worried about is: network delay ping pong causing the attacking player's attack animation to played twice, with ping pong delay, resulting in visual glitch.

I understand that this packet sending cannot be conditional.

Can we make the client side interpretation of this packet conditional (based on ReplayMod installed)?

Copy link
Author

@Smartin-b Smartin-b Jan 14, 2024

Choose a reason for hiding this comment

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

we could, but i see no real purpose.
I changed the logic from the server refuses to send the client the packet about the animations
to the client ignoring the packet that regard themselfs so the animation is not played twice
line 19-21 in ClientNetwork

Copy link
Owner

Choose a reason for hiding this comment

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

That seems like a good change, is the compatibility still satisfied with this code?

Copy link
Author

Choose a reason for hiding this comment

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

it is, sorry for the late response, i didnt change anyhting, that was in the PR from the start

Copy link
Author

Choose a reason for hiding this comment

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

i should also mention #323 does pretty much exactly the same thing, this PR just has a comment and surrounds the netcode with a try/catch block since BC does that aswell in the loop

@ZsoltMolnarrr
Copy link
Owner

Thank you for the contribution!

@ZsoltMolnarrr ZsoltMolnarrr merged commit 62e8070 into ZsoltMolnarrr:1.20.1 Jan 21, 2024
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.

None yet

2 participants