You Died

You Died

225k Downloads

No Server communication

Bimi124 opened this issue ยท 3 comments

commented

Based on a very brief look at your code it looks like any processing of the death screen is done completely on the client side. This means that anyone modifying the client has complete control over the death screen's behaviour.

As you are adding timeouts and the options to hide some buttons it appears that you are trying to prevent players from doing some actions normally possible in vanilla. Even if you are not trying to do so server admins will probably use this mod for said purpose. This means you may want to implement some sort of communication between server and client.

My idea is as follows:
Whenever a player dies the server sends the death screen configuration within the death packet. The client then uses tis configuration to display the death screen while the server keeps track of disallowed actions. When the client attempts to send wrong packets the server simply opens the death screen again to resynchronise the client.
This would prevent players from cheating and add the ability to change the death screen based on different conditions.

Never trust the client. Ever.

commented

The death screen is completely client-side in vanilla, this just adds an animation before showing the vanilla one for novelty, there are no game mechanics tied to this.

Based on a very brief look at your code it looks like any processing of the death screen is done completely on the client side. This means that anyone modifying the client has complete control over the death screen's behaviour.

This is what this mod does, it modifies the death screen and has complete control over its behavior like any other mod could do.

As you are adding timeouts and the options to hide some buttons it appears that you are trying to prevent players from doing some actions normally possible in vanilla.

There are no options to control the death screen, as mentioned before it just shows an animation before showing the vanilla screen, it just delays the ability to press the "Respawn"/"Main Menu" buttons, not hiding them.

Even if you are not trying to do so server admins will probably use this mod for said purpose. This means you may want to implement some sort of communication between server and client.

What do you mean by preventing "actions" by server admins, what "actions" are you talking about and how would they do that as it's completely client-side and don't require a server install of the mod, it does nothing on a server.

Whenever a player dies the server sends the death screen configuration within the death packet. The client then uses tis configuration to display the death screen while the server keeps track of disallowed actions. When the client attempts to send wrong packets the server simply opens the death screen again to resynchronise the client.
This would prevent players from cheating and add the ability to change the death screen based on different conditions.
Never trust the client. Ever.

Vanilla sends a packet to the client to show the death screen when the player dies, when opening the death screen I add mine in between.
I have no idea what you are talking about with sending the wrong packet related to the death screen and cheating. This is no different from what vanilla does it or any other mod could do it.

commented

The buttons are just hidden until after the animation, as I said it's not meant to be a game mechanic to delay respawning,

The purpose of it is to add custom death screen that the player can add to any instance for novelty use and not some complicated anti "cheat" to skip a ~8 seconds death animation for some strange game mode where this specific mod it required.
If this was a concern there is probably a mod/plugin specific to handling this, if not it's probably created by the game mode creators.
If a mod would add a special death screen before mine that one would be shown after the animation rather then the vanilla one, for example in OldSchoolHardcore I replace the screen to change the buttons and it's fully compatible with this mod.

Like you said "Never trust the client" as any mod could replace this or modify it any way, better would be to block respawning until the time is over on the server and inform the player about it via a specialized mod.

commented

By "actions" I meant stuff like respawning. The buttans are hidden so they are essentially prevented. By "wrong packets" I mean packets like the respawn packet sent before the timer ran out.

Note: This is just a suggestion. Feel free to close the issue if you don't want to implement it.