L
L
littleguga2016-05-19 18:35:10
JavaScript
littleguga, 2016-05-19 18:35:10

Does it make sense to only send a message to certain users using socket.io?

There is a certain game, it has players and spectators. Is there a difference in these approaches:

1. We divide players and spectators into different namespaces/rooms and send events for players and spectators to their own namespace/room.
2. Players and spectators in the same namespace and in the same room, but they do not have listeners for a certain type of event (for example, players do not have a handler for the "score" event, but spectators do) Questions

:
approach? On how many clients will it be noticeable?
2. Are there any pitfalls with the 2nd approach? (intersects with the first question)
3. The first 2 questions, but considering that in order to change the logic of the whole game from 2 approaches to the first, you need to rewrite the lion's share of the project.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
catHD, 2016-05-20
@littleguga

The main thing is that the viewer does not have information with the help of which he could influence the gameplay (tell the player insider information).
That is, the viewer can simply write the position / state of the enemy in the viewer chat, and any player will be able to read it. But this is more the logic of the gameplay itself.
Traffic jams are minimal.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question