Opened 12 months ago
Last modified 5 months ago
#6804 assigned defect
Chat commands should only be sent to the relevant players.
Reported by: | Stan | Owned by: | phosit |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 27 |
Component: | Network | Keywords: | |
Cc: | Patch: | Phab:D5061 |
Description
Currently all commands are sent to all players, even the player sending them. See Phab:D4775.
For most commands this is intended as you need them to get the correct state. Chat commands however should only be sent to the relevant players.
I believe it should go as follows:
- Observer chat messages should only be sent to other observers. See also: #5816
- Ally message go to allies
- Enemy messages go to everyone you're not allied or neutral with
- Global message go to everyone.
This ticket does not cover the fact the server will receive all the messages, which would ideally be fixed by having dedicated trustworthy servers see Phab:D3973 and be encrypted see: #5467
Notice that the network code will somehow have to keep track of diplomacy changes, and this needs to be done carefully.
Change History (6)
comment:1 by , 12 months ago
Component: | Core engine → Network |
---|---|
Milestone: | Backlog → Alpha 28 |
Priority: | Should Have → Must Have |
comment:2 by , 12 months ago
Indeed that's a better design. I suppose one could change post network commands to accept either a list of players or a playermask (I think we use that somewhere else?)
- -1 => INVALID_PLAYER => All players
- 0000 0001 player 1 etc
- 0000 0010 player 2 etc
comment:3 by , 12 months ago
Would the "list of recipients" only be inside chat-messages or (optionally) in all messages-types?
comment:4 by , 12 months ago
I suppose all messages could have it. For instance map ping is not a chat command, yet you don't want to send it to players that are not either observers or allies.
comment:6 by , 5 months ago
Owner: | set to |
---|---|
Patch: | → Phab:D5061 |
Status: | new → assigned |
Whith this patch the server sends messages from the chat dialog only to the adressee and to the client who sent it.
Replying to Stan:
I don't think so. Currently, diplomacy-dependant chat works like this:
A fix to this ticket should change the design to the following:
This design change doesn't require the network to be aware of the diplomacy. It is an involved change that will need rewriting a bit of code, but the bulk of the changes will be limited to: