We used to label tracks individually, in a view to using the labelling
for simulcast. Since then, the WebRTC community has converged on a
different strategy, where multiple tracks share a single mid and
are labelled with the rid extension.
We now label whole streams, which is simpler, and use the track's
kind (and, in the future, the rid) to disambiguate. This changes the
protocol in two ways:
* in offers, the "labels" dictionary is replaced by a single "label"
field; and
* the syntax of the "request" message has changed.
We used to signal connection replacement by reusing the same connection
id. This turned out to be racy, as we couldn't reliably discard old
answers after a connection id was refused.
We now use a new id for every new connection, and explicitly signal
stream replacement in the offer message. This requires maintaining a
local id on the client side.
Split the id field into id and source, where source indicates the sender
of the message and id the entity being sent. Remove the label request,
just use the offerer's username. Maintain the username within the
ServerConnection, this removes a parameter from some methods.
The login message is replaced with handshake, which only carries
the client id. Username and password is now in the join message.
Permissions is replaced with joined.