beyond-all-reason / beyond-all-reason/RecoilEngine
Check for duplication in DemoRecorder usage
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
Looks like both `clientNet` and `gameServer` singletons point to demo recorders. Shouldn't there be only one demo recorder?
https://github.com/beyond-all-reason/RecoilEngine/blob/9fbd0f1b78cdfab6c54d2d558a6b492529875e10/rts/Net/Protocol/NetProtocol.h#L123
https://github.com/beyond-all-reason/RecoilEngine/blob/9fbd0f1b78cdfab6c54d2d558a6b492529875e10/rts/Net/GameServer.h#L290
Figure out what is going on:
* if they both point to the same object, perhaps the raw ptr could be removed and its use replaced with the unique ptr.
* if they point to different objects, figure out whether this makes sense (why would the recordings ever be different?) or if it's just duplication (in which case, remove it).
* if this makes sense after all, leave a line or two of comment at each of the two vars documenting the differences.
Contributor guide
Research direction
Start by comparing the DemoRecorder declarations in rts/Net/Protocol/NetProtocol.h and rts/Net/GameServer.h, then trace their initialization and uses to determine whether clientNet and gameServer refer to the same object. Finish by removing duplicate ownership or documenting the distinct roles at both variables, as appropriate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev, networking
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100