Exemplo n.º 1
0
function GetOnlineUser()
{
    global $db_online, $db;
    $onlineuser = array();
    if ($db_online == 1) {
        $query = $db->query("SELECT username,uid FROM pw_online WHERE uid>0");
        while ($rt = $db->fetch_array($query)) {
            $onlineuser[$rt['uid']] = $rt['username'];
        }
    } else {
        $onlinedb = openfile(D_P . 'data/bbscache/online.php');
        if (count($onlinedb) == 1) {
            $onlinedb = array();
        } else {
            unset($onlinedb[0]);
        }
        foreach ($onlinedb as $key => $value) {
            if (trim($value)) {
                $dt = explode("\t", $value);
                $onlineuser[$dt[8]] = $dt[0];
            }
        }
    }
    return $onlineuser;
}
Exemplo n.º 2
0
function rs_game($xmode)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    $chprocess($xmode);
    $sqldir = GAME_ROOT . './gamedata/sql/';
    eval(import_module('sys'));
    if ($xmode & 32) {
        //echo " - 商店初始化 - ";
        $sql = file_get_contents("{$sqldir}shopitem.sql");
        $sql = str_replace("\r", "\n", str_replace(' bra_', ' ' . $tablepre, $sql));
        $db->queries($sql);
        $file = __DIR__ . '/config/shopitem.config.php';
        $shoplist = openfile($file);
        $qry = '';
        foreach ($shoplist as $lst) {
            if (!empty($lst) && strpos($lst, ',') !== false) {
                list($kind, $num, $price, $area, $item, $itmk, $itme, $itms, $itmsk) = explode(',', $lst);
                if ($kind != 0) {
                    $qry .= "('{$kind}','{$num}','{$price}','{$area}','{$item}','{$itmk}','{$itme}','{$itms}','{$itmsk}'),";
                }
            }
        }
        if (!empty($qry)) {
            $qry = "INSERT INTO {$tablepre}shopitem (kind,num,price,area,item,itmk,itme,itms,itmsk) VALUES " . substr($qry, 0, -1);
        }
        $db->query($qry);
    }
}
Exemplo n.º 3
0
function activate430()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('skill430', 'player', 'logger', 'sys', 'itemmain'));
    \player\update_sdata();
    if (!\skillbase\skill_query(430) || !check_unlocked430($sdata)) {
        $log .= '你没有这个技能!<br>';
        return;
    }
    $st = check_skill430_state($sdata);
    if ($st == 0) {
        $log .= '你不能使用这个技能!<br>';
        return;
    }
    if ($st == 2) {
        $log .= '技能冷却中!<br>';
        return;
    }
    \skillbase\skill_setvalue(430, 'lastuse', $now);
    $file = GAME_ROOT . "./include/modules/base/itemmain/config/mapitem.config.php";
    //真是丑陋!
    $itemlist = openfile($file);
    $in = sizeof($itemlist);
    $i = rand(1, $in - 1);
    list($iarea, $imap, $inum, $iname, $ikind, $ieff, $ista, $iskind) = explode(',', $itemlist[$i]);
    $itm0 = $iname;
    $itme0 = $ieff;
    $itms0 = $ista;
    $itmsk0 = $iskind;
    $itmk0 = $ikind;
    addnews(0, 'bskill430', $name, $iname);
    \itemmain\itemget();
}
Exemplo n.º 4
0
function weaponswap()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'player', 'logger'));
    if (strpos($wepsk, 'j') === false) {
        $log .= '你的武器不能变换。<br>';
        $mode = 'command';
        return;
    }
    $oldw = $wep;
    $file = __DIR__ . '/config/wepchange.config.php';
    $wlist = openfile($file);
    $wnum = count($wlist) - 1;
    for ($i = 0; $i <= $wnum; $i++) {
        list($on, $nn, $nk, $ne, $ns, $nsk) = explode(',', $wlist[$i]);
        if ($wep == $on) {
            $wep = $nn;
            $wepk = $nk;
            $wepe = $ne;
            $weps = $ns;
            $wepsk = $nsk;
            $log .= "<span class=\"yellow\">{$oldw}</span>变换成了<span class=\"yellow\">{$wep}</span>。<br>";
            return;
        }
    }
    $log .= "<span class=\"yellow\">{$oldw}</span>由于改造或其他原因不能变换。<br>";
}
Exemplo n.º 5
0
function itemuse(&$theitem)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'player', 'itemmain', 'logger'));
    $itm =& $theitem['itm'];
    $itmk =& $theitem['itmk'];
    $itme =& $theitem['itme'];
    $itms =& $theitem['itms'];
    $itmsk =& $theitem['itmsk'];
    if (strpos($itmk, 'p') === 0) {
        $log .= "你打开了<span class=\"yellow\">{$itm}</span>。<br>";
        $file = __DIR__ . '/config/present.config.php';
        $plist = openfile($file);
        $rand = rand(0, count($plist) - 1);
        list($in, $ik, $ie, $is, $isk) = explode(',', $plist[$rand]);
        $itm0 = $in;
        $itmk0 = $ik;
        $itme0 = $ie;
        $itms0 = $is;
        $itmsk0 = $isk;
        addnews($now, 'present', $name, $itm, $in);
        \itemmain\itms_reduce($theitem);
        \itemmain\itemget();
        return;
    } elseif (strpos($itmk, 'ygo') === 0) {
        $log .= "你打开了<span class=\"yellow\">{$itm}</span>。<br>";
        $file = __DIR__ . '/config/ygobox.config.php';
        $plist1 = openfile($file);
        $rand1 = rand(0, count($plist1) - 1);
        list($in, $ik, $ie, $is, $isk) = explode(',', $plist1[$rand1]);
        $itm0 = $in;
        $itmk0 = $ik;
        $itme0 = $ie;
        $itms0 = $is;
        $itmsk0 = $isk;
        addnews($now, 'present', $name, $itm, $in);
        \itemmain\itms_reduce($theitem);
        \itemmain\itemget();
        return;
    } elseif (strpos($itmk, 'fy') === 0) {
        $log .= "你打开了<span class=\"yellow\">{$itm}</span>。<br>";
        $file = __DIR__ . '/config/fybox.config.php';
        $plist1 = openfile($file);
        $rand1 = rand(0, count($plist1) - 1);
        list($in, $ik, $ie, $is, $isk) = explode(',', $plist1[$rand1]);
        $itm0 = $in;
        $itmk0 = $ik;
        $itme0 = $ie;
        $itms0 = $is;
        $itmsk0 = $isk;
        addnews($now, 'present', $name, $itm, $in);
        \itemmain\itms_reduce($theitem);
        \itemmain\itemget();
        return;
    }
    $chprocess($theitem);
}
Exemplo n.º 6
0
function get_shoplist()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys'));
    $file = __DIR__ . '/config/shopitem.config.php';
    $sl = openfile($file);
    return $sl;
}
Exemplo n.º 7
0
	public function loadForm($formFile){
		if(is_file(bizmTpl.'form'.$formFile.suffix)){
			return  openfile('Template/form'.$formFile.suffix,'bizm');
		}else{
			if(is_file($File = bizmForm.$formFile.'.ini.php'))	{
				include_once $File;
				return $form;
			}else die("The lack of a {$formFile} file!");
		}
		return array();
	}
Exemplo n.º 8
0
function get_shoplist()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'instance5'));
    if ($gametype == 15) {
        $file = __DIR__ . '/config/shopitem.config.php';
        $sl5 = openfile($file);
        return $sl5;
    } else {
        return $chprocess();
    }
}
Exemplo n.º 9
0
 function get($key)
 {
     $this->_file = $this->get_file($key, 'get');
     if (!file_exists($this->_file)) {
         return false;
     }
     $D = openfile($this->_file);
     $D = str_replace('<?php exit;?>', '', $D);
     $value = unserialize($this->_have_zlib && $this->_compress_enable ? gzuncompress($D) : $D);
     if ($value['Expires'] == 0) {
         return $value['Data'];
     } else {
         $_time = time();
         return $_time - $value['Time'] < $value['Expires'] ? $value['Data'] : false;
     }
 }
Exemplo n.º 10
0
function writeMessage($message)
{
    $filename = 'log.txt';
    $filemode = 'a';
    if (file_exists($filename)) {
        $modded = date("dmY", filemtime($filename));
        $today = date("dmY");
        if ($today != $modded) {
            $filemode = 'w';
        }
    }
    $fp = openfile($filename, $filemode);
    fwrite($fp, $message);
    fwrite($fp, "\n");
    fclose($fp);
}
Exemplo n.º 11
0
function rs_game($xmode)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    $chprocess($xmode);
    eval(import_module('sys', 'map', 'itemmain', 'trap'));
    if ($xmode & 16) {
        //地图陷阱初始化
        $plsnum = sizeof($plsinfo);
        $iqry = '';
        $file = __DIR__ . '/config/trapitem.config.php';
        $itemlist = openfile($file);
        $in = sizeof($itemlist);
        $an = $areanum ? ceil($areanum / $areaadd) : 0;
        for ($i = 1; $i < $in; $i++) {
            if (!empty($itemlist[$i]) && strpos($itemlist[$i], ',') !== false) {
                list($iarea, $imap, $inum, $iname, $ikind, $ieff, $ista, $iskind) = explode(',', $itemlist[$i]);
                if ($iarea == $an || $iarea == 99) {
                    for ($j = $inum; $j > 0; $j--) {
                        if ($imap == 99) {
                            do {
                                $rmap = rand(0, $plsnum - 1);
                            } while (in_array($rmap, $map_noitemdrop_arealist));
                        } else {
                            $rmap = $imap;
                        }
                        $iqry .= "('{$iname}', '{$ikind}','{$ieff}','{$ista}','{$iskind}','{$rmap}'),";
                    }
                }
            }
        }
        if (!empty($iqry)) {
            $iqry = "INSERT INTO {$tablepre}maptrap (itm,itmk,itme,itms,itmsk,pls) VALUES " . substr($iqry, 0, -1);
            $db->query($iqry);
        }
    }
}
Exemplo n.º 12
0
        }
    } else {
        echo "ERROR : File Not Found.";
    }
    fclose($file);
    //finished processing all rows; if we're connected to the google packages then render the graph
    echo "<script text=\"text/javascript\">\n\t\t\t\t\t\tif(doneLoadingGoogle)\n\t\t\t\t\t\t\tdrawChart();\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdoneLoadingRows = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t  </script>";
}
?>
	</head>
	<body>
		<script type="text/javascript">
			loadPackages();
		</script>
		<?php 
openfile("cacheConanOBrien.txt");
?>
		
		<br />
		<img src = 'https://pbs.twimg.com/profile_images/1132696610/securedownload_normal.jpeg' />
		<span id="chart_div"></span>
		<br />
		<br />
		<ul id="tweets">
			<li id="negMsg">
			</li>
			<ul>
				<li id="negScore"></li>
			</ul>
			<li id="posMsg">
			</li>
Exemplo n.º 13
0
 $itmk[5] = 'HB';
 $itme[5] = 70;
 $itms[5] = 15;
 if ($wingames <= 1) {
     $itm[6] = '银白盒子';
     $itmk[6] = 'p';
     $itme[6] = 1;
     $itms[6] = 1;
     $itmsk[6] = 'ps';
 }
 $weplist = openfile(config('stwep', $gamecfg));
 do {
     $index = rand(1, count($weplist) - 1);
     list($wep, $wepk, $wepe, $weps, $wepsk) = explode(",", $weplist[$index]);
 } while (!$wepk);
 $stitemlist = openfile(config('stitem', $gamecfg));
 do {
     $index = rand(1, count($stitemlist) - 1);
     list($itm[3], $itmk[3], $itme[3], $itms[3], $itmsk[3]) = explode(",", $stitemlist[$index]);
 } while (!$itmk[3]);
 do {
     $index = rand(1, count($stitemlist) - 1);
     list($itm[4], $itmk[4], $itme[4], $itms[4], $itmsk[4]) = explode(",", $stitemlist[$index]);
 } while (!$itmk[4] || $itmk[3] == $itmk[4]);
 if (strpos($wepk, 'WG') === 0) {
     $itm[3] = '手枪子弹';
     $itmk[3] = 'GB';
     $itme[3] = 1;
     $itms[3] = 12;
     $itmsk[3] = '';
 }
 $afname = $_FILES['addfile']['name'];
 $aftmp = $_FILES['addfile']['tmp_name'];
 $showsucc = (int)$_POST['showsucc'];
 $showfail = (int)$_POST['showfail'];
 
 if ($afname && is_uploaded_file($aftmp)) {
   // it's a file upload, so read it
   $fp = @fopen($aftmp, 'r');
   if ($fp === false) die ('Uploaded file could not be opened.');
   $add = fread($fp, filesize ($aftmp)); // just replace existing add value
 }
 
 if ($add == '') $err = 'No addresses specified.';
 
 if (!$err) {
   $f = openfile($cfg['listfile']);				  // open list
   $existing = array();
   $succ = array();
   $fail = array(); $done = false; $i = 0;
   while ($item = readitem($f)) $existing[$item['addr']] = true; // read existing addresses
   if (!$parse) {
     // we're doing CSV-style parsing
     $adds = explode($sep, $add);	// split into addresses
     foreach ($adds as $email) {
       $email = fixemail($email);
       if ($email == '') continue;
       // check address is not already in list
       if (isset($existing[$email])) {
         $fail[$i]['addr'] = htmlspecialchars($email);
         $fail[$i]['reason'] = 'Already in list';
       }
Exemplo n.º 15
0
echo str_repeat(" ", 1024);
echo '<script language="javascript"> 
$z=setInterval(function() { window.scroll(0,document.body.scrollHeight); },100); 
function stop() { window.scroll(0,document.body.scrollHeight); clearInterval($z); }</script>
<body onload=stop(); ></body>';
echo '<br><font size=4 color="red">请务必阅读以下运行日志,确定没有错误。</font><br><br>';
ob_end_flush();
flush();
if ($___MOD_CODE_ADV1) {
    echo '<font color="blue">正在进行代码预处理CODE_ADV1..</font><br>';
    ob_end_flush();
    flush();
    global $___TEMP_DRY_RUN, $___TEMP_DRY_RUN_COUNTER;
    $___TEMP_DRY_RUN = 0;
    $file = GAME_ROOT . './gamedata/modules.list.pass.php';
    $content = openfile($file);
    $in = sizeof($content);
    $___TEMP_MOD_LIST_n = 0;
    for ($i = 0; $i < $in; $i++) {
        list($modname, $modpath, $inuse) = explode(',', $content[$i]);
        if ($inuse == 1) {
            $___TEMP_MOD_LIST_n++;
            $___TEMP_MOD_LOAD_CMD[$___TEMP_MOD_LIST_n] = GAME_ROOT . './include/modules/' . $modpath . 'module.inc.php';
            $___TEMP_MOD_LOAD_NAME[$___TEMP_MOD_LIST_n] = $modname;
            $___TEMP_MOD_LOAD_PATH[$___TEMP_MOD_LIST_n] = $modpath;
        }
        unset($modname);
        unset($modepath);
        unset($inuse);
    }
    unset($i);
Exemplo n.º 16
0
function fish($uid, $cate, $money)
{
    global $db, $timestamp, $tddays;
    $time = get_date($timestamp, 'Y-m-d A:H:i:s');
    $club_list = openfile(D_P . "data/bbscache/fish/fishlog{$tddays}.php");
    $num = count($club_list);
    for ($r = 0; $r < $num; $r++) {
        $detail = explode("|", $club_list[$r]);
        if (trim($detail[0]) == $uid) {
            unset($club_list[$r]);
            $ichack = 1;
        } else {
            $ichack = 1;
        }
    }
    $club_list = implode("", $club_list);
    @writeover(D_P . "data/bbscache/fish/fishlog{$tddays}.php", $club_list, w);
    if ($ichack == 1) {
        $club_list = file(D_P . "data/bbscache/fish/fishlog{$tddays}.php");
        $num = count($club_list) - 1;
        $club_list = "{$uid}|{$time}|{$cate}|{$money}\r\n";
        @writeover(D_P . "data/bbscache/fish/fishlog{$tddays}.php", $club_list, "a");
    }
}
Exemplo n.º 17
0
		<div class="btn"><div class="btn_right"><a hidefocus="true" href="../">进入首页</a></div></div>
	    <div class="btn"><div class="btn_right"><a hidefocus="true" href="../sysadmin/login.php">直接进入管理后台</a></div></div>
	</div>
<?php 
}
?>
    </form>
    <div class="clear"></div>
    </div>
    <div class="bottom"></div>
</div>
<strong>Powered by iweb_sns V1.0 &copy; 2010 </strong>
<br /><br />
<?php 
if ($step == '3' && $creatable) {
    runquery(openfile($installSQL), $tablePreStr);
    ?>
		<script type="text/javascript">showMsg('');showMsg('共创建了<?php 
    echo $tablenum;
    ?>
个数据表.');</script>
		<script type="text/javascript">$('createTables').disabled = '';$('createTables').value = '完 成';$('createTables').style.color = '#4e4e4e';$('createTables').style.cursor = 'pointer';</script>
<?php 
    $sql = "INSERT INTO isns_admin(`admin_name`,`admin_password`,`admin_group`,`active_time`,`is_pass`) VALUES('{$admin}','" . md5($password) . "','superadmin',NOW(),1)";
    $sql = str_replace('isns_', $tablePreStr, $sql);
    if (!$db->query($sql)) {
        echo '创建后台管理员失败!';
        exit;
    }
}
?>
Exemplo n.º 18
0
function get_item_place($which)
{
    global $plsinfo, $gamecfg;
    //获取某物品的获取方式,如刷新地点或商店是否有卖等
    $result = "";
    $file = config('mapitem', $gamecfg);
    $itemlist = openfile($file);
    $in = sizeof($itemlist);
    for ($i = 1; $i < $in; $i++) {
        if (!empty($itemlist[$i]) && strpos($itemlist[$i], ',') !== false) {
            list($iarea, $imap, $inum, $iname, $ikind, $ieff, $ista, $iskind) = explode(',', $itemlist[$i]);
            if ($iname == $which) {
                if ($iarea == 99) {
                    $result .= "每禁";
                } else {
                    $result .= "{$iarea}禁";
                }
                if ($imap == 99) {
                    $result .= "全图随机";
                } else {
                    $result .= "于{$plsinfo[$imap]}";
                }
                $result .= "刷新{$inum}个&#13;";
            }
        }
    }
    $file = config('shopitem', $gamecfg);
    $shoplist = openfile($file);
    foreach ($shoplist as $lst) {
        if (!empty($lst) && strpos($lst, ',') !== false) {
            list($kind, $num, $price, $area, $item) = explode(',', $lst);
            if ($item == $which) {
                $result .= "{$area}禁起在商店中出售({$price}元)&#13;";
            }
        }
    }
    include_once config('mixitem', $gamecfg);
    global $mixinfo;
    foreach ($mixinfo as $lst) {
        if ($lst['result'][0] == $which || $lst['result'][0] == $which . ' ') {
            $result .= "通过合成获取&#13;";
            break;
        }
    }
    $file = config('synitem', $gamecfg);
    $synlist = openfile($file);
    foreach ($synlist as $lst) {
        if (!empty($lst) && strpos($lst, ',') !== false) {
            list($item, $kind) = explode(',', $lst);
            if ($item == $which) {
                $result .= "通过同调合成获取&#13;";
                break;
            }
        }
    }
    $file = config('overlay', $gamecfg);
    $ovllist = openfile($file);
    foreach ($ovllist as $lst) {
        if (!empty($lst) && strpos($lst, ',') !== false) {
            list($item, $kind) = explode(',', $lst);
            if ($item == $which) {
                $result .= "通过超量合成获取&#13;";
                break;
            }
        }
    }
    $file = config('present', $gamecfg);
    $prslist = openfile($file);
    foreach ($prslist as $lst) {
        if (!empty($lst) && strpos($lst, ',') !== false) {
            list($item, $kind) = explode(',', $lst);
            if ($item == $which) {
                $result .= "打开礼品盒时有概率获得&#13;";
                break;
            }
        }
    }
    $file = config('box', $gamecfg);
    $boxlist = openfile($file);
    foreach ($boxlist as $lst) {
        if (!empty($lst) && strpos($lst, ',') !== false) {
            list($item, $kind) = explode(',', $lst);
            if ($item == $which) {
                $result .= "打开游戏王卡包时有概率获得&#13;";
                break;
            }
        }
    }
    if ($which == "悲叹之种") {
        $result .= "通过使用『灵魂宝石』强化物品失败获得&#13;";
    }
    return $result;
}
Exemplo n.º 19
0
function itemmix($mlist, $itemselect = -1)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'player', 'logger', 'itemmix'));
    $sks_count = 0;
    $sum_star = 0;
    $mixitem = array();
    foreach ($mlist as $val) {
        $mitm = ${'itm' . $val};
        foreach (array('/锋利的/', '/电气/', '/毒性/', '/-改$/') as $value) {
            $mitm = preg_replace($value, '', $mitm);
        }
        $mitm = str_replace('钉棍棒', '棍棒', $mitm);
        $mixitem[] = $mitm;
        $z = ${'itmk' . $val};
        $star = 0;
        for ($i = 0; $i < strlen($z); $i++) {
            if ('0' <= $z[$i] && $z[$i] <= '9') {
                $star = $star * 10 + (int) $z[$i];
            }
        }
        if ($star == 0) {
            return $chprocess($mlist, $itemselect);
        }
        //所有道具都有星数
        $sum_star += $star;
        if (strpos(${'itmsk' . $val}, 's') !== false) {
            $sks_count++;
        }
    }
    //恰有一个调整属性
    if ($sks_count != 1) {
        return $chprocess($mlist, $itemselect);
    }
    $file = __DIR__ . '/config/sync.config.php';
    $slist = openfile($file);
    $num = count($slist);
    $sync = -1;
    $syncn = $synck = $synce = $syncs = $syncsk = array();
    for ($i = 0; $i < $num; $i++) {
        $t = explode(',', $slist[$i]);
        $tn = $t[0];
        $tk = $t[1];
        $te = $t[2];
        $ts = $t[3];
        $tsk = $t[4];
        $tstar = $t[5];
        $treq = $t[6];
        //检查星数是否符合
        if ($sum_star != $tstar) {
            continue;
        }
        //检查是否满足了要求的合成来源
        $lis = explode('+', $treq);
        $flag = 1;
        foreach ($lis as $key) {
            if ($key != '') {
                if (!in_array($key, $mixitem)) {
                    $flag = 0;
                    break;
                }
            }
        }
        if (!$flag) {
            continue;
        }
        $sync++;
        $syncn[$sync] = $tn;
        $synck[$sync] = $tk;
        $synce[$sync] = $te;
        $syncs[$sync] = $ts;
        $syncsk[$sync] = $tsk;
    }
    //无满足条件的同调结果,失败
    if ($sync == -1) {
        return $chprocess($mlist, $itemselect);
    }
    if ($itemselect == -1) {
        $mask = 0;
        foreach ($mlist as $k) {
            if (1 <= $k && $k <= 6) {
                $mask |= 1 << (int) $k - 1;
            }
        }
        $cmd .= '<input type="hidden" id="mode" name="mode" value="itemmain">';
        $cmd .= '<input type="hidden" id="command" name="command" value="itemmix">';
        $cmd .= '<input type="hidden" id="mixmask" name="mixmask" value="' . $mask . '">';
        $cmd .= '<input type="hidden" id="itemselect" name="itemselect" value="999">';
        $cmd .= "请选择同调结果<br><br>";
        for ($i = 0; $i <= $sync; $i++) {
            $tn = $syncn[$i];
            $cmd .= "<input type=\"button\" class=\"cmdbutton\"  style=\"width:200\" value=\"" . $tn . "\" onclick=\"\$('itemselect').value='" . $i . "';postCmd('gamecmd','command.php');this.disabled=true;\">";
        }
        $cmd .= "<input type=\"button\" class=\"cmdbutton\"  style=\"width:200\" value=\"返回\" onclick=\"postCmd('gamecmd','command.php');this.disabled=true;\">";
        return;
    } else {
        $i = (int) $itemselect;
        if ($i < 0 || $i > $sync) {
            $mode = 'command';
            return;
        }
        foreach ($mlist as $val) {
            \itemmix\itemreduce('itm' . $val);
        }
        $itm0 = $syncn[$i];
        $itmk0 = $synck[$i];
        $itme0 = $synce[$i];
        $itms0 = $syncs[$i];
        $itmsk0 = $syncsk[$i];
        addnews($now, 'syncmix', $name, $itm0);
        \itemmain\itemget();
        $mode = 'command';
        return;
    }
    $chprocess($mlist, $itemselect);
}
Exemplo n.º 20
0
function itemuse(&$theitem)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'player', 'itemmain', 'logger'));
    $itm =& $theitem['itm'];
    $itmk =& $theitem['itmk'];
    $itme =& $theitem['itme'];
    $itms =& $theitem['itms'];
    $itmsk =& $theitem['itmsk'];
    if (strpos($itmk, 'p') === 0) {
        //现在所有的礼物盒类道具都应该使用类别'p',依靠属性来判断究竟是什么礼物盒
        //每个属性对应的文件名
        $p_arr = array('^999^' => 'present', '^998^' => 'ygobox', '^997^' => 'fybox', '^996^' => 'ugabox', '^995^' => 'ugcbox');
        //这样写的问题就是,礼盒的属性里不能再有其他内容了,否则就会爆炸,保险起见加一个判定
        $pi_flag = false;
        foreach (array_keys($p_arr) as $p_sk) {
            $isk = \itemmain\get_itmsk_array($itmsk);
            if (in_array($p_sk, $isk) && sizeof($isk) == 1) {
                $pi_flag = true;
            }
        }
        if (!$pi_flag) {
            $log .= "这个盒子看起来已经坏掉了,还是扔了吧。<br>";
            return;
        }
        $p_path = '/config/' . $p_arr[$isk[0]] . '.config.php';
        $log .= "你打开了<span class=\"yellow\">{$itm}</span>。<br>";
        $file = __DIR__ . $p_path;
        $plist = openfile($file);
        $rand = rand(0, count($plist) - 1);
        list($in, $ik, $ie, $is, $isk) = explode(',', $plist[$rand]);
        $itm0 = $in;
        $itmk0 = $ik;
        $itme0 = $ie;
        $itms0 = $is;
        $itmsk0 = $isk;
        addnews($now, 'present', $name, $itm, $in);
        \itemmain\itms_reduce($theitem);
        \itemmain\itemget();
        return;
    }
    /*elseif(strpos ( $itmk, 'ygo' ) === 0){
    			$log.="你打开了<span class=\"yellow\">$itm</span>。<br>";
    			$file = __DIR__.'/config/ygobox.config.php';
    			$plist1 = openfile($file);
    			$rand1 = rand(0,count($plist1)-1);
    			list($in,$ik,$ie,$is,$isk) = explode(',',$plist1[$rand1]);
    			$itm0 = $in;$itmk0=$ik;$itme0=$ie;$itms0=$is;$itmsk0=$isk;
    			addnews($now,'present',$name,$itm,$in);
    			\itemmain\itms_reduce($theitem);
    			\itemmain\itemget();	
    			return;
    		} elseif(strpos ( $itmk, 'fy' ) === 0){
    			$log.="你打开了<span class=\"yellow\">$itm</span>。<br>";
    			$file = __DIR__.'/config/fybox.config.php';
    			$plist1 = openfile($file);
    			$rand1 = rand(0,count($plist1)-1);
    			list($in,$ik,$ie,$is,$isk) = explode(',',$plist1[$rand1]);
    			$itm0 = $in;$itmk0=$ik;$itme0=$ie;$itms0=$is;$itmsk0=$isk;
    			addnews($now,'present',$name,$itm,$in);
    			\itemmain\itms_reduce($theitem);
    			\itemmain\itemget();	
    			return;
    		} elseif(strpos ( $itmk, 'GA' ) === 0){
    			$log.="你打开了<span class=\"yellow\">$itm</span>。<br>";
    			$file = __DIR__.'/config/ugabox.config.php';
    			$plist1 = openfile($file);
    			$rand1 = rand(0,count($plist1)-1);
    			list($in,$ik,$ie,$is,$isk) = explode(',',$plist1[$rand1]);
    			$itm0 = $in;$itmk0=$ik;$itme0=$ie;$itms0=$is;$itmsk0=$isk;
    			addnews($now,'present',$name,$itm,$in);
    			\itemmain\itms_reduce($theitem);
    			\itemmain\itemget();	
    			return;
    		} elseif(strpos ( $itmk, 'GC' ) === 0){
    			$log.="你打开了<span class=\"yellow\">$itm</span>。<br>";
    			$file = __DIR__.'/config/ugcbox.config.php';
    			$plist1 = openfile($file);
    			$rand1 = rand(0,count($plist1)-1);
    			list($in,$ik,$ie,$is,$isk) = explode(',',$plist1[$rand1]);
    			$itm0 = $in;$itmk0=$ik;$itme0=$ie;$itms0=$is;$itmsk0=$isk;
    			addnews($now,'present',$name,$itm,$in);
    			\itemmain\itms_reduce($theitem);
    			\itemmain\itemget();	
    			return;
    		}*/
    $chprocess($theitem);
}
Exemplo n.º 21
0
function enter_battlefield($xuser, $xpass, $xgender, $xicon, $card = 0)
{
    eval(import_module('sys'));
    if ($xgender != 'm' && $xgender != 'f') {
        $xgender = 'm';
    }
    $validnum++;
    $alivenum++;
    $name = $xuser;
    $pass = $xpass;
    global $gd;
    $gd = $xgender;
    $type = 0;
    $endtime = $now;
    global $sNo;
    $sNo = $validnum;
    global $hp, $mhp, $sp, $msp, $att, $def, $wep, $itm, $icon;
    $hp = $mhp = $hplimit;
    $sp = $msp = $splimit;
    $rand = rand(0, 15);
    $att = 95 + $rand;
    $def = 105 - $rand;
    $pls = 0;
    $killnum = 0;
    $lvl = 0;
    $skillpoint = 0;
    $exp = $areanum * 20;
    $money = 20;
    $rage = 0;
    $pose = 0;
    $tactic = 0;
    $icon = $xicon ? $xicon : rand(1, $iconlimit);
    $club = 0;
    $arb = $gd == 'm' ? '男生校服' : '女生校服';
    $arbk = 'DB';
    $arbe = 5;
    $arbs = 15;
    $arbsk = '';
    $arh = $ara = $arf = $art = '';
    $arhk = $arak = $arfk = $artk = '';
    $arhsk = $arask = $arfsk = $artsk = '';
    $arhe = $arae = $arfe = $arte = 0;
    $arhs = $aras = $arfs = $arts = 0;
    for ($i = 0; $i <= 6; $i++) {
        $itm[$i] = $itmk[$i] = $itmsk[$i] = '';
        $itme[$i] = $itms[$i] = 0;
    }
    $itm[1] = '面包';
    $itmk[1] = 'HH';
    $itme[1] = 100;
    $itms[1] = 30;
    $itm[2] = '矿泉水';
    $itmk[2] = 'HS';
    $itme[2] = 100;
    $itms[2] = 30;
    //solo局补给增加,配发探测器
    if (in_array($gametype, $elorated_mode)) {
        $itms[1] = 50;
        $itms[2] = 50;
        $itm[5] = '生命探测器';
        $itmk[5] = 'ER';
        $itme[5] = 5;
        $itms[5] = 1;
    }
    $weplist = openfile(config('stwep', $gamecfg));
    do {
        $index = rand(1, count($weplist) - 1);
        list($wep, $wepk, $wepe, $weps, $wepsk) = explode(",", $weplist[$index]);
    } while (!$wepk);
    $stitemlist = openfile(config('stitem', $gamecfg));
    do {
        $index = rand(1, count($stitemlist) - 1);
        list($itm[3], $itmk[3], $itme[3], $itms[3], $itmsk[3]) = explode(",", $stitemlist[$index]);
    } while (!$itmk[3]);
    do {
        $index = rand(1, count($stitemlist) - 1);
        list($itm[4], $itmk[4], $itme[4], $itms[4], $itmsk[4]) = explode(",", $stitemlist[$index]);
    } while (!$itmk[4] || $itmk[3] == $itmk[4]);
    if (strpos($wepk, 'WG') === 0) {
        $itm[3] = '手枪子弹';
        $itmk[3] = 'GB';
        $itme[3] = 1;
        $itms[3] = 12;
        $itmsk[3] = '';
    }
    if ($name == 'Amarillo_NMC') {
        $msp += 500;
        $mhp += 500;
        $hp += 500;
        $sp += 500;
        $att += 200;
        $def += 200;
        $exp += 3000;
        $money = 20000;
        $rage = 255;
        $pose = 1;
        $tactic = 3;
        $itm[1] = '死者苏生';
        $itmk[1] = 'HB';
        $itme[1] = 2000;
        $itms[1] = 400;
        $itmsk[1] = '';
        $itm[2] = '移动PC';
        $itmk[2] = 'EE';
        $itme[2] = 50;
        $itms[2] = 1;
        $itm[3] = '超光速快子雷达';
        $itmk[3] = 'ER';
        $itme[3] = 32;
        $itms[3] = 1;
        $itmsk[3] = 2;
        $itm[4] = '凸眼鱼';
        $itmk[4] = 'Y';
        $itme[4] = 1;
        $itms[4] = 30;
        $itmsk[4] = '';
        $itm[5] = '楠叶特制营养剂';
        $itmk[5] = 'ME';
        $itme[5] = 50;
        $itms[5] = 12;
        $itm[6] = '测试道具';
        $itmk[6] = 'ME';
        $itme[6] = 50;
        $itms[6] = 12;
        $wep = '神圣手榴弹';
        $wepk = 'WC';
        $wepe = 8765;
        $weps = 876;
        $wepsk = 'd';
        $arb = '守桥人的长袍';
        $arbk = 'DB';
        $arbe = 3200;
        $arbs = 100;
        $arbsk = 'A';
        $arh = '千年积木';
        $arhk = 'DH';
        $arhe = 1600;
        $arhs = 120;
        $arhsk = 'c';
        $ara = '皇家钻戒';
        $arak = 'DA';
        $arae = 1600;
        $aras = 120;
        $arask = 'a';
        $arf = '火弩箭';
        $arfk = 'DF';
        $arfe = 1600;
        $arfs = 120;
        $arfsk = 'M';
        $art = '贤者之石';
        $artk = 'A';
        $arte = 9999;
        $arts = 999;
        $artsk = 'H';
        $wp = $wk = $wg = $wc = $wd = $wf = 600;
    } elseif ($name == '霜火协奏曲') {
        $art = '击败思念的纹章';
        $artk = 'A';
        $arte = 1;
        $arts = 1;
        $artsk = 'zZ';
    } elseif ($name == '时期') {
        $art = '击败鬼畜级思念的纹章';
        $artk = 'A';
        $arte = 1;
        $arts = 1;
        $artsk = 'zZ';
    } elseif ($name == '枪毙的某神' || $name == '精灵们的手指舞') {
        $art = 'TDG地雷的证明';
        $artk = 'A';
        $arte = 1;
        $arts = 1;
        $artsk = 'zZ';
    }
    $state = 0;
    $bid = 0;
    $inf = $teamID = $teamPass = '';
    ///////////////////////////////////////////////////////////////
    require config('card', $gamecfg);
    if ($card == 81) {
        $arr = array('0');
        $r = rand(1, 100);
        if ($r <= 20) {
            $arr = $cardindex['S'];
        } else {
            if ($r <= 60) {
                $arr = $cardindex['A'];
            } else {
                if ($r <= 80) {
                    $arr = $cardindex['B'];
                } else {
                    $arr = $cardindex['C'];
                }
            }
        }
        $c = count($arr) - 1;
        $card = $arr[rand(0, $c)];
    }
    $cardfix = $cards[$card];
    $cardname = $carddesc[$card]['name'];
    $cardrare = $carddesc[$card]['rare'];
    ///////////////////////////////////////////////////////////////
    foreach ($cardfix as $key => $value) {
        if (substr($key, 0, 3) == "itm") {
            $tt = substr($key, -1);
            $ts = substr($key, 0, strlen($key) - 1);
            ${$ts}[$tt] = $value;
        } else {
            ${$key} = $value;
        }
    }
    ///////////////////////////////////////////////////////////////
    $db->query("INSERT INTO {$tablepre}players (name,pass,type,endtime,gd,sNo,icon,club,hp,mhp,sp,msp,att,def,pls,lvl,`exp`,money,bid,inf,rage,pose,tactic,killnum,state,wp,wk,wg,wc,wd,wf,teamID,teamPass,wep,wepk,wepe,weps,arb,arbk,arbe,arbs,arh,arhk,arhe,arhs,ara,arak,arae,aras,arf,arfk,arfe,arfs,art,artk,arte,arts,itm0,itmk0,itme0,itms0,itm1,itmk1,itme1,itms1,itm2,itmk2,itme2,itms2,itm3,itmk3,itme3,itms3,itm4,itmk4,itme4,itms4,itm5,itmk5,itme5,itms5,itm6,itmk6,itme6,itms6,wepsk,arbsk,arhsk,arask,arfsk,artsk,itmsk0,itmsk1,itmsk2,itmsk3,itmsk4,itmsk5,itmsk6,card,cardname,skillpoint) VALUES ('{$name}','{$pass}','{$type}','{$endtime}','{$gd}','{$sNo}','{$icon}','{$club}','{$hp}','{$mhp}','{$sp}','{$msp}','{$att}','{$def}','{$pls}','{$lvl}','{$exp}','{$money}','{$bid}','{$inf}','{$rage}','{$pose}','{$tactic}','{$state}','{$killnum}','{$wp}','{$wk}','{$wg}','{$wc}','{$wd}','{$wf}','{$teamID}','{$teamPass}','{$wep}','{$wepk}','{$wepe}','{$weps}','{$arb}','{$arbk}','{$arbe}','{$arbs}','{$arh}','{$arhk}','{$arhe}','{$arhs}','{$ara}','{$arak}','{$arae}','{$aras}','{$arf}','{$arfk}','{$arfe}','{$arfs}','{$art}','{$artk}','{$arte}','{$arts}','{$itm['0']}','{$itmk['0']}','{$itme['0']}','{$itms['0']}','{$itm['1']}','{$itmk['1']}','{$itme['1']}','{$itms['1']}','{$itm['2']}','{$itmk['2']}','{$itme['2']}','{$itms['2']}','{$itm['3']}','{$itmk['3']}','{$itme['3']}','{$itms['3']}','{$itm['4']}','{$itmk['4']}','{$itme['4']}','{$itms['4']}','{$itm['5']}','{$itmk['5']}','{$itme['5']}','{$itms['5']}','{$itm['6']}','{$itmk['6']}','{$itme['6']}','{$itms['6']}','{$wepsk}','{$arbsk}','{$arhsk}','{$arask}','{$arfsk}','{$artsk}','{$itmsk['0']}','{$itmsk['1']}','{$itmsk['2']}','{$itmsk['3']}','{$itmsk['4']}','{$itmsk['5']}','{$itmsk['6']}','{$card}','{$cardname}','{$skillpoint}')");
    $db->query("UPDATE {$gtablepre}users SET lastgame='{$gamenum}' WHERE username='******'");
    ///////////////////////////////////////////////////////////////
    $pp = \player\fetch_playerdata($name);
    //为了灵活性,直接处理所有技能,在固定称号的时候记得要写入skills不然进游戏就没技能了
    //if (isset($cardfix['club'])){
    //	\clubbase\club_acquire($cardfix['club'],$pp);
    //}
    if (is_array($cardfix['skills'])) {
        foreach ($cardfix['skills'] as $key => $value) {
            if (defined('MOD_SKILL' . $key)) {
                \skillbase\skill_acquire($key, $pp);
                if ($value > 0) {
                    \skillbase\skill_setvalue($key, 'lvl', $value, $pp);
                }
            }
        }
    }
    \player\player_save($pp);
    ///////////////////////////////////////////////////////////////
    if ($cardrare == "S") {
        $rarecolor = "orange";
    } else {
        if ($cardrare == 'A') {
            $rarecolor = "linen";
        } else {
            if ($cardrare == 'B') {
                $rarecolor = "brickred";
            } else {
                if ($cardrare == 'C') {
                    $rarecolor = "seagreen";
                }
            }
        }
    }
    if ($udata['groupid'] >= 6 || $cuser == $gamefounder) {
        addnews($now, 'newgm', "<span class=\"" . $rarecolor . "\">" . $cardname . '</span> ' . $name, "{$sexinfo[$gd]}{$sNo}号", $ip);
    } else {
        addnews($now, 'newpc', "<span class=\"" . $rarecolor . "\">" . $cardname . '</span> ' . $name, "{$sexinfo[$gd]}{$sNo}号", $ip);
    }
    if ($validnum >= $validlimit && $gamestate == 20) {
        $gamestate = 30;
    }
    //$gamestate = $validnum < $validlimit ? 20 : 30;
    save_gameinfo();
}
Exemplo n.º 22
0
 if (count($onlinedb) == 1) {
     $onlinedb = array();
 } else {
     unset($onlinedb[0]);
 }
 $online_A = $guest_A = array();
 foreach ($onlinedb as $online) {
     if (trim($online)) {
         $detail = explode("\t", $online);
         $online_A[$online] = $detail[1];
     }
 }
 unset($onlinedb);
 @asort($online_A);
 $online_A = @array_keys($online_A);
 $guestdb = openfile(D_P . 'data/bbscache/guest.php');
 if (count($guestdb) == 1) {
     $guestdb = array();
 } else {
     unset($guestdb[0]);
 }
 foreach ($guestdb as $online) {
     if (trim($online)) {
         $detail = explode("\t", $online);
         $guest_A[$online] = $detail[1];
     }
 }
 unset($guestdb);
 @asort($guest_A);
 $guest_A = @array_keys($guest_A);
 $online_A = array_merge($online_A, $guest_A);
Exemplo n.º 23
0
// if uploading a tsv indicated by the POST['type']
if ($_POST['type'] == 'tsv' or $_POST['type'] == 'csv' or $_POST['type'] == 'txt') {
    // get clustering parameters
    $method = $_POST['method'];
    $metric = $_POST['metric'];
    $output = 'phyloxml';
    //create an xml file
    $title = $_POST['title'];
    $type = $_POST['type'];
    $p = $_POST['p'];
    # $addLabels = $addLabels;
    # $labelFile = $labelFile;
    // build the argument string for Rscript
    // flags do nothing,
    // future: make flags work, right now, R script assumes current order
    $rArgs = "-f {$infile} -m {$method} -d {$metric} -o {$output} -t \"{$title}\" \n\t-p {$p} -s {$type} -l {$labelFile}";
    // the file name is the expected output of clustr.r
    $stdout = callR("clustr.r", "{$rArgs}");
    $stdout = explode(",<r>,", $stdout);
    $file = $stdout[0];
    $rowlabels = $stdout[1];
    $out = openfile($file, "b");
    //give the file to the user to download
    // $name = $_FILES['file']['name'];
    $name = $title;
    require "download.php";
    // download script
    downloadFile($file, "{$name}.xml");
    // and exit so nothing else is sent back to the browser
    exit;
}
Exemplo n.º 24
0
function itemmix($mlist, $itemselect = -1)
{
    global $log, $mode, $gamecfg, $name, $nosta, $gd, $name, $nick;
    global $itm1, $itm2, $itm3, $itm4, $itm5, $itm6, $itms1, $itms2, $itms3, $itms4, $itms5, $itms6, $itme1, $itme2, $itme3, $itme4, $itme5, $itme6, $club, $wd;
    global $itmk1, $itmk2, $itmk3, $itmk4, $itmk5, $itmk6, $itmsk1, $itmsk2, $itmsk3, $itmsk4, $itmsk5, $itmsk6;
    global $syncn, $synck, $synce, $syncs, $syncsk, $sync, $reqname, $star;
    global $cmd;
    $mlist2 = array_unique($mlist);
    if (count($mlist) != count($mlist2)) {
        $log .= '相同道具不能进行合成!<br>';
        $mode = 'itemmix';
        return;
    }
    if (count($mlist) < 2) {
        $log .= '至少需要2个道具才能进行合成!';
        $mode = 'itemmix';
        return;
    }
    $issyncro = false;
    $isntsyn = false;
    $isoverlay = false;
    $isntove = false;
    $star = 0;
    $reqname = '';
    $tzname = '';
    $ostar = 0;
    $mixitem = array();
    foreach ($mlist as $val) {
        if (strlen(${'itmk' . $val}) >= 4 && strpos(${'itmsk' . $val}, 'J') !== false) {
            $isoverlay = true;
            break;
        }
    }
    foreach ($mlist as $val) {
        if (!${'itm' . $val}) {
            $log .= '所选择的道具不存在!';
            $mode = 'itemmix';
            return;
        }
        $mitm = ${'itm' . $val};
        foreach (array('/锋利的/', '/电气/', '/毒性/', '/-改$/') as $value) {
            $mitm = preg_replace($value, '', $mitm);
        }
        $mixitem[] = $mitm;
        if (strlen(${'itmk' . $val}) < 4) {
            $isntove = true;
            if ($isoverlay == true) {
                $log .= "<span class=\"red\">超量失败!所有素材消失!说明写这段代码的人还是一个有良知,明是非的中国人!</span><br>";
                addnews($now, 'mixfail', $nick . ' ' . $name, $itm0);
                foreach ($mlist as $val) {
                    ${'itm' . $val} = ${'itmk' . $val} = ${'itmsk' . $val} = '';
                    ${'itme' . $val} = ${'itms' . $val} = 0;
                }
                return;
            }
        } else {
            if ($isoverlay == false) {
                $ostar = substr(${'itmk' . $val}, 2, 2);
            }
        }
        if ($isoverlay == true) {
            if (strlen(${'itmk' . $val}) < 4 || substr(${'itmk' . $val}, 2, 2) != $ostar && $ostar != 0) {
                $log .= "<span class=\"red\">超量失败!所有素材消失!说明写这段代码的人还是一个有良知,明是非的中国人!</span><br>";
                addnews($now, 'mixfail', $nick . ' ' . $name, $itm0);
                foreach ($mlist as $val) {
                    ${'itm' . $val} = ${'itmk' . $val} = ${'itmsk' . $val} = '';
                    ${'itme' . $val} = ${'itms' . $val} = 0;
                }
                return;
            }
            $ostar = substr(${'itmk' . $val}, 2, 2);
            continue;
        } else {
            if (strlen(${'itmk' . $val}) >= 4 && strpos(${'itmsk' . $val}, 'J') !== false) {
                if (substr(${'itmk' . $val}, 2, 2) != $ostar) {
                    $log .= "<span class=\"red\">超量失败!所有素材消失!说明写这段代码的人还是一个有良知,明是非的中国人!</span><br>";
                    addnews($now, 'mixfail', $nick . ' ' . $name, $itm0);
                    foreach ($mlist as $val) {
                        ${'itm' . $val} = ${'itmk' . $val} = ${'itmsk' . $val} = '';
                        ${'itme' . $val} = ${'itms' . $val} = 0;
                    }
                    return;
                }
                $isoverlay = true;
                $ostar = substr(${'itmk' . $val}, 2, 2);
            }
        }
        if ($issyncro == true) {
            if (strlen(${'itmk' . $val}) < 4 && $isntsyn == false) {
                $log .= "<span class=\"red\">同调失败!所有素材消失!真是大快人心啊!</span><br>";
                addnews($now, 'mixfail', $nick . ' ' . $name, $itm0);
                foreach ($mlist as $val) {
                    ${'itm' . $val} = ${'itmk' . $val} = ${'itmsk' . $val} = '';
                    ${'itme' . $val} = ${'itms' . $val} = 0;
                }
                return;
            }
            if (strpos(${'itmsk' . $val}, 's') !== false) {
                $log .= "<span class=\"red\">同调失败!所有素材消失!真是大快人心啊!</span><br>";
                addnews($now, 'mixfail', $nick . ' ' . $name, $itm0);
                foreach ($mlist as $val) {
                    ${'itm' . $val} = ${'itmk' . $val} = ${'itmsk' . $val} = '';
                    ${'itme' . $val} = ${'itms' . $val} = 0;
                }
                return;
            }
            $star += substr(${'itmk' . $val}, 2, 2);
            $reqname .= ${'itm' . $val} . '_';
        } else {
            if (strpos(${'itmsk' . $val}, 's') !== false) {
                if ($isntsyn == false) {
                    $issyncro = true;
                    $star += substr(${'itmk' . $val}, 2, 2);
                    $tzname = ${'itm' . $val};
                    continue;
                } else {
                    $log .= "<span class=\"red\">同调失败!所有素材消失!真是大快人心啊!</span><br>";
                    addnews($now, 'mixfail', $nick . ' ' . $name, $itm0);
                    foreach ($mlist as $val) {
                        ${'itm' . $val} = ${'itmk' . $val} = ${'itmsk' . $val} = '';
                        ${'itme' . $val} = ${'itms' . $val} = 0;
                    }
                    return;
                }
            }
            if (strlen(${'itmk' . $val}) >= 4) {
                $star += substr(${'itmk' . $val}, 2, 2);
                $reqname .= ${'itm' . $val} . '_';
            } else {
                $isntsyn = true;
            }
        }
    }
    //overlay
    if ($isoverlay == true) {
        $file1 = config('overlay', $gamecfg);
        $olist = openfile($file1);
        $num = count($olist) - 1;
        $nnum = sizeof($mixitem);
        $sync = -1;
        $syncn = $synck = $synce = $syncs = $syncsk = array();
        for ($i = 0; $i <= $num; $i++) {
            $t = explode(',', $olist[$i]);
            if ($t[5] != $ostar || $t[6] != $nnum) {
                continue;
            }
            $sync++;
            $syncn[$sync] = $t[0];
            $synck[$sync] = $t[1];
            $synce[$sync] = $t[2];
            $syncs[$sync] = $t[3];
            $syncsk[$sync] = $t[4];
        }
        if ($sync == -1) {
            $log .= "<span class=\"red\">超量失败!所有素材消失!说明写这段代码的人还是一个有良知,明是非的中国人!</span><br>";
            foreach ($mlist as $val) {
                ${'itm' . $val} = ${'itmk' . $val} = ${'itmsk' . $val} = '';
                ${'itme' . $val} = ${'itms' . $val} = 0;
            }
            addnews($now, 'mixfail', $nick . ' ' . $name, $itm0);
            return;
        }
        if ($itemselect == -1) {
            $mask = 0;
            foreach ($mlist as $k) {
                if (1 <= $k && $k <= 6) {
                    $mask |= 1 << (int) $k - 1;
                }
            }
            $cmd .= '<input type="hidden" id="mode" name="mode" value="itemmain">';
            $cmd .= '<input type="hidden" id="command" name="command" value="itemmix">';
            $cmd .= '<input type="hidden" id="mixmask" name="mixmask" value="' . $mask . '">';
            $cmd .= '<input type="hidden" id="itemselect" name="itemselect" value="999">';
            $cmd .= "请选择超量结果<br><br>";
            for ($i = 0; $i <= $sync; $i++) {
                $tn = $syncn[$i];
                $tk = $syncn[$i] . '_' . $synck[$i] . '_' . $synce[$i] . '_' . $syncs[$i] . '_' . $syncsk[$i] . '_-1_';
                $cmd .= "<input type=\"button\" class=\"cmdbutton\"  style=\"width:200\" value=\"" . $tn . "\" onclick=\"\$('itemselect').value='" . $i . "';postCmd('gamecmd','command.php');this.disabled=true;\">";
            }
            $cmd .= "<input type=\"button\" class=\"cmdbutton\"  style=\"width:200\" value=\"返回\" onclick=\"postCmd('gamecmd','command.php');this.disabled=true;\">";
        } else {
            $i = (int) $itemselect;
            if ($i < 0 || $i > $sync) {
                $mode = 'command';
                return;
            }
            foreach ($mlist as $val) {
                ${'itm' . $val} = ${'itmk' . $val} = ${'itmsk' . $val} = '';
                ${'itme' . $val} = ${'itms' . $val} = 0;
            }
            $tk = $syncn[$i] . '_' . $synck[$i] . '_' . $synce[$i] . '_' . $syncs[$i] . '_' . $syncsk[$i] . '_-1_';
            include_once GAME_ROOT . './include/game/special.func.php';
            syncro($tk);
            $mode = 'command';
        }
        return;
    }
    //syncro
    if ($issyncro == true && $isntsyn == false) {
        $sync = -1;
        $syncn = $synck = $synce = $syncs = $syncsk = array();
        $file = config('synitem', $gamecfg);
        $slist = openfile($file);
        $num = count($slist) - 1;
        for ($i = 0; $i <= $num; $i++) {
            $t = explode(',', $slist[$i]);
            $rnum = count($t) - 8;
            $tn = $t[0];
            $tk = $t[1];
            $te = $t[2];
            $ts = $t[3];
            $tsk = $t[4];
            $tstar = $t[5];
            if ($star != $tstar) {
                continue;
            }
            if ($t[6] != '-1' && strpos($tzname, $t[6]) === false) {
                continue;
            }
            $isok = true;
            for ($j = 1; $j <= $rnum; $j++) {
                if ($t[7 + $j - 1] != '-1' && strpos($reqname, $t[7 + $j - 1]) === false) {
                    $isok = false;
                    break;
                }
            }
            if ($isok == false) {
                continue;
            }
            $sync++;
            $syncn[$sync] = $tn;
            $synck[$sync] = $tk;
            $synce[$sync] = $te;
            $syncs[$sync] = $ts;
            $syncsk[$sync] = $tsk;
        }
        if ($sync == -1) {
            $log .= "<span class=\"red\">同调失败!所有素材消失!真是大快人心啊!</span><br>";
            foreach ($mlist as $val) {
                ${'itm' . $val} = ${'itmk' . $val} = ${'itmsk' . $val} = '';
                ${'itme' . $val} = ${'itms' . $val} = 0;
            }
            addnews($now, 'mixfail', $nick . ' ' . $name, $itm0);
            return;
        }
        if ($itemselect == -1) {
            $mask = 0;
            foreach ($mlist as $k) {
                if (1 <= $k && $k <= 6) {
                    $mask |= 1 << (int) $k - 1;
                }
            }
            $cmd .= '<input type="hidden" id="mode" name="mode" value="itemmain">';
            $cmd .= '<input type="hidden" id="command" name="command" value="itemmix">';
            $cmd .= '<input type="hidden" id="mixmask" name="mixmask" value="' . $mask . '">';
            $cmd .= '<input type="hidden" id="itemselect" name="itemselect" value="999">';
            $cmd .= "请选择同调结果<br><br>";
            for ($i = 0; $i <= $sync; $i++) {
                $tn = $syncn[$i];
                $tk = $syncn[$i] . '_' . $synck[$i] . '_' . $synce[$i] . '_' . $syncs[$i] . '_' . $syncsk[$i] . '_' . $star . '_';
                $cmd .= "<input type=\"button\" class=\"cmdbutton\"  style=\"width:200\" value=\"" . $tn . "\" onclick=\"\$('itemselect').value='" . $i . "';postCmd('gamecmd','command.php');this.disabled=true;\">";
            }
            $cmd .= "<input type=\"button\" class=\"cmdbutton\"  style=\"width:200\" value=\"返回\" onclick=\"postCmd('gamecmd','command.php');this.disabled=true;\">";
        } else {
            $i = (int) $itemselect;
            if ($i < 0 || $i > $sync) {
                $mode = 'command';
                return;
            }
            foreach ($mlist as $val) {
                ${'itm' . $val} = ${'itmk' . $val} = ${'itmsk' . $val} = '';
                ${'itme' . $val} = ${'itms' . $val} = 0;
            }
            $tk = $syncn[$i] . '_' . $synck[$i] . '_' . $synce[$i] . '_' . $syncs[$i] . '_' . $syncsk[$i] . '_1_';
            include_once GAME_ROOT . './include/game/special.func.php';
            syncro($tk);
            $mode = 'command';
        }
        return;
    }
    include_once config('mixitem', $gamecfg);
    $mixflag = false;
    foreach ($mixinfo as $minfo) {
        if (!array_diff($mixitem, $minfo['stuff']) && !array_diff($minfo['stuff'], $mixitem) && count($mixitem) == count($minfo['stuff'])) {
            $mixflag = true;
            break;
        }
    }
    $itmstr = '';
    foreach ($mixitem as $val) {
        $itmstr .= $val . ' ';
    }
    $itmstr = substr($itmstr, 0, -1);
    if (!$mixflag) {
        $log .= "<span class=\"yellow\">{$itmstr}</span>不能合成!<br>";
        $mode = 'itemmix';
    } else {
        foreach ($mlist as $val) {
            itemreduce('itm' . $val);
        }
        global $itm0, $itmk0, $itme0, $itms0, $itmsk0;
        list($itm0, $itmk0, $itme0, $itms0, $itmsk0) = $minfo['result'];
        $log .= "<span class=\"yellow\">{$itmstr}</span>合成了<span class=\"yellow\">{$minfo['result'][0]}</span><br>";
        //var_dump($minfo['result'][0]);
        addnews($now, 'itemmix', $nick . ' ' . $name, $itm0);
        //if($club == 5) { $wd += 2; }
        //else { $wd+=1; }
        $wd += 1;
        if (strpos($itmk0, 'WD') === 0 && $club == 5 && $itms0 !== $nosta) {
            $itms0 = ceil($itms0 * 1.5);
        } elseif (strpos($itmk0, 'H') === 0 && $club == 16 && $itms0 !== $nosta) {
            $itms0 = ceil($itms0 * 2);
        } elseif (($itmk0 == 'EE' || $itmk0 == 'ER') && $club == 7) {
            $itme0 *= 5;
        }
        //elseif(($itm0 == '移动PC' || $itm0 == '广域生命探测器') && ($club == 7)){ $itme0 *= 3; }
        //检查成就
        include_once GAME_ROOT . './include/game/achievement.func.php';
        check_mixitem_achievement($name, $itm0);
        itemget();
    }
    return;
}
Exemplo n.º 25
0
function printmodtable($file, $ff = 0)
{
    if (!file_exists($file)) {
        $log .= "<span><font color=\"red\">错误:模块列表文件不存在。</font></span><br>";
        die;
    }
    $content = openfile($file);
    $in = sizeof($content);
    $n = 0;
    for ($i = 0; $i < $in; $i++) {
        list($a, $b, $c) = explode(',', $content[$i]);
        $modn[$i] = $a;
        $modp[$i] = $b;
        $modinuse[$i] = $c;
        $modinuse2[$i] = $c;
    }
    global $___TEMP_DRY_RUN, $___TEMP_DRY_RUN_COUNTER;
    $___TEMP_DRY_RUN = 1;
    for ($i = 0; $i < $in; $i++) {
        $modname = $modn[$i];
        $modpath = $modp[$i];
        $inuse = $modinuse[$i];
        if (!file_exists(GAME_ROOT . './include/modules/' . $modpath . 'module.inc.php')) {
            $modinuse[$i] = 2;
            continue;
        }
        global $faillog;
        $faillog = "<span><font color=\"red\">遇到了一个未知错误。这可能是由于模块{$modname}包含语法错误造成的。</font></span><br>";
        require GAME_ROOT . './include/modules/' . $modpath . 'module.inc.php';
        $faillog = '';
        $dependency[$i] = explode(" ", $___MODULE_dependency);
        $dependency_optional[$i] = explode(" ", $___MODULE_dependency_optional);
        $conflict[$i] = explode(" ", $___MODULE_conflict);
    }
    echo '<span><font color="red">红色</font>:损坏的模块或不满足的依赖关系<br><font color="green">绿色</font>:启用的模块或满足的依赖关系<br><font color="grey">灰色</font>:被禁用的模块或不满足的可选依赖关系</span>';
    echo '<br><br><table border="1"><tr><td>模块名</td><td>依赖</td><td>可选依赖</td><td>冲突</td><td>操作</td>';
    for ($i = 0; $i < $in; $i++) {
        $modname = $modn[$i];
        $modpath = $modp[$i];
        $inuse = $modinuse[$i];
        echo '<tr><td>';
        if ($inuse == 0) {
            echo "<font color=\"grey\">{$modname}</font>";
        } else {
            if ($inuse == 1) {
                echo "<font color=\"green\">{$modname}</font>";
            } else {
                echo "<font color=\"red\">{$modname}</font>";
            }
        }
        echo '</td><td>';
        if ($inuse == 2) {
            echo "<font color=\"red\">损坏</font>";
        } else {
            foreach ($dependency[$i] as $key) {
                if ($key != '') {
                    if ($inuse == 0) {
                        echo "<font color=\"grey\">{$key}</font>";
                    } else {
                        $flag = 0;
                        for ($j = 0; $j < $in; $j++) {
                            if ($modn[$j] == $key || $key == 'root') {
                                $flag = 1;
                                if ($modinuse[$j] == 0 && $key != 'root') {
                                    echo "<font color=\"red\">{$key}</font>";
                                } else {
                                    if ($modinuse[$j] == 1 || $key == 'root') {
                                        echo "<font color=\"green\">{$key}</font>";
                                    } else {
                                        echo "<font color=\"red\">{$key}</font>";
                                    }
                                }
                                break;
                            }
                        }
                        if (!$flag) {
                            echo "<font color=\"red\">{$key}</font>";
                        }
                    }
                    echo '&nbsp;';
                }
            }
        }
        echo '</td><td>';
        if ($inuse == 2) {
            echo "<font color=\"red\">损坏</font>";
        } else {
            foreach ($dependency_optional[$i] as $key) {
                if ($key != '') {
                    if ($inuse == 0) {
                        echo "<font color=\"grey\">{$key}</font>";
                    } else {
                        $flag = 0;
                        for ($j = 0; $j < $in; $j++) {
                            if ($modn[$j] == $key || $key == 'root') {
                                $flag = 1;
                                if ($modinuse[$j] == 0 && $key != 'root') {
                                    echo "<font color=\"grey\">{$key}</font>";
                                } else {
                                    if ($modinuse[$j] == 1 || $key == 'root') {
                                        echo "<font color=\"green\">{$key}</font>";
                                    } else {
                                        echo "<font color=\"grey\">{$key}</font>";
                                    }
                                }
                                break;
                            }
                        }
                        if (!$flag) {
                            echo "<font color=\"grey\">{$key}</font>";
                        }
                    }
                    echo '&nbsp;';
                }
            }
        }
        echo '</td><td>';
        if ($inuse == 2) {
            echo "<font color=\"red\">损坏</font>";
        } else {
            foreach ($conflict[$i] as $key) {
                if ($key != '') {
                    if ($inuse == 0) {
                        echo "<font color=\"grey\">{$key}</font>";
                    } else {
                        $flag = 0;
                        for ($j = 0; $j < $in; $j++) {
                            if ($modn[$j] == $key || $key == 'root') {
                                $flag = 1;
                                if ($modinuse2[$j] == 0 && $key != 'root') {
                                    echo "<font color=\"grey\">{$key}</font>";
                                } else {
                                    echo "<font color=\"red\">{$key}</font>";
                                }
                                break;
                            }
                        }
                        if (!$flag) {
                            echo "<font color=\"grey\">{$key}</font>";
                        }
                    }
                    echo '&nbsp;';
                }
            }
        }
        echo '</td><td>';
        if (!$ff) {
            if ($modinuse[$i] == 2) {
                if ($modinuse2[$i] == 0) {
                    echo '<span><font color="black">[启用]</font></span>';
                } else {
                    echo '<a href="modulemng.php?action=disable&sid=' . $i . '" style="text-decoration: none"><span><font color="red">[禁用]</font></span></a>';
                }
            } else {
                if ($modinuse2[$i] == 0) {
                    echo '<a href="modulemng.php?action=enable&sid=' . $i . '" style="text-decoration: none"><span><font color="blue">[启用]</font></span></a>';
                } else {
                    echo '<a href="modulemng.php?action=disable&sid=' . $i . '" style="text-decoration: none"><span><font color="red">[禁用]</font></span></a>';
                }
            }
        } else {
            if ($modinuse2[$i] == 0) {
                echo '<a href="modulemng.php?action=remove&sid=' . $i . '" style="text-decoration: none"><span><font color="red">[删除模块]</font></span></a>';
            }
        }
        echo '</td></tr>';
    }
    echo '</table>';
}
Exemplo n.º 26
0
            $adminonly = '';
        }
        if ($groupid == '3') {
            $adminonly = "{$adminonly}I P : {$onlinedb['2']}\n";
        }
        $onlineinfo = "{$adminonly}&#35770;&#22363;: {$onlinedb['6']}{$inread}\n&#26102;&#38388;: {$onlinedb['7']}";
        $flag++;
        if ($flag % 7 == 0) {
            $index_whosonline .= '</tr><tr>';
        }
        $index_whosonline .= "<td style=\"border:0;width:14%\"><img src='{$imgpath}/{$stylepath}/group/{$img}.gif' align='bottom'> <a href=u.php?action=show&uid={$onlinedb['8']} title='{$onlineinfo}'>{$onlinedb['0']}</a></td>";
    }
}
unset($onlinearray);
if ($db_showguest == 1) {
    $guestarray = openfile(D_P . "data/bbscache/guest.php");
    $unregcount = count($guestarray);
    if ($guestarray[0] == '') {
        $userunreg = 0;
    }
    for ($i = 1; $i < $unregcount; $i++) {
        if (strpos($guestarray[$i], "\t") !== false) {
            $guestdb = explode("\t", $guestarray[$i]);
            $inread = '';
            if ($guestdb[3]) {
                $inread = '(Read)';
            }
            if ($groupid == '3') {
                $ipinfo = "I P : {$guestdb[0]}\n";
            }
            $onlineinfo = "{$ipinfo}&#35770;&#22363;: {$guestdb['4']}{$inread}\n&#26102;&#38388;: {$guestdb['5']}";
Exemplo n.º 27
0
function get_plugin_info($pluginName)
{
    $plugin = array();
    $plugindate = openfile(DC_PLUGINS_PATH . "/{$pluginName}.php");
    preg_match("|Plugin Name:(.*)|i", $plugindate, $plugin['name']);
    preg_match("|Plugin URI:(.*)|i", $plugindate, $plugin['uri']);
    preg_match("|Description:(.*)|i", $plugindate, $plugin['description']);
    preg_match("|Version:(.*)|i", $plugindate, $plugin['version']);
    preg_match("|Author:(.*)|i", $plugindate, $plugin['author']);
    preg_match("|Author URI:(.*)|i", $plugindate, $plugin['author_uri']);
    preg_match("|TAG:(.*)|i", $plugindate, $plugin['tag']);
    return $plugin;
}
Exemplo n.º 28
0
/**
 * 从文件缓存获取用户正在看
 *
 * @param int $username 用户名
 * @return array
 */
function getViewingByFile($username)
{
    $onlinedb = is_file(D_P . 'data/bbscache/online.php') ? openfile(D_P . 'data/bbscache/online.php') : array();
    if (!$onlinedb) {
        return array();
    }
    foreach ($onlinedb as $v) {
        if (!trim($v)) {
            continue;
        }
        $online = explode("\t", $v);
        if ($online[0] == $username) {
            break;
        }
    }
    return array('tid' => isset($online[4]) && $online[4] ? $online[4] : '', 'fid' => isset($online[3]) && $online[3] ? $online[3] : '');
}
Exemplo n.º 29
0
function itemmix($mlist, $itemselect = -1)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'player', 'logger', 'itemmix'));
    $last_star = -1;
    $num = 0;
    foreach ($mlist as $val) {
        $mitm = ${'itm' . $val};
        foreach (array('/锋利的/', '/电气/', '/毒性/', '/-改$/') as $value) {
            $mitm = preg_replace($value, '', $mitm);
        }
        $mitm = str_replace('钉棍棒', '棍棒', $mitm);
        $mixitem[] = $mitm;
        $z = ${'itmk' . $val};
        $star = 0;
        for ($i = 0; $i < strlen($z); $i++) {
            if ('0' <= $z[$i] && $z[$i] <= '9') {
                $star = $star * 10 + (int) $z[$i];
            }
        }
        if ($star == 0) {
            return $chprocess($mlist, $itemselect);
        }
        //所有道具都有星数
        if ($last_star == -1) {
            $last_star = $star;
            $num = 1;
        } else {
            if ($star != $last_star) {
                //所有星数必须相同
                return $chprocess($mlist, $itemselect);
            } else {
                $num++;
            }
        }
        if (strpos(${'itmsk' . $val}, 'J') === false) {
            return $chprocess($mlist, $itemselect);
        }
        //必须均为超量素材
    }
    if ($last_star == -1) {
        return $chprocess($mlist, $itemselect);
    }
    $file = __DIR__ . '/config/overlay.config.php';
    $olist = openfile($file);
    $n = count($olist);
    $sync = -1;
    $syncn = $synck = $synce = $syncs = $syncsk = array();
    for ($i = 0; $i < $n; $i++) {
        $t = explode(',', $olist[$i]);
        if ($t[5] != $last_star || $t[6] != $num) {
            continue;
        }
        $sync++;
        $syncn[$sync] = $t[0];
        $synck[$sync] = $t[1];
        $synce[$sync] = $t[2];
        $syncs[$sync] = $t[3];
        $syncsk[$sync] = $t[4];
    }
    //无满足条件的超量结果,失败
    if ($sync == -1) {
        return $chprocess($mlist, $itemselect);
    }
    if ($itemselect == -1) {
        $mask = 0;
        foreach ($mlist as $k) {
            if (1 <= $k && $k <= 6) {
                $mask |= 1 << (int) $k - 1;
            }
        }
        $cmd .= '<input type="hidden" id="mode" name="mode" value="itemmain">';
        $cmd .= '<input type="hidden" id="command" name="command" value="itemmix">';
        $cmd .= '<input type="hidden" id="mixmask" name="mixmask" value="' . $mask . '">';
        $cmd .= '<input type="hidden" id="itemselect" name="itemselect" value="999">';
        $cmd .= "请选择超量结果<br><br>";
        for ($i = 0; $i <= $sync; $i++) {
            $tn = $syncn[$i];
            $cmd .= "<input type=\"button\" class=\"cmdbutton\"  style=\"width:200\" value=\"" . $tn . "\" onclick=\"\$('itemselect').value='" . $i . "';postCmd('gamecmd','command.php');this.disabled=true;\">";
        }
        $cmd .= "<input type=\"button\" class=\"cmdbutton\"  style=\"width:200\" value=\"返回\" onclick=\"postCmd('gamecmd','command.php');this.disabled=true;\">";
        return;
    } else {
        $i = (int) $itemselect;
        if ($i < 0 || $i > $sync) {
            $mode = 'command';
            return;
        }
        foreach ($mlist as $val) {
            \itemmix\itemreduce('itm' . $val);
        }
        $itm0 = $syncn[$i];
        $itmk0 = $synck[$i];
        $itme0 = $synce[$i];
        $itms0 = $syncs[$i];
        $itmsk0 = $syncsk[$i];
        addnews($now, 'overmix', $name, $itm0);
        \itemmain\itemget();
        $mode = 'command';
        return;
    }
    $chprocess($mlist, $itemselect);
}
Exemplo n.º 30
0
<?php

define('CURSCRIPT', 'help');
require './include/common.inc.php';
$mapitemfile = config('mapitem', $gamecfg);
$writefile = GAME_ROOT . TPLDIR . '/itemhelp.htm';
if (filemtime($mapitemfile) > filemtime($writefile)) {
    $mixhelpinfo = "<div align=\"middle\"><table>\n\t\t<tr>\n\t\t\t<td class=\"b1\" height=20px><span>所在地点</span></td>\n\t\t\t<td class=\"b1\"><span>物品名称</span></td>\n\t\t\t<td class=\"b1\"><span>物品类型</span></td>\n\t\t\t<td class=\"b1\"><span>效/耐</span></td>\n\t\t\t<td class=\"b1\"><span>物品属性</span></td>\n\t\t\t<td class=\"b1\"><span>刷新时间与数量</span></td>\n\t\t</tr>\n\t\t";
    $file = config('mapitem', $gamecfg);
    $itemlist = openfile($file);
    $in = sizeof($itemlist);
    for ($i = 1; $i < $in; $i++) {
        if (!empty($itemlist[$i]) && strpos($itemlist[$i], ',') !== false) {
            list($iarea, $imap, $inum, $iname, $ikind, $ieff, $ista, $iskind) = explode(',', $itemlist[$i]);
            if ($imap == 99) {
                $mixhelpinfo .= "<tr><td class=\"b3\" height=20px><span>全图随机</span></td>\n";
            } else {
                $mixhelpinfo .= "<tr><td class=\"b3\" height=20px><span>{$plsinfo[$imap]}</span></td>\n";
            }
            $mixhelpinfo .= "<td class=\"b3\"><span>{$iname}</span></td>\n";
            $mixhelpinfo .= "<td class=\"b3\"><span>";
            if (substr($ikind, 0, 2) == "GB") {
                if ($ikind == "GBr") {
                    $mixhelpinfo .= "机枪弹药";
                }
                if ($ikind == "GBi") {
                    $mixhelpinfo .= "气体弹药";
                }
                if ($ikind == "GBh") {
                    $mixhelpinfo .= "重型弹药";
                }