I have no experience with server/client programming, but from what I understand is that the client sends everything to the server and the server relays everything to other clients, which are in close proximity to the origional client.

In the event of lag, you'll find that the server isn't able to process all information fast enough. As a result you'll see characters running into walls or some odd direction and, after a few seconds, jump back to their correct location as new information from the client is processed.


As for sorting, I think the best option would be to write your own sorting routine. ie, before drawing, write them to a list, sort them and then draw them.