def push_info(sid, data): # Data.find() if Relay.is_admin(sid) is False: return user_id = data['user_id'] user = Relay.get_user(user_id) if user is None: return msg = data['msg'] Relay.send_msg_by_user_id(user.get_id(), 'ACK_PUSH', msg) return
def user_exit(sid): if Relay.is_admin(sid) == True: Relay.kill_admin(sid) print('这个http服务器的管理员退出了', sid) return user = Relay.get_user_by_sid(sid) if user is not None: user_id = user.get_id() Relay.user_exit(user_id) print('这个普通用户退出了', sid) print(sid, '退出了推送系统') return