What I would personally do, is store a list of all the players currently online, as Player objects.
Each player object would store a location.
Every time a player moves, the server would use pythagoras’ theorem to detect which players were near by - then store the pointers to THOSE players in another list INSIDE THE PLAYER OBJECT.
When it came to updating the player’s position, you’d loop through that list and send the data to each ‘nearby’ player.
Forgive me in this next section if I get the maths wrong:P
Categorising it by islands might be too large for any server you could afford to handle (Not being rude or anything). If each island had 200 players on it, then for each player you’d have to send them the data of the other 199 players. If the size of each data packet was 128 bytes, plus like 40 for TCP overhead (or 20 for UDP) you’d end up with
(128 + 40)*(n - 1)*n
Where n is the number of players on the island.
Going back to the assumption that you have 200 players on an island, then you have to send 6686400 bytes of data per update.
If you’re updating this 20 times a second or something, that becomes 133728000 per second!! or 133MB/s ish, which is pretty huge. Not only that but the server must maintain this for multiple islands.
If these players were spread out though, my above method would sacrifice a small amount of CPU power to reduce that by quite a bit.
Though I might have these numbers wrong:)
EDIT:
Thinking of it 128 bytes might be quite a large size for a packet. regardless, you still have the 40 byte overhead, so you’ll end up with at least 64 bytes or something