         @table
 
 
+
+
+
+
+
+
 class Clients extends Hash
     add: (uid, clientSocket) ->
-        console.log "adding client with uid: #{uid}"
+        #console.log "adding client with uid: #{uid}"
         client = new Client uid, clientSocket
         super uid, client
     remove: (uid) ->
-        console.log "removing client with uid: #{uid}"
+        #console.log "removing client with uid: #{uid}"
+
+        #remove all units with this uid
+        sprites = spriteList.getAll()
+        for id of sprites
+            sprite = spriteList.get id
+            spriteList.remove id if sprite.getUid() is uid
+        obj =
+            uid: uid
+            command: 'close'
+            text: 'user dropped'
+        client = clientList.get uid
+        socketController.sendAll obj, uid
         super uid
     get: (uid) ->
-        console.log "getting client with uid: #{uid}"
+        #console.log "getting client with uid: #{uid}"
         super uid
     getAll: ->
-        console.log "getting all clients"
+        #console.log "getting all clients"
         super()
 
 clientList = new Clients
+
+
+
+
+
+
+
+
 
 
 ###

        console.log "moving"


###
sprite class for storing sprite info
###
class Sprite
    constructor: (@uid, @id) ->
        x = 200
        y = 200
        team = 'light'
        @x = x
        @y = y
        @team = team
        obj =
            uid: @uid
            id: @id
            x: x
            y: y
            command: 'create'
            text: 'create new object'
            team: team
        socketController.sendAll obj
        console.log "adding sprite with uid: #{@uid} and id: #{@id} in sprite constructor"


    res.end "<h1>Welcome!</h1>"

server.listen PORT, IP_ADDRESS
#console.log 'listening'





###
container class for all clients
