예제 #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)