def accept_offer(self, userid): try: with self.conn: cursor = self.conn.cursor() u = self._get_user_info_unchecked(cursor, userid) self._update_user(cursor, userid, connected_status=1) self.send(userid, Event.AcceptEvent(u.agent_index, str(time.time()))) except sqlite3.IntegrityError: print("WARNING: Rolled back transaction") return None
def accept(self, metadata=None): return Event.AcceptEvent(self.agent, time=self.timestamp(), metadata=None)