ImmersiveMC

ImmersiveMC

683k Downloads

Cleanup Trackers

hammy275 opened this issue ยท 1 comments

commented

The different types of trackers in ImmersiveMC's codebase are a mess. This needs to be cleaned up, mainly by having AbstractVRHandsTracker and AbstractVRHandTracker both extend AbstractTracker and use that system, rather than the former extending the latter, which is itself especially atrocious.

There should also be an AbstractTrackerWithCooldown or similar that handles all the cooldown-related tasks, so I don't have to replicate that code a dozen times.

commented

With the new BottleAndBucketTracker, this situation is actually even worse now, since I needed that tracker to be available on both logical sides.

Given everything in the codebase, here's everything that should be changed:

Abstract Classes

  • AbstractTracker should have inbuilt cooldown support. Nearly every tracker uses cooldowns, and it's only one empty HashMap if we don't end up using it.
  • AbstractVRHandsTracker should be rewritten to be based directly on AbstractTracker, and should be moved to common. The LastTickData can be filled as it already is by the server, and can be taken from LastClientVRData on the client.
  • AbstractVRHandTracker should be rewritten to extend AbstractVRHandsTracker, and should be moved to common.
  • ServerTrackerInit#globalTrackers should be killed off.

Implementations

  • RangedGrabTrackerServer should find the info for the provided ticked player. There have been crashes before where I've accidentally used the player parameter, and it's downright stupid that I built a system where it's unused anyways.
  • Rewrite BottleAndBucketTracker to be a AbstractVRHandTracker.
  • Remove all the tracker-specific cooldown management, since it will now be handled in AbstractTracker.
  • Remove LastVRDataTracker, and put its logic directly into ClientLogicSubscriber. Since it's not directly gameplay-related, nor an abstraction for trackers to build off of, it shouldn't be some form of AbstractTracker.