Matt-Crow / GearBox

A C# MMORPG-like game.
0 stars 0 forks source link

UiState #110

Closed Matt-Crow closed 2 months ago

Matt-Crow commented 2 months ago

Instead of doing all the diffing in each class, maybe make a UiState class which represents what the UI should look like for a given player. At the end of each frame, recalculate the current UiState and compare it to the previous UiState served to the player. Fields which haven't changed should be treated similarly to MaybeChange. Convert the UiState to JSON and send it to the client.

Matt-Crow commented 2 months ago

Implement this for the currently open shop first

Matt-Crow commented 2 months ago

Known issue: first UI state doesn't send

Matt-Crow commented 2 months ago

Currently errors with "cannot handle area update without area init - known issue is probably causing this