def get_nickname(user_id): nickname = r.hget(user_id, "nickname") return nickname.decode("UTF-8")
def get_user_list(room_id): return r.hget(room_id, "users")
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]
def get_user_count(room_id): user_str = str(r.hget(room_id, "users")) if user_str == "": return 0 return user_str.count(',') + 1
def get_user_nickname(user_id): bytes_nickname = r.hget(user_id, "nickname") return parse_bytes_into_str(bytes_nickname)
def get_user_point(user_id): bytes_point = r.hget(user_id, "point") return parse_bytes_into_int(bytes_point)
def get_user_state(user_id): bytes_state = r.hget(user_id, "state") return parse_bytes_into_str(bytes_state)
def get_order(room_id): bytes_order = r.hget(room_id, 'order') return parse_bytes_into_int(bytes_order)
def get_round(room_id): bytes_round = r.hget(room_id, 'round') return parse_bytes_into_int(bytes_round)
def get_room_state(room_id): state = r.hget(room_id, "state") return parse_bytes_into_str(state)
def get_user_list(room_id): users_str = r.hget(room_id, "users") return parse_bytes_into_list(users_str)