示例#1
0
def get_nickname(user_id):
    nickname = r.hget(user_id, "nickname")
    return nickname.decode("UTF-8")
示例#2
0
def get_user_list(room_id):
    return r.hget(room_id, "users")
示例#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]
示例#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
示例#5
0
def get_user_nickname(user_id):
    bytes_nickname = r.hget(user_id, "nickname")
    return parse_bytes_into_str(bytes_nickname)
示例#6
0
def get_user_point(user_id):
    bytes_point = r.hget(user_id, "point")
    return parse_bytes_into_int(bytes_point)
示例#7
0
def get_user_state(user_id):
    bytes_state = r.hget(user_id, "state")
    return parse_bytes_into_str(bytes_state)
示例#8
0
def get_order(room_id):
    bytes_order = r.hget(room_id, 'order')
    return parse_bytes_into_int(bytes_order)
示例#9
0
def get_round(room_id):
    bytes_round = r.hget(room_id, 'round')
    return parse_bytes_into_int(bytes_round)
示例#10
0
def get_room_state(room_id):
    state = r.hget(room_id, "state")
    return parse_bytes_into_str(state)
示例#11
0
def get_user_list(room_id):
    users_str = r.hget(room_id, "users")
    return parse_bytes_into_list(users_str)