The Wayback Machine - https://web.archive.org/web/20200914055755/https://github.com/delaford/game/issues/27
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
naknode opened this issue Mar 6, 2018 · 2 comments
Open

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

naknode opened this issue Mar 6, 2018 · 2 comments

Comments

@naknode
Copy link
Member

@naknode naknode commented Mar 6, 2018

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.

@naknode naknode added this to the v0.0.1 milestone Mar 6, 2018
@naknode naknode added this to To Do in Networking via automation Mar 6, 2018
@naknode naknode added this to To Do in Player Engine via automation Mar 6, 2018
@naknode naknode pinned this issue Dec 31, 2018
@naknode
Copy link
Member Author

@naknode naknode commented Jan 1, 2019

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.

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

@erickcelio erickcelio commented Nov 25, 2019

I can work on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.