List<SpawnConditions> spawnConditions = new List<SpawnConditions>()
{ new SpawnConditions(TimeFromStart = 5, Prefab = Enemy1};
error CS1519: Invalid token '{' in class, struct, or interface member declaration
spawnConditions.Add(enemy1,5);
foreach(cond in spawnConditions)
error CS0230: Type and identifier are both required in a foreach statement
foreach(cond<SpawnConditions> in spawnConditions)
$spawnConditions=array(
3=> array('enemy'=>'enemy1'),
15=> array('enemy'=>'enemy2'),
25=> array('enemy'=>'enemy3')
);
$channels=array();
$multi=curl_multi_init();
foreach($arr as $url=>$proxy){
$arr_proxy[$url]=$proxy;
$post='..........';
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,'..............');
curl_setopt($ch,CURLOPT_COOKIEFILE,"");
curl_setopt($ch,CURLOPT_REFERER,'.............');
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,FALSE);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,FALSE);
curl_setopt($ch,CURLOPT_HEADER,TRUE);
curl_setopt($ch,CURLOPT_TIMEOUT,11);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,11);
curl_setopt($ch,CURLOPT_POST,TRUE);
curl_setopt($ch,CURLOPT_POSTFIELDS,$post);
curl_setopt($ch,CURLOPT_MAXREDIRS,1);
curl_setopt($ch,CURLOPT_PROXYTYPE,0);
curl_setopt($ch,CURLOPT_PROXY,$proxy);
curl_setopt($ch,CURLOPT_ENCODING,"");
curl_multi_add_handle($multi,$ch);
$channels[$url]=$ch;
}
$active=NULL; do{ $mrc=curl_multi_exec($multi,$active); } while($mrc==CURLM_CALL_MULTI_PERFORM);
while($active && $mrc==CURLM_OK){
if(curl_multi_select($multi)==-1) usleep(rand($settings_parser['cookie_usleep_active_min'],$settings_parser['cookie_usleep_active_max']));
do{ $mrc=curl_multi_exec($multi,$active); } while($mrc==CURLM_CALL_MULTI_PERFORM);
}
foreach($channels as $url=>$ch){
$content=trim(curl_multi_getcontent($ch));
// тут из контента берутся куки
$arr_cookie[$url]=get_cookie($content);
curl_multi_remove_handle($multi,$ch);
}
curl_multi_close($multi);
#===================================================================#
$channels=array();
$multi=curl_multi_init();
foreach($arr_cookie as $url=>$cookie){
$proxy=$arr_proxy[$url];
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,'..............');
curl_setopt($ch,CURLOPT_COOKIEFILE,"");
curl_setopt($ch,CURLOPT_COOKIE,$cookie);
curl_setopt($ch,CURLOPT_REFERER,'.............');
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,FALSE);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,FALSE);
curl_setopt($ch,CURLOPT_HEADER,TRUE);
curl_setopt($ch,CURLOPT_TIMEOUT,11);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,11);
curl_setopt($ch,CURLOPT_POST,TRUE);
curl_setopt($ch,CURLOPT_POSTFIELDS,$post);
curl_setopt($ch,CURLOPT_MAXREDIRS,1);
curl_setopt($ch,CURLOPT_PROXYTYPE,0);
curl_setopt($ch,CURLOPT_PROXY,$proxy);
curl_setopt($ch,CURLOPT_ENCODING,"");
curl_multi_add_handle($multi,$ch);
$channels[$url]=$ch;
}
$active=NULL; do{ $mrc=curl_multi_exec($multi,$active); } while($mrc==CURLM_CALL_MULTI_PERFORM);
while($active && $mrc==CURLM_OK){
if(curl_multi_select($multi)==-1) usleep(rand($settings_parser['cookie_usleep_active_min'],$settings_parser['cookie_usleep_active_max']));
do{ $mrc=curl_multi_exec($multi,$active); } while($mrc==CURLM_CALL_MULTI_PERFORM);
}
foreach($channels as $url=>$ch){
$content=trim(curl_multi_getcontent($ch));
curl_multi_remove_handle($multi,$ch);
}
curl_multi_close($multi);
убрал ForceMode.Impulse и теперь работает корректно...