Night-Stalkers / lm-scripts

PySnip Scripts
GNU General Public License v3.0
8 stars 4 forks source link

Teleport not working as expected in clients other than Openspades #10

Closed hourai-dev closed 4 years ago

hourai-dev commented 4 years ago

Currently, with the new teleport rework, teleport works by using V + E (sneak plus sample block color), at least in Openspades. Upon further testing, I discovered that using that same combination doesn't work in BetterSpades. In order to trigger teleport in BetterSpades, you need to switch to the block tool and THEN you can use the combination. I already pinpointed what is the issue.

Serverside, the server only knows when the player does the "sample block color" action when the client sends the _setcolor contained packet to the server. Different clients handle this differently, and that's where the problem lies. For example, Openspades sends the set_color when pressing the sample block color with any tool (and when changing color manually, however that is not related to this issue). However, BetterSpades only sends this packet when you are holding the block tool, and this is why teleport only works when holding the block tool. The server has no way of knowing when the user presses the sample block button, but it knows when the client sends the _setcolor packet.

I doubt there's a way to improve this serverside, but I'll be investigating if it's possible to fix this issue serverside. Clientside, changing the way the clients handle the sample block color action is easy, however, this is not a viable solution as it would involve modifying the client source code and doing pull requests and what not.

As a final word, it would be helpful if someone tested with other clients the new teleport system, I already tested with BetterSpades (issue) and Openspades (works).

SmokeysDev commented 4 years ago

Just tried it on Build & Shoot client and didn't work for me, but worked for me on OpenSpades (a couple days ago at least)

hourai-dev commented 4 years ago

I added a check to the _on_colorset hook function used by the teleport (b416bb0). This makes it so that if the player is running Openspades, they have to obligatorily switch to the block tool in order to teleport. This way it works the same way as in the vanilla AoS client. Also, having to switch to the block tool in order to teleport makes the gameplay more "balanced" in a way, since you can't just spam teleport with your weapon and start going to town right away, and obviously, it also removes the "advantage" Openspades users had when using teleport.