vranki / ExtPlane

Plugin for X-Plane flight simulator which allows reading and writing simulation properties
138 stars 44 forks source link

Commands being executed multiple times #59

Open teknolik opened 4 years ago

teknolik commented 4 years ago

If many commands are sent at the same time, it appears that under certain conditions ExtPlane ends up executing them multiple times.

This is especially true if the simulator is under load - especially using VR, in my experience.

For example, in the Zibo, sending 5 MCP Speed up commands can result in up to 25-30 commands being executed in the sim.

A workaround to this is to add a delay for each command of, approximately, 100ms. This means that actions happen slower but are more reliable.

I have tested this by using my own work utilising ExtPlaneNet as well as dropping the commands into a direct telnet connection.

jfjoubert commented 3 years ago

Hi, I have noticed the same thing. I'm calling a command "begin" and quite frequently there seem to be multiple "begin" commands that were executed in XPlane. If I manually "end" the command a couple of times then eventually XPlane will show that the command is not active anymore. I tried to trace it with Wireshark but had no luck in determining why this is happening. My current workaround was to write a separate plugin that will handle commands via UDP.

vranki commented 3 years ago

Do you see any output in X-Plane log.txt, console if you run x-plane or the TCP stream?

The related code is at https://github.com/vranki/ExtPlane/blob/4f823d45b83fc0934b722f0487cf44605b3dc3c2/extplane-server/tcpclient.cpp#L242 and https://github.com/vranki/ExtPlane/blob/4f823d45b83fc0934b722f0487cf44605b3dc3c2/extplane-plugin/xplaneplugin.cpp#L244 but I can't see any obvious issues in it.

jfjoubert commented 3 years ago

Hi, I did go through the code and I also couldn't see any obvious issues. I'm just using a telnet session on my Windows pc to connect to ExtPlane. I can see no entries in the log or console indicating any issue either. Maybe it's just something weird happening on my side.