Пример #1
0
 function LevelBGImage_SV($id)
 {
     // нужно скачать картинку и поставить в фон
     //if(strtolower(substr($url,0,7))!=='http://') return false;
     $url = 'http://ob5.ru/download.php?id=' . intval($id) . '&w=' . $this->GameOptions['BGImgSize'];
     $t = new TThread('TRGUI::BGImagetDownload');
     $t->____url = $url;
     $t->____file = $this->GameOptions['BGImgSave'] ? DOC_ROOT . '/Pictures/Img_' . $this->GameOptions['BGImgSize'] . '_' . intval($id) . '.jpg' : false;
     $t->____func = 'TRGUI::BGImagetDownloaded';
     $t->resume();
     return true;
 }
Пример #2
0
 function lobbyServersFind($id = null)
 {
     // искать серверы на сайте
     if (!$GLOBALS['THREAD_SELF']) {
         // проверка на поточность
         self::$Interface['GetLobby']->onClick = false;
         self::$Interface['GetLobby']->caption = 'Идёт поиск...';
         self::$Interface['GetLobby']->onClick = 'TRGUI::lobbyServersFind();';
         self::$Interface['GetLobby']->refresh();
         $t = new TThread('TRGUI::lobbyServersFind');
         $t->____url = 'http://' . self::$Options['lobbyServer'] . '/?getlobbyes' . '&name=' . urlencode(self::$Interface['MyNameBox']->text) . '&version=' . urlencode(TRGameClient::VERSION);
         $t->____func = 'TRGUI::lobbyServersFinded';
         $t->resume();
         return true;
     }
     $t = TThread::get($id);
     $url = $t->____url;
     $func = $t->____func;
     $content = @file_get_contents($url);
     sync($func, array($content));
     return true;
 }