def addToken(self, userID, ip="", irc=False, timeOffset=0, tournament=False): """ Add a token object to tokens list :param userID: user id associated to that token :param ip: ip address of the client :param irc: if True, set this token as IRC client :param timeOffset: the time offset from UTC for this user. Default: 0. :param tournament: if True, flag this client as a tournement client. Default: True. :return: token object """ userExists = glob.tokens.getTokenFromUserID( userID ) #maybe user connected from irc or tournament, we can't increment in this way newToken = osuToken.token(userID, ip=ip, irc=irc, timeOffset=timeOffset, tournament=tournament) self.tokens[newToken.token] = newToken if not userExists: glob.redis.incr("ripple:online_users") return newToken
def addToken(self, userID, ip = "", irc = False, timeOffset=0, tournament=False, ignoreDM = False): """ Add a token object to tokens list :param userID: user id associated to that token :param ip: ip address of the client :param irc: if True, set this token as IRC client :param timeOffset: the time offset from UTC for this user. Default: 0. :param tournament: if True, flag this client as a tournement client. Default: True. :return: token object """ newToken = osuToken.token(userID, ip=ip, irc=irc, timeOffset=timeOffset, tournament=tournament, ignoreDM=ignoreDM) self.tokens[newToken.token] = newToken if not tournament and not irc: glob.redis.incr("ripple:online_users") return newToken