my history is hazy, but I remember the chat protocol was a good help when doing the handshake on a new user entered a group session with multiple users.
the merging user actions basically worked by keep a revision number of every object they store, when you make a change you broadcast with an incremented revision, if you recieve an out of order revision you ignore and the broadcaster needs to revert their change on receiving an in order change, this means you need to ensure the order of the message to each client so everyone gets the changes from A before they get it from B, otherwise one might keep A's change and ignore B's, and another will keep B's change and ignore A's
you can trade off memory with the granularity of what you store revisions against, so you can store a revision for the square X, or for the width of square X, a finer granularity allows people to change the background color and move it at the same time, if you store the revision against the square as a whole then those changes conflict.
again this was quite a while ago so might not be the best advice. but hope it helps