                     point.data = data.gamePoint
 
             $rootScope.socket.on 'user:update', (data) ->
+                console.log data
                 if data.energy then $rootScope.energy = data.energy
                 $rootScope.$apply()
 ]

    '$http'
    'notify'
    '$q'
    ($rootScope, $state, $window, $http, notify, $q) ->
        $rootScope.$state = $state
        $rootScope.$http = $http



        # Handle websockets
        $rootScope.socket = io wsUrl

        fnTimeout = ->
            console.log $rootScope.socket.connected
            if !$rootScope.socket.connected
                $timeout ->
                    window.location.reload false
                , 3000
            else
                $rootScope.wsCheck = $timeout fnTimeout, 1000

        $rootScope.wsCheck = $timeout fnTimeout, 1000


        $rootScope.socket.on 'notification:send', (data) ->
            notify "Hello there "+data

