Exemple #1
0
def UpdateAuthTimeHuman(client_id,balance,sock_):
    from SBPS import InternalMessage
    InternalMessage.RegistFilter(InternalMessage.TTYPE_HUMAN,client_id)
    with session_scope() as session :
        session.query(SBDB_ORM.Client).filter(SBDB_ORM.Client.id==client_id).update({SBDB_ORM.Client.dt_auth:datetime.datetime.now()})
        session.commit()
    InternalMessage.NotifyTerminalStatus(InternalMessage.TTYPE_HUMAN, client_id, sock_, InternalMessage.OPER_ONLINE,balance)
Exemple #2
0
def UpdateAuthTimeRelayer(relayer_id):
    from SBPS import InternalMessage
    InternalMessage.RegistFilter(InternalMessage.TTYPE_GATEWAY,relayer_id)
    with session_scope() as session :
        session.query(SBDB_ORM.Relayer).filter(SBDB_ORM.Relayer.id==relayer_id).update({SBDB_ORM.Relayer.dt_auth:datetime.datetime.now(),SBDB_ORM.Relayer.server_id:InternalMessage.MyServerID})
        session.commit()
    InternalMessage.NotifyTerminalStatus(InternalMessage.TTYPE_GATEWAY, relayer_id, 0, InternalMessage.OPER_ONLINE)