本文整理汇总了PHP中Common::setTime方法的典型用法代码示例。如果您正苦于以下问题:PHP Common::setTime方法的具体用法?PHP Common::setTime怎么用?PHP Common::setTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Common
的用法示例。
在下文中一共展示了Common::setTime方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exchangeSilver
public function exchangeSilver($xSilver, $floor)
{
$this->xSilver = $xSilver;
for ($ctr = 0; $ctr < count($this->playerInfo['ret']['user']['city']); $ctr++) {
start:
$time = time();
$var = @file_get_contents($this->server . "game/get_cityinfo_api.php?jsonpcallback=jsonp" . $time . "&_=" . ($time + 1485495) . "&key=" . $this->key . "&city=" . $this->playerInfo['ret']['user']['city'][$ctr]['id'] . "&_l=en&_p=RE");
if (!(strpos($var, '})') !== false)) {
goto start;
}
parent::setTime($time);
$city = parent::stripTojSon($var);
if ($city['ret']['city'][2] < $xSilver) {
echo "\nInsuficient Silver in" . $this->playerInfo['ret']['user']['city'][$ctr]['name'] . "\n";
} else {
# Exchange Food
if ($city['ret']['city'][4] < $floor) {
$this->exchangeFood($this->playerInfo['ret']['user']['city'][$ctr]['id']);
}
# Exchange Wood
if ($city['ret']['city'][6] < $floor) {
$this->exchangeWood($this->playerInfo['ret']['user']['city'][$ctr]['id']);
}
# Exchange Iron
if ($city['ret']['city'][8] < $floor) {
$this->exchangeIron($this->playerInfo['ret']['user']['city'][$ctr]['id']);
}
}
}
}
示例2: getDailyGift
public function getDailyGift($server, $key, $playerInfo)
{
$time = time();
start:
$gift = @file_get_contents($server . "game/goods_api.php?jsonpcallback=jsonp" . $time . "&_=" . ($time + 1485495) . "&key=" . $key . "&action=gift&id=168&_l=en&_p=RE");
if (!(strpos($gift, '})') !== false)) {
goto start;
}
parent::setTime($time);
return $this->gift = parent::stripTojSon($gift);
}
示例3: getRealUserName
private function getRealUserName()
{
start:
$time = time();
$var = @file_get_contents($this->servers[$this->loginURL] . "info.php?jsonpcallback=jsonp" . $time . "&_=" . ($time + 1485495) . "&user=" . urlencode($this->userName) . "&action=login&pvp=0&_l=en&_p=RE");
if (!(strpos($var, '})') !== false)) {
goto start;
}
parent::setTime($time);
return parent::stripTojSon($var);
}
示例4: getInfo
public function getInfo($server, $key)
{
$time = time();
start:
$playerInfo = @file_get_contents($server . "game/get_userinfo_api.php?jsonpcallback=jsonp" . $time . "&_=" . ($time + 1485495) . "&key=" . $key . "&_l=en&_p=RE");
if (!(strpos($playerInfo, '})') !== false)) {
goto start;
}
parent::setTime($time);
return $this->playerInfo = parent::stripTojSon($playerInfo);
}
示例5: checkrSlot
private function checkrSlot($city)
{
job:
$time = time();
$var = @file_get_contents($this->server . "game/get_cdinfo_api.php?jsonpcallback=jsonp" . $time . "&_=" . ($time + 1485495) . "&key=" . $this->key . "&city=" . $city . "&_l=en&_p=RE");
if (!(strpos($var, '})') !== false)) {
goto job;
}
parent::setTime($time);
$var = parent::stripTojSon($var);
$research = 0;
for ($ctr = 0; $ctr < count($var['ret']['cdlist']); $ctr++) {
if ($var['ret']['cdlist'][$ctr]['cdtype'] == 2) {
$research++;
}
}
if ($research == 0) {
return true;
}
return false;
}
示例6: sendScout
private function sendScout($map, $x, $y)
{
for ($ctr = 0; $ctr < count($map); $ctr++) {
if ($map[$ctr][2] == $this->barbLevel && $map[$ctr][3][0] >= $this->quota) {
sendScout:
$time = time();
$var = @file_get_contents($this->server . "game/armament_action_task_api.php?jsonpcallback=jsonp" . $time . "&_=" . ($time + 1485495) . "&key=" . $this->key . "&city=" . $this->playerInfo['ret']['user']['city'][0]['id'] . "&action=do_war&attack_type=3&tai_num=1&area=" . $map[$ctr][0] . "&area_x=" . $map[$ctr][1] . "&carry=52&cost_food=20&cost_wood=0&cost_iron=0&cost_gold=0&distance=25440&travel_sec=120&_l=en&_p=RE");
if (!(strpos($var, '})') !== false)) {
goto sendScout;
}
parent::setTime($time);
$var = parent::stripTojSon($var);
if ($var['code'] == 2544) {
echo "\nYou don't have enough scout in your first City\n";
die;
} else {
$this->total++;
}
}
}
}
示例7: getGenerals
public function getGenerals($server, $key, $playerInfo, $hero)
{
$this->server = $server;
$this->key = $key;
$this->aimRank = $this->identifyHero($hero);
$this->city = $playerInfo['ret']['user']['city']['0']['id'];
$this->playerInfo = $playerInfo;
start:
$time = time();
$var = @file_get_contents($this->server . "game/gen_visit_api.php?jsonpcallback=jsonp" . $time . "&_=" . ($time + 1485495) . "&key=" . $this->key . "&_l=en&_p=RE");
if (!(strpos($var, '})') !== false)) {
goto start;
}
parent::setTime($time);
$this->heroList = parent::stripTojSon($var);
# Get Reward if there are five the same hero
$this->getReward();
# Do visit the target hero
$this->visitHero();
# TODO: Create a function that will validate if previous visited
# hero are the same, else it will clear the list
}
示例8: createSpy
public function createSpy($amount)
{
start:
$time = time();
$var = @file_get_contents($this->server . "game/gen_conscribe_api.php?jsonpcallback=jsonp" . $time . "&_=" . ($time + 1485495) . "&key=" . $this->key . "&city=" . $this->playerInfo['ret']['user']['city'][0]['id'] . "&action=gen_list&_l=en&_p=RE");
if (!(strpos($var, '})') !== false)) {
goto start;
}
parent::setTime($time);
$var = parent::stripTojSon($var);
# Create spy
if (count($var['ret']['hero']) > 0) {
# http://s102.romanempire.com/game/soldier_educate_api.php?jsonpcallback=jsonp1454109660639&_=1454109667832&key=73c970d8e8fcf47bf39dbae1c9ec0010&city=xxxxxx&action=soldier_educate&soldier=2&num=2000&gen=203&_l=en&_p=RE-IPHONE-EN
create:
$time = time();
$var = @file_get_contents($this->server . "game/soldier_educate_api.php?jsonpcallback=jsonp" . $time . "&_=" . ($time + 1485495) . "&key=" . $this->key . "&city=" . $this->playerInfo['ret']['user']['city'][0]['id'] . "&action=gen_list&_l=en&_p=RE");
if (!(strpos($var, '})') !== false)) {
goto create;
}
# Disband
# http://s102.romanempire.com/game/soldier_educate_api.php?jsonpcallback=jsonp1454110415834&_=1454110419263&key=73c970d8e8fcf47bf39dbae1c9ec0010&city=xxxxxxxxxxx&action=disband&soldier_num2=2000&_l=en&_p=RE-IPHONE-EN
}
}
示例9: executeAttack
public function executeAttack()
{
# http://s102.romanempire.com/game/armament_action_task_api.php?jsonpcallback=jsonp1454207375580&_=1454207385270&key=b4a3304a7846f9c3a27950ec30a0ecba&city=307877&action=war_task&attack_type=7&gen=22&area=221&area_x=173&soldier_num18=800&soldier_num17=300&carry=1200000&cost_food=425000&cost_wood=0&cost_iron=0&cost_gold=0&distance=2400&travel_sec=60&_l=en&_p=RE-IPHONE-EN
#print_r($this->attackList);
$attackTime = time();
shuffle($this->attackList);
for ($ctr = 0; $ctr < count($this->attackList); $ctr++) {
attack:
$time = time();
$var = @file_get_contents($this->server . "game/armament_action_task_api.php?jsonpcallback=jsonp" . $time . "&_=" . ($time + 1485495) . "&key=" . $this->key . "&city=" . $this->attackList[$ctr]['city'] . "&action=war_task&attack_type=7&gen=" . $this->attackList[$ctr]['gid'] . "&area=" . $this->attackList[$ctr]['x'] . "&area_x=" . $this->attackList[$ctr]['y'] . "&soldier_num18=800&soldier_num17=300&carry=1200000&cost_food=425000&cost_wood=0&cost_iron=0&cost_gold=0&distance=2400&travel_sec=60&_l=en&_p=RE");
if (!(strpos($var, '})') !== false)) {
goto attack;
}
echo $this->attackList[$ctr]['gid'] . " Sent to " . $this->attackList[$ctr]['x'] . " " . $this->attackList[$ctr]['y'] . "\n";
sleep(rand(15, 25));
// Random attack from 15secs to 25 secs
# attack for 50mins and then break
if ($attackTime - time() > 3000) {
$f = @fopen($this->key . ".txt", "w") or die("Unable to open file!\n");
fwrite($f, time());
fclose($f);
die("Attack Exited\n");
}
parent::setTime($time);
$var = parent::stripTojSon($var);
if ($var['code'] >= 20000) {
# Do not attack until user login
$f = @fopen($this->key . ".txt", "w") or die("Unable to open file!\n");
fwrite($f, "9999999999");
fclose($f);
die("Attack require captcha\n");
//goto attack;
}
}
}
示例10: getTradeList
private function getTradeList($price)
{
lister:
$time = time();
$var = @file_get_contents($this->server . "game/safe_market_api.php?jsonpcallback=jsonp" . $time . "&_=" . ($time + 1485495) . "&key=" . $this->key . "&type=1&page=1&_l=en&_p=RE");
if (!(strpos($var, '})') !== false)) {
goto lister;
}
parent::setTime($time);
$var = parent::stripTojSon($var);
return $var['ret']['item'];
}