What are various ways of handling different version clients in multiplayer games? For example, when there's an update, some games allow you to play with people who have a different version of the client. How is this handled?
The first thing is that you need some way of communicating a version number, so the first thing a client should do is probably send its current version so that the server can take action accordingly. You may be able to embed the version number within another message, depending on your protocol.
Most games probably just reject older clients, and force them to upgrade first. Even if the code is unchanged, the presence of older data may mean the game is essentially unplayable. And if the underlying network protocol changes, older clients may not be able to connect at all. It's therefore useful to have a robust version check that doesn't rely directly on this protocol, otherwise people can't even connect to find out that they need to patch up.
The problem is not in allowing different versions of clients to play with each other as such, since usually all communication goes via the server. Only the server needs to worry about versioning, not each client. The developer can have the server note the version of each client and handle them accordingly.
The issue is that a new version usually implies a new or changed feature in some sense, and an old client won't have the information to be able to use that feature. The server can take care to avoid sending messages about this feature to older clients. Or, if you have a protocol that can handle it, you can send the messages anyway and the client can ignore any it doesn't understand.