Open djasnowski opened 6 years ago
It seems like a re-work of the Socket
class is in order. We can extend this to the Player
class so that way we don't need to statically call it and already have some vital information (like player's socket ID, x, y, etc.)
For example, player.emit
to send back to only player's client and player.broadcast
to send to all (in viewport).
The socket_id
will really help de-clutter the current Socket.emit
method that we currently do at the moment. Because right now it's like:
Socket.emit('CHAT:MESSAGE', {
data: { type: 'normal', text: data.item.examine },
player: {
socket_id: this.player.socket_id,
},
});
And then every time we do Socket.broadcast
, to only have to broadcasted to those in the viewport. Because we are not going really broadcast to every single player.
I can work on that?
Hello, I would like to work on this issue. Could you assign me? Than you a lot.
To ensure only "close" users receive chat messages, consider implementing a geo-targeting feature. This will allow you to display relevant content, such as "budget truck rentals near me," only to users in your vicinity. You can also provide a direct link for convenience: [budget truck rentals near me]](https://pickuprenttruckuae.com/)
To ensure chat messages appear only for users who are "close," implement a geo-targeting feature. This way, you can display relevant content like "budget truck rentals near me." Check out more at [budget truck rentals near me(https://pickuprentuae.com/)
Do you want to request a feature or report a bug?
bug
What is the current behavior?
When a user types on chat, everyone in the map can see it.
If the current behavior is a bug, please provide the exact steps to reproduce.
What is the expected behavior?
Player 2 should only see a message from the player who is saying a message if they are theoretically in their viewport. So 15x11 tiles should be their chat range.