You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Need a background task to prune the online players for the PS2 worlds. We also need to update handlers to keep this information fresh as possible, using a "last seen" unix timestamp. The task will run through the online players and check their last online times, and if it's over a certain threshhold (currently thinking 10 mins) remove them from being online.
I don't think it needs to be its own service. However I would put a list like that into it's own class something like DecayingSet and use that. With some clever use of a WeakSet and a rotating array of normal Sets you can create better performance without having to iterate over all elements.
In general use Set and Map over Array and Object in these kind of cases. They have better performance as I believe it implements a heap under the hood(though don't quote me on that). Also WeakSet and WeakMap are pretty cool as they do not block the garbage collector from freeing memory.
Need a background task to prune the online players for the PS2 worlds. We also need to update handlers to keep this information fresh as possible, using a "last seen" unix timestamp. The task will run through the online players and check their last online times, and if it's over a certain threshhold (currently thinking 10 mins) remove them from being online.
Originally posted by @Maelstromeous in #23
The text was updated successfully, but these errors were encountered: