Closed wxyz-abcd closed 1 year ago
I realized that we do not need such complicated logic. Original player objects can already be modified directly. From now on, onPlayerObjectCreated(playerObject) will be called whenever a new player object is created. No special action should be needed for destruction; if it is needed, we can use onPlayerLeave for that purpose. Other than that, if we need to define a new variable inside all player objects - we could need this especially inside onPluginActiveChange - , we can do that with a simple for loop. There is no need to complicate matters any more.
We need functions to register/unregister custom properties inside original player objects that will add/remove the property for each player that is currently in the room, and for each player that joins the room later. This will improve bots in performance and memory aspects, and also make life easier for people. We should not have to define seperate player lists and listen to PlayerJoin and PlayerLeave events inside each plugin.