Example #1
0
def get_nickname(user_id):
    nickname = r.hget(user_id, "nickname")
    return nickname.decode("UTF-8")
Example #2
0
def get_user_list(room_id):
    return r.hget(room_id, "users")
Example #3
0
def get_user_card_in_this_round(user_id, this_round):
    cards_bytes = r.hget(user_id, "cards")
    parsed_card_list = parse_bytes_into_list(cards_bytes)
    return parsed_card_list[this_round]
Example #4
0
def get_user_count(room_id):
    user_str = str(r.hget(room_id, "users"))
    if user_str == "":
        return 0

    return user_str.count(',') + 1
Example #5
0
def get_user_nickname(user_id):
    bytes_nickname = r.hget(user_id, "nickname")
    return parse_bytes_into_str(bytes_nickname)
Example #6
0
def get_user_point(user_id):
    bytes_point = r.hget(user_id, "point")
    return parse_bytes_into_int(bytes_point)
Example #7
0
def get_user_state(user_id):
    bytes_state = r.hget(user_id, "state")
    return parse_bytes_into_str(bytes_state)
Example #8
0
def get_order(room_id):
    bytes_order = r.hget(room_id, 'order')
    return parse_bytes_into_int(bytes_order)
Example #9
0
def get_round(room_id):
    bytes_round = r.hget(room_id, 'round')
    return parse_bytes_into_int(bytes_round)
Example #10
0
def get_room_state(room_id):
    state = r.hget(room_id, "state")
    return parse_bytes_into_str(state)
Example #11
0
def get_user_list(room_id):
    users_str = r.hget(room_id, "users")
    return parse_bytes_into_list(users_str)