hammy275 / mc-vr-api

An API to allow mod developers to see VR player data from Vivecraft.
GNU Lesser General Public License v3.0
8 stars 0 forks source link

Broken in Multiplayer (Sometimes) #48

Open hammy275 opened 4 months ago

hammy275 commented 4 months ago

ImmersiveMC Discord server has a support thread where the issue occurred. It's the "the server didn't have mc-vr-api installed" chat message being shown.

hammy275 commented 4 months ago

Of note, didJoinPacket is not set properly. After first login, this is set to true, meaning it never gets set back to false, since that's done from onLogin(), which is only called if didJoinPacket is false.

hammy275 commented 4 months ago

That said, I think this could be solved by making the login flow make more sense. Instead of C-->S-->C, we just do S-->C. Or, more simply, when a client logs in, the server immediately gives it a VersionSyncPacket to act on.

The logic for displaying the error can be simplified as well. We start counting up our timer, stopping it at >200, displaying the message at exactly ==200. Receiving the VerisonSyncPacket would set this number to 201.

hammy275 commented 4 months ago

We should also display a message if MC VR API is detected after the message saying it wasn't found is displayed, in case MC VR API is there but only after a longer delay.

hammy275 commented 4 months ago

Old MC VR API versions should be fine with the new packet flow, though even if not, the API isn't changing, so this will be a patch version bump.

hammy275 commented 4 months ago

The simplification is done! Need to port the above commit to the other versions

hammy275 commented 4 months ago

Reopening since it wasn't fully fixed (https://discord.com/channels/1061675558347489343/1247140257141362719/1247140257141362719)