def deleteDeadUser():
    for key, value in __aliveUserDict__.items():
        if((datetime.datetime.now()-value["visitTime"]).seconds > __aliveTimeInterval__):
	    try:
            	del __aliveUserDict__[key]
            	deviceOperation.deleteDeviceByUUID(key.spilt("%")[0])
            	return key
	    except:
		return key
    return None
def userScoreListRefresh():
    if (__userScoLRefTime__-datetime.datetime.now()).seconds<__userScoLRefInterval__:
        return __userScoreList__
    
    __userScoreList__=[]

    for key, value in __aliveUserDict__.items():
        if((datetime.datetime.now()-value["visitTime"]).seconds > __aliveTimeInterval__):
	    try:
	    	del __aliveUserDict__[key]
            	deviceOperation.deleteDeviceByUUID(key.spilt("%")[0])
            	continue
	    except:
		pass
            
        value["scoreForRank"]=value["score"]
        __userScoreList__.append(value["scoreForRank"])

    return sorted(__userScoreList__, reverse=True)