I got tired of schlepping around a Players variable that had no meaningful way to be updated by implementers of the ow_zone behavior. Instead I simplify the behaviour by moving the player information to an ETS table that can be accessed from both the zone gen_server and the callback module.
This PR removes players from the local state of the ow_zone server and adds a new ow_player_reg module that provides an API for the #player{} record and provides kv-store-like operations for the registry. The registry has a simple get/1, put/2, list/1, delete/1, and update/1 API.
I expect ETS performance to be good enough ™️ for now with default options. To be profiled later if it causes problems.
I got tired of schlepping around a
Players
variable that had no meaningful way to be updated by implementers of theow_zone
behavior. Instead I simplify the behaviour by moving the player information to an ETS table that can be accessed from both the zone gen_server and the callback module.This PR removes
players
from the local state of the ow_zone server and adds a newow_player_reg
module that provides an API for the#player{}
record and provides kv-store-like operations for the registry. The registry has a simpleget/1
,put/2
,list/1
,delete/1
, andupdate/1
API.I expect ETS performance to be good enough ™️ for now with default options. To be profiled later if it causes problems.