christerk / ffbclient

HTML5 ffb client
MIT License
9 stars 4 forks source link

Architecture - ModelChange event should be possible to disable by a command #3

Closed christerk closed 6 years ago

christerk commented 6 years ago

Atm, every ClientCommand message will trigger a re-rendering. Should be possible to disable the re-render for certain types of ClientCommands.

SanityResort commented 6 years ago

Are you talking about ModelChanges or Commands like ModelSync?

christerk commented 6 years ago

See enqueueCommand in controller.ts

SanityResort commented 6 years ago

Ah, ModelChanges. As far as I understood each ModelSync contains a number of ModelChanges which should be applied together. So it would only require a rerender for each ModelSync. Something like a CompoundCommand could be useful that simply wraps all ModelChanges in one ModelSync.

Until now I only looked at the replay use case, it might be different for spectating.

christerk commented 6 years ago

Quite possibly true. Right now, the system sends each ModelChange individually and triggers a ModelChanged event. Grouped messages may be a good idea. Note that this may impact the CommandHandler as well.

christerk commented 6 years ago

Feel free to open a new issue to allow grouped model changes.

SanityResort commented 6 years ago

Probably makes sense to solve #6 before taking on this one.