Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat message should only appear for user's who are "close" to hear it #27

Open
djasnowski opened this issue Mar 6, 2018 · 5 comments
Open
Labels
backend Node.js-related or anything to do in the server bug "Hey, that's not suppose to happen." easy Issue/feature that is easy to fix or implement. Good for 1st-time contributors. good first issue Easy issues that are excellent for people wanting to get in meat of the code. Hacktoberfest help wanted Issues that we need multiple opinions on. medium priority It would be awesome if this was done, but not very critical. player Features/issues relating to the player of Delaford. web socket WebSocket issues and discussion.
Milestone

Comments

@djasnowski
Copy link
Member

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.

  • Player 1 logs in. Goes to (24, 20).
  • Player 2 logs in. Goes to (243, 93).
  • Player 1 says "Hello world."
  • Player 2 sees "Player 1: Hello world."

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.

@djasnowski djasnowski added bug "Hey, that's not suppose to happen." help wanted Issues that we need multiple opinions on. good first issue Easy issues that are excellent for people wanting to get in meat of the code. player Features/issues relating to the player of Delaford. easy Issue/feature that is easy to fix or implement. Good for 1st-time contributors. medium priority It would be awesome if this was done, but not very critical. backend Node.js-related or anything to do in the server web socket WebSocket issues and discussion. labels Mar 6, 2018
@djasnowski djasnowski added this to the v0.0.1 milestone Mar 6, 2018
@djasnowski djasnowski pinned this issue Dec 31, 2018
@djasnowski
Copy link
Member Author

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.

@djasnowski djasnowski unpinned this issue Feb 26, 2019
@erickcelio
Copy link

I can work on that?

@Ankaa19
Copy link

Ankaa19 commented Oct 23, 2024

Hello,
I would like to work on this issue. Could you assign me?
Than you a lot.

@david671-del
Copy link

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/)

@david671-del
Copy link

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/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Node.js-related or anything to do in the server bug "Hey, that's not suppose to happen." easy Issue/feature that is easy to fix or implement. Good for 1st-time contributors. good first issue Easy issues that are excellent for people wanting to get in meat of the code. Hacktoberfest help wanted Issues that we need multiple opinions on. medium priority It would be awesome if this was done, but not very critical. player Features/issues relating to the player of Delaford. web socket WebSocket issues and discussion.
Projects
None yet
Development

No branches or pull requests

5 participants
@djasnowski @erickcelio @david671-del @Ankaa19 and others