JNechaevsky / international-doom

Small, functional and simple source ports, created with help, efforts and bits of code from people around the world.
https://jnechaevsky.github.io/inter-doom/
GNU General Public License v2.0
30 stars 2 forks source link

Deny all player control events while active menu in multiplayer #15

Closed JNechaevsky closed 1 year ago

JNechaevsky commented 1 year ago

This fixes player movement / camera rotation while active menu in multiplayer game or -solo-net mode. Seems to be safe for real multiplayer and demo recording/playback while multiplayer.

@fabiangreffrath, @rfomin, might be useful for Woof/Crispy Doom as well, but I have a hunting suspicion that it can be achieved easier or... Safer? Probably via M_Responder as Roman suggested, but I have no luck to properly deny mouse events there.

rfomin commented 1 year ago

But why is it not higher in the function? Maybe it is possible to return after cmd->consistancy is set?

rfomin commented 1 year ago

Also, maybe the menu will disable input for all players in a netgame.

JNechaevsky commented 1 year ago

But why is it not higher in the function? Maybe it is possible to return after cmd->consistancy is set?

Ah, true, I was thinking that some initials like speed/forward/side should be initialized first, but looks likes it is unnecessary. By moving this condition right below cmd->consistancy line it still works fine, netgame is still working fine between ID<->Woof 12.0 (in vanilla compatibility mode, of course).

Also, maybe the menu will disable input for all players in a netgame.

This should be ideal and feels right, but no luck yet. I need to investigate farther, for now tricks in M_Responder isn't working as they should: mouse wheel is still changing weapons and so on.

JNechaevsky commented 1 year ago

Nope, still no luck, and in worst case I'm getting non-working menu. Maybe G_BuildTiccmd is not that bad place after all, as we dealing with movement controls and not menu controls. :thinking:

JNechaevsky commented 1 year ago

I think it's fine all around. Made a final test by connecting ID client to Woof server and tried to finish MAP04 while spamming ESC key. No problems: mpmoves.zip (green player is Woof, gray is ID).