This feature request is a bit of a pain to implement
Server side supported match check
While I CAN check, with every event being sent from the server, if another character has a matching name (and how much it matches). And then embed this info as part of the event, so clients could format it correct. Depending on event, the scope for the match check would be different:
-
Room events - Say, describe, pose, ooc, whisper, lead, etc. would match against awake characters in room.
-
Global events - Message, mail, summon, etc. would match against awake characters.
This would be the “correct” way.
But it is a pain.
And it becomes even more painful when events are sent from other microservices, such as the mail
service or the roller
service want to send events, as they need to request this match info from core
service (which handles characters and rooms).
Client side match check
A simpler solution would be to let the client do it.
That means - when the client receives an event, it checks against the InRoom list or the Awake list (depending on event type) whether or not there are other characters with matching names.
This would remove a lot of the additional complexity that otherwise would end up in the backend.
BUT…
It would not be as reliable.
The InRoom and Awake list is not necessarily in perfect sync with the stream of events.
Example
- You connect through mobile and go to the park
- You switch tab for a while. The mobile is temporarily disconnected
- Two people named
Lotus
appears and starts talking
- You switch back to the game tab on the mobile device.
- The client reconnects and resynchronizes
5.1. The client fetches missed events
5.2. The client fetches and updates the InRoom list.
- Depending on the order of 5.1 and 5.2, the communication events between Lotus A and Lotus B might be correctly or incorrectly tagged as matching names.
The question is; would that be too much of an issue?
In most cases, client side detection would be fine. But in some racing cases, and resynchronization cases, it may tag events incorrectly.