Beispiel #1
0
 /** Adds the given request to the queue and to the database. */
 protected function addRequest(GroupRequest $request)
 {
     // add to queue
     $this->requests[] = $request;
     // add to database
     $dbh = Database::handle();
     $sth = $dbh->prepare('INSERT INTO group_requests (session, game, step, expires) VALUES (:session, :game, :step, :expires)');
     $sth->bindValue(':session', $request->session->id);
     $sth->bindValue(':game', $request->game()->getID());
     $sth->bindValue(':step', strval($request->session->currentRound()));
     $sth->bindValue(':expires', Util::unix2sqltime($request->expires));
     $sth->execute();
 }
Beispiel #2
0
 /**
  * Returns true if the given GroupRequest satisfies this GroupRequest's conditions.
  * i.e., if they are a match
  */
 public function match(GroupRequest $other)
 {
     return $this->game() == $other->game() && $this->step() == $other->step();
 }