Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b467d3a
commit 6a9b17b
Showing
1 changed file
with
7 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6a9b17b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like special-casing the spectator case within, potentially, every component used by a client. That is not acceptable. Spectator handling must be outside the regular component logic, if at all possible. I will need to disucss the best way to do this with @Kangz.
Please revert – not only should we avoid workarounds within CBSE whenever possible (we'll end up re-refactoring our own code instead of progressing with the conversion), but also you can't just change the component's
maxHealth
field withinHandlePrepareNetcode
, which is only ever supposed to export the component state to the network, not modify the component. I prefer to keep spectating broken and improve on the general client/spectator handling for next relase.6a9b17b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely will revert when we have an appropriate alternative. Currently, spectator is handled by copying over the player who is being spectated's playerState_t. perhaps something analogous can be done with the entity?
6a9b17b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's all that is necessary, we could add a
SpectatorEntity
with aSpectatorComponent
that does this insideHandlePrepareNetCode
.Is there a lazy way to turn this thread into an issue? 😛
6a9b17b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, the issue with that is that HandleNetCode could be executed N times, where N is the number of times the player is being spectated. It would be annoying having to iterate, store specs somewhere else, and then iterate over the specs, which is further complicated by the fact that with stickySpec enabled, spectators can spectate spectators...
6a9b17b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you misread my post. We certainly should not have multiple clients attached to any one entity or component. I was suggesting to add a
SpectatorEntity
used by spectating clients that would have aSpectatorComponent
(and not much more) that would copy the networked state from the client/spectator being spectated to its own entity's (= theSpectatorEntity
's) networked state.