Fix client joined/left function.
Needs refactoring, especially on the clientside.