Subversion Repositories VORC

Rev

Rev 153 | Rev 162 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 153 Rev 154
Line 366... Line 366...
366
    # We are at max users. People have to wait.
366
    # We are at max users. People have to wait.
367
    if (!$RCqueueID) {
367
    if (!$RCqueueID) {
368
   	  use Digest::MD5 qw/md5_hex/;
368
   	  use Digest::MD5 qw/md5_hex/;
369
   	  $RCqueueID = time () ."-". md5_hex (rand ());
369
   	  $RCqueueID = time () ."-". md5_hex (rand ());
370
   	  push @queued_users, $RCqueueID;
370
   	  push @queued_users, $RCqueueID;
-
 
371
   	  $qdbh->do ("replace into queue (queueid, timestamp) values (?, now())", undef, $RCqueueID);
371
    }
372
    }
372
# 	  `/bin/touch $SESSIONS_QUEUE/$RCqueueID`;
373
# 	  `/bin/touch $SESSIONS_QUEUE/$RCqueueID`;
373
 		$qdbh->do ("replace into queue (queueid, timestamp) values (?, now())", undef, $RCqueueID);   
-
 
-
 
374
 		
374
    printQueuePage ($RCqueueID, "(".inQueue ($RCqueueID, \@queued_users)." of ".scalar @queued_users." users)");
375
    printQueuePage ($RCqueueID, "(".inQueue ($RCqueueID, \@queued_users)." of ".scalar @queued_users." users)");
375
    exit;
376
    exit;
Line 376... Line 377...
376
    
377
    
377
  } elsif (scalar @queued_users) {
378
  } elsif (scalar @queued_users) {
378
    # There are users in queue...
379
    # There are users in queue...
379
    if (!$RCqueueID) {
380
    if (!$RCqueueID) {
380
      # If you're not already in queue, get in line.
381
      # If you're not already in queue, get in line.
381
   	  use Digest::MD5 qw/md5_hex/;
382
   	  use Digest::MD5 qw/md5_hex/;
382
   	  $RCqueueID = time () ."-". md5_hex (rand ());
383
   	  $RCqueueID = time () ."-". md5_hex (rand ());
-
 
384
   	  push @queued_users, $RCqueueID;
383
   	  push @queued_users, $RCqueueID;
385
   	  $qdbh->do ("replace into queue (queueid, timestamp) values (?, now())", undef, $RCqueueID);
384
    }
-
 
Line 385... Line 386...
385
 		$qdbh->do ("replace into queue (queueid, timestamp) values (?, now())", undef, $RCqueueID);   
386
    }
386
 	  
387
 	  
387
   	my $queue_position = inQueue ($RCqueueID, \@queued_users);
388
   	my $queue_position = inQueue ($RCqueueID, \@queued_users);
388
    if ($queue_position > ($max_users - $active_users)) {
389
    if ($queue_position > ($max_users - $active_users)) {