Got an iPhone or iPad? We have a brand new Pastebin App for both devices, and it's totally free! Click here to download the new Pastebin App for iOS.
Guest

root

By: a guest on Feb 1st, 2010  |  syntax: None  |  size: 3.16 KB  |  hits: 70  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. diff -r ae99bc62f2a4 modules/os_poker/os_poker_messages.php
  2. --- a/modules/os_poker/os_poker_messages.php    Mon Feb 01 10:38:12 2010 +0100
  3. +++ b/modules/os_poker/os_poker_messages.php    Mon Feb 01 15:32:38 2010 +0100
  4.  -48,6 +48,8 @@
  5.         header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
  6.         header('Content-type: application/json');
  7.  
  8. +       $timestamp = $_GET['_'];
  9. +
  10.         if ($current_user && $current_user->uid != 0)
  11.         {
  12.  
  13.  -64,9 +66,11 @@
  14.                                                                                                                                                                                          "picture" => drupal_get_path('module', 'os_poker') . "/images/mailbox.png"));
  15.                         }
  16.  
  17. +                       file_put_contents("/tmp/os_poker.log", date(DATE_ATOM) . " request: " . $timestamp . " pass: " . $pass . " LONG_POLL_LIVE_CHECK_BEGIN\n", FILE_APPEND);
  18.                         CScheduler::instance()->Trigger("live"); //Trigger live, and fill message spooler
  19.  
  20.                         $messages = CMessageSpool::instance()->Get();
  21. +                       file_put_contents("/tmp/os_poker.log", date(DATE_ATOM) . " request: " . $timestamp . " pass: " . $pass . " messages: " . json_encode($messages) . "\n", FILE_APPEND);
  22.  
  23.                         foreach ($messages as $msg)
  24.                         {
  25.  -75,11 +79,17 @@
  26.  
  27.                         CMessageSpool::instance()->Flush();
  28.  
  29. +                       file_put_contents("/tmp/os_poker.log", date(DATE_ATOM) . " request: " . $timestamp . " pass: " . $pass . " count: " . count($resp["messages"]) . "\n", FILE_APPEND);
  30. +
  31.                         if (count($resp["messages"]) > 0)
  32.                         {
  33. +                               file_put_contents("/tmp/os_poker.log", date(DATE_ATOM) . " request: " . $timestamp . " pass: " . $pass . " LONG_POLL_LIVE_CHECK_END" . json_encode($resp) . "\n", FILE_APPEND);
  34.                                 return json_encode($resp);
  35. +                       } else {
  36. +                               file_put_contents("/tmp/os_poker.log", date(DATE_ATOM) . " request: " . $timestamp . " pass: " . $pass . " LONG_POLL_LIVE_CHECK_NO_MESSAGES\n", FILE_APPEND);
  37.                         }
  38.  
  39. +                       file_put_contents("/tmp/os_poker.log", date(DATE_ATOM) . " request: " . $timestamp . " pass: " . $pass . " LONG_POLL_LIVE_CHECK_CONTINUE\n-\n", FILE_APPEND);
  40.                         sleep(3); //poll every 3 sec
  41.                 }
  42.         }
  43.  -276,8 +286,8 @@
  44.      case  'BUY_IN':
  45.          list($uid, $game_id, $amount)  = $args;
  46.          if(user_load($uid)) {
  47. -          CScheduler::instance()->RegisterTask(new CUpdateUserChipsCount(), $uid, array('live'));
  48. -          $resp["messages"][] = array("type" => "debug", "body" => t('Recevied BUY_IN for user !uid', array('!uid' => $uid)));
  49. +                                       $tid = CScheduler::instance()->RegisterTask(new CUpdateUserChipsCount(), $uid, array('live'));
  50. +                                       $resp["messages"][] = array("type" => "debug", "body" => t('Recevied BUY_IN for user !uid, scheduled task !tid', array('!uid' => $uid, '!tid' => $tid)));
  51.          }
  52.          else {
  53.            trigger_error(t('Invalid user ID: %uid', array('%uid' => $uid)), E_USER_ERROR);
  54. diff -r ae99bc62f2a4 modules/os_poker/scheduler.class.php
  55. --- a/modules/os_poker/scheduler.class.php      Mon Feb 01 10:38:12 2010 +0100
  56. +++ b/modules/os_poker/scheduler.class.php      Mon Feb 01 15:32:38 2010 +0100
  57.  -258,6 +258,7 @@
  58.                                                 {
  59.                                                         $this->_ignore[] = $value->id_task;
  60.                                                         $task->Run($this->_user, json_decode($value->arguments, TRUE));
  61. +                                                       file_put_contents("/tmp/os_poker.log", date(DATE_ATOM) . "scheduled: " . $value->type . "\nbacktrace: " . json_encode(debug_backtrace()) . "\n", FILE_APPEND);
  62.                                                         $toDetroy [] = $value->id_task;
  63.                                                         ++$runTasks;
  64.                                                 }