FAForever / server

The servercode for the Forged Alliance Forever lobby
http://www.faforever.com
GNU General Public License v3.0
67 stars 62 forks source link

Redesign party commands #600

Open Askaholic opened 4 years ago

Askaholic commented 4 years ago

It may be better to send party commands using a single command with many subcommands than our current implementation of having a separate command for every action.

We could go with a "polymorphic" approach:

{
    "command": "party",
    "action": "invite",
    "recipient_id": <player_id>
}

Or more of a "compositional" approach:

{
    "command": "party",
    "action": "invite",
    "data": {
        "recipient_id": <player_id>
    }
}

The compositional approach has a little more boilerplate built into the message, but it feels cleaner to me.

Sheikah45 commented 2 years ago

I would vote for the polymorphic as all the other commands follow this format. And it would be weird to start mixing them up now.