Commit 25584861 authored by hisuinohoshi's avatar hisuinohoshi

Merge branch 'waaagh' of https://github.com/hikawiier/phpdts into waaagh

parents 7aadb341 19c94629
...@@ -74,6 +74,7 @@ web.config ...@@ -74,6 +74,7 @@ web.config
*.psd *.psd
*.xlsx *.xlsx
*.bak
# composer # composer
vendor vendor
...@@ -81,5 +82,10 @@ vendor ...@@ -81,5 +82,10 @@ vendor
# env file # env file
.env .env
# daemon # daemon
daemon* daemon*
# 录像文件
records
...@@ -293,15 +293,12 @@ ...@@ -293,15 +293,12 @@
/** 获取敌方技能页面 */ /** 获取敌方技能页面 */
function getEnemySkillPage($tdata) { function getEnemySkillPage($tdata) {
global $cskills; global $cskills;
$uidata = $tdata;
$array = array(); $array = array();
foreach ($tdata['clbpara']['skill'] as $skid) { foreach ($tdata['clbpara']['skill'] as $skid) {
$cskill = $cskills[$skid]; $cskill = $cskills[$skid];
$name = $cskill['name']; $name = $cskill['name'];
$cdesc = parse_skilldesc($skid, $uidata); $cdesc = parse_skilldesc($skid, $uidata);
$num_input = $cskill['num_input'];
$input = $cskill['input'];
$unlock_flag = check_skill_unlock($skid, $uidata);
$unlock_desc = parse_skilllockdesc($skid, $unlock_flag);
$new_array = array( $new_array = array(
'id' => $skid, 'id' => $skid,
'name' => $name, 'name' => $name,
...@@ -394,6 +391,27 @@ ...@@ -394,6 +391,27 @@
"max" => emix_calc_maxenum(), "max" => emix_calc_maxenum(),
); );
} }
/** 检查获取的物品是否可进行合并 */
function checkMerge() {
global $wep, $wepk, $wepe, $weps, $wepsk;
global $itm0, $itmk0, $itme0, $itms0, $itmsk0, $nosta;
$check = false;
if (preg_match('/^(WC|WD|WF|Y|B|C|TN|GB|M|V)/', $itmk0) && $itms0 !== $nosta) {
if ($wep == $itm0 && $wepk == $itmk0 && $wepe == $itme0 && $wepsk == $itmsk0) {
$check = true;
} else {
for ($i = 1; $i <= 6; $i++) {
global ${'itm'.$i}, ${'itmk'.$i}, ${'itme'.$i}, ${'itms'.$i}, ${'itmsk'.$i};
if ((${'itms'.$i}) && ($itm0 == ${'itm'.$i}) && ($itmk0 == ${'itmk'.$i}) && ($itme0 == ${'itme'.$i}) && ($itmsk0 == ${'itmsk'.$i})) {
$check = true;
}
}
}
} else if (preg_match('/^H|^P/',$itmk0) && $itms0 !== $nosta) {
$check = true;
}
return $check;
}
echo (json_encode(array( echo (json_encode(array(
"page" => "game", "page" => "game",
/** 玩家状态 */ /** 玩家状态 */
...@@ -637,6 +655,8 @@ ...@@ -637,6 +655,8 @@
"areaNum" => $areanum, "areaNum" => $areanum,
/** 每次禁区增加数 */ /** 每次禁区增加数 */
"areaAdd" => $areaadd, "areaAdd" => $areaadd,
/** 是否解除禁区 */
"isHack" => $hack,
), ),
/** 攻击方式 */ /** 攻击方式 */
"attackType" => array( "attackType" => array(
...@@ -687,6 +707,8 @@ ...@@ -687,6 +707,8 @@
"crafting" => $club != 20, "crafting" => $club != 20,
/** 元素口袋 */ /** 元素口袋 */
"element" => $club == 20, "element" => $club == 20,
/** 控制面板 */
"control" => isset($clbpara['console']),
), ),
/** 安全箱物品 */ /** 安全箱物品 */
"depotItems" => depot_getlist($name,$type), "depotItems" => depot_getlist($name,$type),
...@@ -705,6 +727,21 @@ ...@@ -705,6 +727,21 @@
"time" => $dtime, "time" => $dtime,
"name" => (!empty($kname) && (in_array($state, Array(20, 21, 22, 23, 24, 28, 29)))) ? $kname : null, "name" => (!empty($kname) && (in_array($state, Array(20, 21, 22, 23, 24, 28, 29)))) ? $kname : null,
) : null, ) : null,
/** 弹框 */
"dialog" => $clbpara['dialogue'],
/** 不可跳过弹框 */
"noSkipDialog" => $clbpara['noskip_dialogue'],
/** 游戏状态 */
"isGameOver" => $gamestate == 0,
/** 控制面板 */
"controlPanel" => array(
/** 可用信道 */
"channel" => $gamevars['api'],
/** 共计信道 */
"channelAll" => $gamevars['apis'],
/** 按钮 */
"noButton" => $clbpara['nobutton'],
)
), ),
/** 搜寻状态 */ /** 搜寻状态 */
"searchState" => array( "searchState" => array(
...@@ -715,7 +752,7 @@ ...@@ -715,7 +752,7 @@
"props" => $itmsk0_words != '--' ? $itmsk0_words : '', "props" => $itmsk0_words != '--' ? $itmsk0_words : '',
"quality" => $itme0, "quality" => $itme0,
"durability" => $itms0, "durability" => $itms0,
"canMerge" => preg_match('/^H|^P/',$itmk0) && $itms0 !== $nosta, "canMerge" => checkMerge(),
) : null, ) : null,
/** 发现敌人 */ /** 发现敌人 */
"findEnemy" => $tdata['nameinfo'] ? array( "findEnemy" => $tdata['nameinfo'] ? array(
......
...@@ -788,9 +788,9 @@ $jgamedata = compatible_json_encode($gamedata); ...@@ -788,9 +788,9 @@ $jgamedata = compatible_json_encode($gamedata);
//$json = new Services_JSON(); //$json = new Services_JSON();
//$jgamedata = $json->encode($gamedata); //$jgamedata = $json->encode($gamedata);
//if(!strstr($_SERVER['HTTP_REFERER'], 'php')) { //if(!strstr($_SERVER['HTTP_REFERER'], 'php')) {
if($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != ''){ if ($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') {
include './api.php'; include './api.php';
} else { } else {
echo $jgamedata; echo $jgamedata;
} }
......
...@@ -64,13 +64,13 @@ ...@@ -64,13 +64,13 @@
// [EN] !ATTENTION! Preservation or debugging for developing // [EN] !ATTENTION! Preservation or debugging for developing
// [CH] 切勿修改以下变量,仅供程序开发调试用! // [CH] 切勿修改以下变量,仅供程序开发调试用!
$database = 'pdo'; // 'mysql' for MySQL version and 'pgsql' for PostgreSQL version $database = 'mysqli'; // 'mysql' for MySQL version and 'pgsql' for PostgreSQL version
// MySQL 版本请设?'mysql', PgSQL 版本请设?'pgsql' // MySQL 版本请设?'mysql', PgSQL 版本请设?'pgsql'
$charset = 'utf-8'; // default character set, 'gbk', 'big5', 'utf-8' are available $charset = 'utf-8'; // default character set, 'gbk', 'big5', 'utf-8' are available
// 游戏默认字符? 可?'gbk', 'big5', 'utf-8' // 游戏默认字符? 可?'gbk', 'big5', 'utf-8'
$dbcharset = 'utf8'; // default database character set, 'gbk', 'big5', 'utf8', 'latin1' and blank are available $dbcharset = 'utf8mb4'; // default database character set, 'gbk', 'big5', 'utf8', 'latin1' and blank are available
// MySQL 字符? 可?'gbk', 'big5', 'utf8', 'latin1', 留空为按照游戏字符集设定 // MySQL 字符? 可?'gbk', 'big5', 'utf8', 'latin1', 留空为按照游戏字符集设定
$attackevasive = 0; // protect against attacks via common request, 0=off, 1=cookie refresh limitation, 2=deny proxy request, 3=both $attackevasive = 0; // protect against attacks via common request, 0=off, 1=cookie refresh limitation, 2=deny proxy request, 3=both
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
$errorinfo = 0; //是否开启错误信息提示,1为开启,0为关闭。开启会泄漏游戏安装路径 $errorinfo = 0; //是否开启错误信息提示,1为开启,0为关闭。开启会泄漏游戏安装路径
// 以下为salt,请勿修改。 // 以下为salt,请勿修改。
$salt = '3012becebcc626720409336f6375bcdd'; $salt = 'a29d8868b409591398e6ccca95f968ef';
// ============================================================================ // ============================================================================
......
...@@ -36,7 +36,20 @@ if($hp<=0 || $state>=10) { ...@@ -36,7 +36,20 @@ if($hp<=0 || $state>=10) {
if ($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') { if ($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') {
echo json_encode(array( echo json_encode(array(
"page" => "end", "page" => "end",
"title" => $stateinfo[$state], "title" => $hp <= 0 ? $stateinfo[$state] : $gwin[$winmode],
"deadInfo" => $hp <= 0 ? array(
"avatar" => $iconImg,
"motto" => $motto,
"info" => $dinfo[$state],
"time" => $dtime,
"killer" => !empty($kname) && $state >= 10 ? $kname : null,
) : null,
"flag" => array(
"number" => $sNo,
"killNum" => $killnum,
"winner" => $winner,
"state" => $state,
)
)); ));
} else { } else {
include template('ending'); include template('ending');
......
...@@ -170,9 +170,9 @@ if(isset($opendialog)) ...@@ -170,9 +170,9 @@ if(isset($opendialog))
} }
//if (!strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') { //if (!strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') {
if($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != ''){ if ($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') {
include './api.php'; include './api.php';
} else { } else {
include template('game'); include template('game');
} }
......
...@@ -372,9 +372,10 @@ text-align: center; ...@@ -372,9 +372,10 @@ text-align: center;
#chatlist{ #chatlist{
MARGIN: 0px; MARGIN: 0px;
height:120px; height:120px;
width:100%; width:720px;
word-break:break-all; word-break:break-all;
overflow:auto; overflow-x:hidden;
overflow-y:auto;
position:relative; position:relative;
} }
#newslist{ #newslist{
...@@ -414,7 +415,7 @@ background-image: url("../../img/footer_line.gif"); ...@@ -414,7 +415,7 @@ background-image: url("../../img/footer_line.gif");
.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.clearfix {display: inline-table;} /* Hides from IE-mac \*/ * html .clearfix {height: 1%;} .clearfix {display: block;} /* End hide from IE-mac */ .clearfix {display: inline-table;} /* Hides from IE-mac \*/ * html .clearfix {height: 1%;} .clearfix {display: block;} /* End hide from IE-mac */
#gamecmd input.cmdbutton{ input.cmdbutton{
width:80px;height:25px;margin:2; width:80px;height:25px;margin:2;
} }
...@@ -591,7 +592,22 @@ input.range{ ...@@ -591,7 +592,22 @@ input.range{
border-radius: 50px; border-radius: 50px;
box-shadow:0 0 5px 1px rgba(0, 0, 0, 0.5); box-shadow:0 0 5px 1px rgba(0, 0, 0, 0.5);
} }
/* 商店道具 */
.shoprow{
width:100%;display:flex;height:40px;
}
.shoprow .leftbox{
width:50px;float:left;margin-right:5px;
}
.shoprow .leftbox input{width:50px;}
.shoprow .rightbox{
width:60px;float:right;
}
.shoprow .rightbox input{width:60px;}
.shoprow .rightbox .inputunit{
position:absolute;top:5%;right:25%;color:#aaaaaa;
}
/* EmojiIcon */ /* EmojiIcon */
.eicon{ .eicon{
filter: grayscale(100%) brightness(133%) blur(0px); filter: grayscale(100%) brightness(133%) blur(0px);
......
...@@ -1496,7 +1496,8 @@ function change_subwep($s=2,&$data=NULL) ...@@ -1496,7 +1496,8 @@ function change_subwep($s=2,&$data=NULL)
$sweplog .="拿出了<span class='yellow'>{$wep}</span>"; $sweplog .="拿出了<span class='yellow'>{$wep}</span>";
} }
$log .= $sweplog."。<br>"; if(!$sweplog) $log .= '你左手交叠右手,大喝一声:“我特殊召唤两个拳头!”<br>';
else $log .= $sweplog."。<br>";
return; return;
} }
......
...@@ -20,6 +20,8 @@ namespace revcombat ...@@ -20,6 +20,8 @@ namespace revcombat
function rev_combat_prepare(&$pa,&$pd,$active,$wep_kind='',$log_print=1) function rev_combat_prepare(&$pa,&$pd,$active,$wep_kind='',$log_print=1)
{ {
global $db,$tablepre,$log,$mode,$main,$cmd,$battle_title; global $db,$tablepre,$log,$mode,$main,$cmd,$battle_title;
# Temp - Fix Replay XHR Exploit
$pa['action'] = $pd['action'] = '';
# 格式化双方clbpara:最后保存角色数据的时候会自动转写clbpara,所以想改什么直接改就行了 # 格式化双方clbpara:最后保存角色数据的时候会自动转写clbpara,所以想改什么直接改就行了
$pa['clbpara'] = get_clbpara($pa['clbpara']); $pd['clbpara'] = get_clbpara($pd['clbpara']); $pa['clbpara'] = get_clbpara($pa['clbpara']); $pd['clbpara'] = get_clbpara($pd['clbpara']);
......
...@@ -536,7 +536,7 @@ function item_extract_trait($which, $item_position) ...@@ -536,7 +536,7 @@ function item_extract_trait($which, $item_position)
$itm = implode('', $matches[0]); $itm = implode('', $matches[0]);
$itm = (string)$itm; $itm = (string)$itm;
$itm = "名称" . $itm . '代码片段'; $itm = "🥚" . $itm . '🥚的代码片段';
$itmk = '🥚'; $itmk = '🥚';
$itme = '0'; $itme = '0';
$itms = '1'; $itms = '1';
...@@ -608,7 +608,7 @@ function item_extract_trait($which, $item_position) ...@@ -608,7 +608,7 @@ function item_extract_trait($which, $item_position)
} }
$itmk = ''; $itmk = '';
$itme = '0'; $itme = '0';
$itms = '1'; $itms = '0';
$itmsk = ''; $itmsk = '';
${$which . $item_position} = $tmp_trait; ${$which . $item_position} = $tmp_trait;
$itms += 1; $itms += 1;
...@@ -624,7 +624,8 @@ function item_extract_trait($which, $item_position) ...@@ -624,7 +624,8 @@ function item_extract_trait($which, $item_position)
//合并代码片段逻辑 //合并代码片段逻辑
function item_add_trait($choice1, $choice2) function item_add_trait($choice1, $choice2)
{ {
global $log, $mode, $club, $sp, $rage; var_dump($choice1, $choice2);
global $log, $mode, $club, $sp, $rage, $pdata;
if ($club != 21) { if ($club != 21) {
$log .= '你的称号不能使用该技能。'; $log .= '你的称号不能使用该技能。';
$mode = 'command'; $mode = 'command';
...@@ -633,96 +634,103 @@ function item_add_trait($choice1, $choice2) ...@@ -633,96 +634,103 @@ function item_add_trait($choice1, $choice2)
//获取choice1和choice2的itm itmk itme itms itmsk //获取choice1和choice2的itm itmk itme itms itmsk
global ${'itm' . $choice1}, ${'itmk' . $choice1}, ${'itme' . $choice1}, ${'itms' . $choice1}, ${'itmsk' . $choice1}; global ${'itm' . $choice1}, ${'itmk' . $choice1}, ${'itme' . $choice1}, ${'itms' . $choice1}, ${'itmsk' . $choice1};
global ${'itm' . $choice2}, ${'itmk' . $choice2}, ${'itme' . $choice2}, ${'itms' . $choice2}, ${'itmsk' . $choice2}; global ${'itm' . $choice2}, ${'itmk' . $choice2}, ${'itme' . $choice2}, ${'itms' . $choice2}, ${'itmsk' . $choice2};
$itm1 = &${'itm' . $choice1}; $itmc1 = &${'itm' . $choice1};
$itmk1 = &${'itmk' . $choice1}; $itmkc1 = &${'itmk' . $choice1};
$itme1 = &${'itme' . $choice1}; $itmec1 = &${'itme' . $choice1};
$itms1 = &${'itms' . $choice1}; $itmsc1 = &${'itms' . $choice1};
$itmsk1 = &${'itmsk' . $choice1}; $itmskc1 = &${'itmsk' . $choice1};
$itm2 = &${'itm' . $choice2}; $itmc2 = &${'itm' . $choice2};
$itmk2 = &${'itmk' . $choice2}; $itmkc2 = &${'itmk' . $choice2};
$itme2 = &${'itme' . $choice2}; $itmec2 = &${'itme' . $choice2};
$itms2 = &${'itms' . $choice2}; $itmsc2 = &${'itms' . $choice2};
$itmsk2 = &${'itmsk' . $choice2}; $itmskc2 = &${'itmsk' . $choice2};
//检查itmk1是否为🥚,itmk2是否为D或W开头或者是否为🥚 //检查itmk1是否为🥚,itmk2是否为D或W开头或者是否为🥚
if ($itmk1 != '🥚' || (strpos($itmk2, 'D') !== 0 && strpos($itmk2, 'W') !== 0 && ($itmk2 !== '🥚'))) { if ($itmkc1 != '🥚' || (strpos($itmkc2, 'D') !== 0 && strpos($itmkc2, 'W') !== 0 && ($itmkc2 !== '🥚'))) {
$log .= '该物品无法合并。<br>'; $log .= '该物品无法合并。<br>';
return; return;
} }
//让itm2属性合并itm1 //让itm2属性合并itm1
//如果都是🥚,则去掉$itm的所有“代码片段”四个字,然后itm相加 //如果都是🥚,则去掉$itm的所有“代码片段”四个字,然后itm相加
if ($itmk1 == '🥚' && $itmk2 == '🥚') { if ($itmkc1 == '🥚' && $itmkc2 == '🥚') {
$itm1 = str_replace('代码片段', '', $itm1); var_dump($itmkc1, $itmkc2);
//$itm2 = $itm1 . $itm2; var_dump($itmc1, $itmc2);
$itm2 = '🥚复合代码片段🥚'; preg_match_all('/(改|棍棒|\+(\\d+))/u', $itmc1, $matches1);
$itmk2 = $itmk1 . $itmk2; preg_match_all('/(改|棍棒|\+(\\d+))/u', $itmc2, $matches2);
$itme2 = (int)$itme1 + (int)$itme2; if (!empty($matches1[0]) || !empty($matches2[0])) {
$itmn_result = '';
foreach ($matches1[0] as $match) {
$itmn_result .= $match;
}
foreach ($matches2[0] as $match) {
$itmn_result .= $match;
}
$itmc2 = '🥚' . $itmn_result . '🥚复合代码片段';
}
else {
$itmc2 = '🥚复合代码片段🥚';
}
$itmkc2 = $itmkc1 . $itmkc2;
$itmec2 = (int)$itmec1 + (int)$itmec2;
//当任意一个itms为∞ //当任意一个itms为∞
if ($itms1 == '∞' || $itms2 == '∞') { if ($itmsc1 == '∞' || $itmsc2 == '∞') {
$itms2 = '∞'; $itmsc2 = '∞';
} }
else { else {
$itms2 = (int)$itms1 + (int)$itms2 - 1; $itmsc2 = (int)$itmsc1 + (int)$itmsc2 - 1;
} }
$itmsk2 = $itmsk1 . $itmsk2; $itmskc2 = $itmskc1 . $itmskc2;
$itmkc2 = '🥚';
//清空itm1 //清空itm1
$itm1 = ''; destory_single_item($pdata, $choice1);
$itmk1 = '';
$itme1 = '0';
$itms1 = '0';
$itmk2 = '🥚';
$itms2 -= 1;
return; return;
} }
if ($rage < 50 ) { elseif ($rage < 50 ) {
$log .= '怒气不足,无法合并代码片段。<br>'; $log .= '怒气不足,无法合并代码片段。<br>';
return; return;
} }
$rage -= 50; $rage -= 50;
//如果itm1是名称开头的 //如果itm1含有棍棒或者改或者n
if (strpos($itm1, '名称') === 0){ preg_match_all('/(改|棍棒|\+(\\d+))/u', $itmc1, $matches);
//去掉名称和代码片段后合并 if (!empty($matches[0]))
$itm1 = str_replace('名称', '', $itm1); {
$itm1 = str_replace('代码片段', '', $itm1); $itmn_result = '';
//var_dump($itm1); //合并match
//$itm2 = $itm1 . $itm2; foreach ($matches[0] as $match) {
$itm2 = '🥚' . $itm1 . '🥚的复合代码片段'; $itmn_result .= $match;
$itmk2 = $itmk1 . $itmk2; }
$itme2 = (int)$itme1 + (int)$itme2; $itmc2 = $itmc2 . $itmn_result;
$itmkc2 = $itmkc1 . $itmkc2;
$itmec2 = (int)$itmec1 + (int)$itmec2;
//当任意一个itms为∞ //当任意一个itms为∞
if ($itms1 == '∞' || $itms2 == '∞') { if ($itmsc1 == '∞' || $itmsc2 == '∞') {
$itms2 = '∞'; $itmsc2 = '∞';
} }
else { else {
$itms2 = (int)$itms1 + (int)$itms2 - 1; $itmsc2 = (int)$itmsc1 + (int)$itmsc2 - 1;
} }
$itmsk2 = $itmsk1 . $itmsk2; $itmskc2 = $itmskc1 . $itmskc2;
//清空itm1 //清空itm1
$itm1 = ''; destory_single_item($pdata, $choice1);
$itmk1 = '';
$itme1 = '0'; $itmkc2 = str_replace('🥚', '', $itmkc2);
$itms1 = '0';
$itmk2 = str_replace('🥚', '', $itmk2);
return; return;
} }
$itmk2 = $itmk1 . $itmk2; $itmkc2 = $itmkc1 . $itmkc2;
$itme2 = (int)$itme1 + (int)$itme2; $itmec2 = (int)$itmec1 + (int)$itmec2;
//当任意一个itms为∞ //当任意一个itms为∞
if ($itms1 == '∞' || $itms2 == '∞') { if ($itmsc1 == '∞' || $itmsc2 == '∞') {
$itms2 = '∞'; $itmsc2 = '∞';
} }
else { else {
$itms2 = (int)$itms1 + (int)$itms2 - 1; $itmsc2 = (int)$itmsc1 + (int)$itmsc2 - 1;
} }
$itmsk2 = $itmsk1 . $itmsk2; $itmskc2 = $itmskc1 . $itmskc2;
//清空itm1 //清空itm1
$itm1 = ''; destory_single_item($pdata, $choice1);
$itmk1 = '';
$itme1 = '0';
$itms1 = '0';
//去除itm2重复的属性 //去除itm2重复的属性
$itmsk2 = implode(array_unique(str_split($itmsk2))); $itmskc2 = implode(array_unique(str_split($itmskc2)));
//去除itm2属性里的🥚 //去除itm2属性里的🥚
$itmk2 = str_replace('🥚', '', $itmk2); $itmkc2 = str_replace('🥚', '', $itmkc2);
} }
function shoplist($sn,$getlist=NULL) { function shoplist($sn,$getlist=NULL) {
......
...@@ -567,6 +567,124 @@ function skill_unacquired_mouseout(e) ...@@ -567,6 +567,124 @@ function skill_unacquired_mouseout(e)
if (child.className == 'skill_unacquired_hint_transparent') if (child.className == 'skill_unacquired_hint_transparent')
{ {
child.className = 'skill_unacquired_hint'; child.className = 'skill_unacquired_hint';
} }
} }
} }
function selectRecordedFile() {
var input = document.createElement("input");
input.type = "file";
input.accept = ".gz";
input.click();
// 处理选择的文件
input.onchange = function (event) {
var file = event.target.files[0];
console.log("选择的文件:", file);
displayRecordedData(file);
};
}
// 显示单个页面的内容
function showPage(pageContent, currentPageIndex) {
var recordedDataDiv = document.getElementById('recordedData');
recordedDataDiv.innerHTML = pageContent[currentPageIndex];
var previousPageButton = document.createElement('button');
previousPageButton.textContent = '上一页';
previousPageButton.onclick = function () {
if (currentPageIndex > 0) {
currentPageIndex--;
showPage(pageContent, currentPageIndex);
} else {
recordedDataDiv.innerHTML = '已经到达第一页';
}
}
var nextPageButton = document.createElement('button');
nextPageButton.textContent = '下一页';
nextPageButton.onclick = function () {
if (currentPageIndex < pageContent.length - 1) {
currentPageIndex++;
showPage(pageContent, currentPageIndex);
} else {
recordedDataDiv.innerHTML = '已经到达最后一页';
}
};
// 阻止链接跳转
var links = recordedDataDiv.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
links[i].addEventListener('click', function (event) {
event.preventDefault();
});
}
// 删除具有 id="hidden-model" 的元素
var hiddenModelElement = document.getElementById('hidden-model');
if (hiddenModelElement) {
hiddenModelElement.remove();
}
var progressBar = document.createElement('div');
progressBar.className = 'progress-bar';
progressBar.style.width = ((currentPageIndex + 1) / pageContent.length) * 100 + '%';
var progressBar = document.createElement('input');
progressBar.type = 'range';
progressBar.min = 0;
progressBar.max = pageContent.length - 1;
progressBar.value = currentPageIndex;
progressBar.oninput = function () {
currentPageIndex = parseInt(progressBar.value);
showPage(pageContent, currentPageIndex);
};
recordedDataDiv.insertBefore(progressBar, recordedDataDiv.firstChild);
recordedDataDiv.insertBefore(nextPageButton, recordedDataDiv.firstChild);
recordedDataDiv.insertBefore(previousPageButton, recordedDataDiv.firstChild);
}
function displayRecordedData(file) {
// 检查是否选择了文件
if (file) {
// 创建一个FileReader对象来读取文件内容
var reader = new FileReader();
reader.onload = function () {
// 将文件内容转换为ArrayBuffer
var arrayBuffer = reader.result;
// 创建一个Uint8Array来存储ArrayBuffer的数据
var uint8Array = new Uint8Array(arrayBuffer);
// 解压缩文件数据
var inflatedData = pako.inflate(uint8Array, { to: 'string' });
// 将解压缩后的数据按页进行切分
var pages = inflatedData.split('\n<html>');
// 逐页展示记录的内容
var recordedDataDiv = document.getElementById('recordedData');
recordedDataDiv.innerHTML = ''; // 清空之前的内容
// 创建一个包含每页内容的数组
var pageContent = [];
for (var i = 0; i < pages.length; i++) {
pageContent.push(pages[i]);
}
// 显示第一页的内容
showPage(pageContent, 0);
};
reader.readAsArrayBuffer(file);
} else { // 如果没有选择文件,则显示选择文件的提示消息
var noticeDiv = document.getElementById('notice'); noticeDiv.textContent = '请先选择一个录像文件';
}
}
/*window.onbeforeunload = function () {
if (isRecording) {
window.alert('你正在录制游戏,之后将会自动下载录制数据。');
downloadRecordedData();
}
};*/
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
//录制处理
var recordedData = [];
var isRecording = true;
function startRecording() {
isRecording = true;
console.log('startRecording');
window.alert('开始录像,录制中的游戏数据会保留在浏览器内,请不要刷新或关闭该页面。');
// 监听所有按钮的点击事件
document.addEventListener('click', recordButtonClick);
var linkElement = document.querySelector('a[onclick="startRecording()"]');
if (linkElement) {
linkElement.textContent = ">>停止录像";
linkElement.setAttribute('onclick', 'stopRecording()');
}
}
document.addEventListener('click', recordButtonClick);
function stopRecording() {
isRecording = false;
var linkElement = document.querySelector('a[onclick="stopRecording()"]');
if (linkElement) {
linkElement.textContent = ">>开始录像";
linkElement.setAttribute('onclick', 'startRecording()');
}
// 停止监听
document.removeEventListener('click', recordButtonClick);
//downloadRecordedData();
}
function downloadRecordedData() {
var reader = new FileReader();
reader.onload = function () {
var arrayBuffer = reader.result;
var uint8Array = new Uint8Array(arrayBuffer);
var gzippedData = pako.gzip(uint8Array);
var downloadLink = document.createElement("a");
downloadLink.href = URL.createObjectURL(new Blob([gzippedData]));
downloadLink.download = "recorded_data.html.gz";
downloadLink.click();
};
reader.readAsArrayBuffer(new Blob(recordedData, { type: "text/html" }));
}
function recordButtonClick(event) {
// 如果录制状态为 true,则将当前前端的全部静态网页数据保存到数组中
if (isRecording) {
recordedData.push(document.documentElement.outerHTML.concat("\n"));
sendLastRecordedData(recordedData);
}
}
function sendLastRecordedData(recordedData) {
const nickinfoElement = document.getElementById('nickinfo');
if (!nickinfoElement) {
return;
}
const nickinfo = nickinfoElement.innerText;
const lastRecord = recordedData[recordedData.length - 1];
fetch('record_backend.php', {
method: 'POST',
body: JSON.stringify({ lastRecord, nickinfo }),
headers: {
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => {
// 处理从后端返回的响应
//console.log(data);
})
.catch(error => {
// 处理错误
console.error(error);
});
}
...@@ -447,6 +447,19 @@ function duel($time = 0,$keyitm = ''){ ...@@ -447,6 +447,19 @@ function duel($time = 0,$keyitm = ''){
function gameover($time = 0, $mode = '', $winname = '') { function gameover($time = 0, $mode = '', $winname = '') {
global $gamestate,$winmode,$alivenum,$winner,$now,$gamenum,$db,$gtablepre,$tablepre,$gamenum,$starttime,$validnum,$hdamage,$hplayer; global $gamestate,$winmode,$alivenum,$winner,$now,$gamenum,$db,$gtablepre,$tablepre,$gamenum,$starttime,$validnum,$hdamage,$hplayer;
global $groomid; global $groomid;
//遍历./records/$gamenum/下的所有txt文件
$filelist = glob("./records/$gamenum/**/*.txt");
//然后gzip压缩
foreach($filelist as $file){
$input = fopen($file, 'rb');
$output = gzopen($file . '.gz', 'wb');
while (!feof($input)) {
gzwrite($output, fread($input, 1024));
}
fclose($input);
//删除原文件
unlink($file);
}
if($gamestate < 10){return;} if($gamestate < 10){return;}
if((!$mode)||(($mode==2)&&(!$winname))) {//在没提供游戏结束模式的情况下,自行判断模式 if((!$mode)||(($mode==2)&&(!$winname))) {//在没提供游戏结束模式的情况下,自行判断模式
if($validnum <= 0) {//无激活者情况下,全部死亡 if($validnum <= 0) {//无激活者情况下,全部死亡
......
...@@ -58,6 +58,34 @@ if(!empty($roomact)) ...@@ -58,6 +58,34 @@ if(!empty($roomact))
else else
{ {
if (isset($_GET['is_new'])) { if (isset($_GET['is_new'])) {
$now_rooms = !empty($roomlist) ? count($roomlist) : 0;
$rooms = array();
foreach ($roomlist as $rkey => $rinfo) {
$room = array();
$room['id'] = $rkey;
$room['status'] = $gstate[$rinfo['gamestate']];
$room['owner'] = $rinfo['groomownid'];
$room['nums'] = $rinfo['groomnums'];
$action = array();
if (!empty($cuser) && !empty($cpass)) {
if (!empty($groomid)) {
if ($groomid == $rkey) {
$action[] = '退出';
if (!empty($rinfo['groomownid']) && $rinfo['groomownid'] == $cuser) {
$action[] = '解散';
}
} else {
$action[] = '-';
}
} else {
$action[] = '加入';
}
} else {
$action[] = '-';
}
$room['action'] = $action;
$rooms[] = $room;
}
echo json_encode(array( echo json_encode(array(
// 当前回合数 // 当前回合数
"num" => $gamenum, "num" => $gamenum,
...@@ -90,6 +118,14 @@ else ...@@ -90,6 +118,14 @@ else
"deathNum" => $deathnum, "deathNum" => $deathnum,
// 当前房间号: // 当前房间号:
"roomID" => $groomid, "roomID" => $groomid,
// 最大房间数
"maxRooms" => $max_rooms,
// 是否可创建房间
"canCreateRoom" => $now_rooms < $max_rooms && !$groomid && (!empty($cuser) && !empty($cpass)),
// 房间
"rooms" => $rooms,
// 站长留言
"news" => $adminmsg,
// 用户名 // 用户名
"username" => $cuser, "username" => $cuser,
)); ));
......
...@@ -5,34 +5,30 @@ ...@@ -5,34 +5,30 @@
DROP TABLE IF EXISTS bra_game; DROP TABLE IF EXISTS bra_game;
CREATE TABLE bra_game ( CREATE TABLE bra_game (
`gamenum` mediumint(8) unsigned NOT NULL DEFAULT '0', `gamenum` mediumint(8) UNSIGNED NOT NULL DEFAULT '0',
`gamestate` tinyint(3) unsigned NOT NULL DEFAULT '0', `gamestate` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
`groomid` tinyint(3) unsigned NOT NULL DEFAULT '0', `groomid` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
`groomnums` tinyint(3) unsigned NOT NULL DEFAULT '0', `groomnums` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
`groomownid` char(15) NOT NULL default '', `groomownid` char(15) NOT NULL DEFAULT '',
`starttime` int(10) unsigned NOT NULL DEFAULT '0', `starttime` int(10) UNSIGNED NOT NULL DEFAULT '0',
`winmode` tinyint(3) unsigned NOT NULL DEFAULT '0', `winmode` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
`winner` char(15) NOT NULL DEFAULT '', `winner` char(15) NOT NULL DEFAULT '',
`arealist` varchar(255) NOT NULL DEFAULT '', `arealist` varchar(255) NOT NULL DEFAULT '',
`areanum` tinyint(3) unsigned NOT NULL DEFAULT '0', `areanum` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
`areatime` int(10) unsigned NOT NULL DEFAULT '0', `areatime` int(10) UNSIGNED NOT NULL DEFAULT '0',
`areawarn` tinyint(3) unsigned NOT NULL DEFAULT '0', `areawarn` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
`validnum` smallint(5) unsigned NOT NULL DEFAULT '0', `validnum` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`alivenum` smallint(5) unsigned NOT NULL DEFAULT '0', `alivenum` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`deathnum` smallint(5) unsigned NOT NULL DEFAULT '0', `deathnum` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`afktime` int(10) unsigned NOT NULL DEFAULT '0', `afktime` int(10) UNSIGNED NOT NULL DEFAULT '0',
`optime` int(10) unsigned NOT NULL DEFAULT '0', `optime` int(10) UNSIGNED NOT NULL DEFAULT '0',
`weather` tinyint(3) unsigned NOT NULL DEFAULT '0', `weather` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
`hack` tinyint(1) unsigned NOT NULL DEFAULT '0', `hack` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`hdamage` int(10) unsigned NOT NULL DEFAULT '0', `hdamage` int(10) UNSIGNED NOT NULL DEFAULT '0',
`hplayer` char(15) NOT NULL DEFAULT '', `hplayer` char(15) NOT NULL DEFAULT '',
`combonum` smallint(5) unsigned NOT NULL DEFAULT '0', `combonum` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`gamevars` text NOT NULL, `gamevars` text NOT NULL,
`noisevars` varchar(1000) NOT NULL DEFAULT '', `noisevars` varchar(1000) NOT NULL DEFAULT '',
`rdown` tinyint(1) unsigned NOT NULL DEFAULT '0',
`bdown` tinyint(1) unsigned NOT NULL DEFAULT '0',
`ldown` tinyint(1) unsigned NOT NULL DEFAULT '0',
`kdown` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`groomid`) PRIMARY KEY (`groomid`)
...@@ -60,11 +56,11 @@ CREATE TABLE bra_users ( ...@@ -60,11 +56,11 @@ CREATE TABLE bra_users (
`ip` char(15) NOT NULL DEFAULT '', `ip` char(15) NOT NULL DEFAULT '',
`credits` int(10) NOT NULL DEFAULT '0', `credits` int(10) NOT NULL DEFAULT '0',
`credits2` mediumint(9) NOT NULL DEFAULT '0', `credits2` mediumint(9) NOT NULL DEFAULT '0',
`achievement` text NOT NULL, `achievement` text NOT NULL default '',
`achrev` text NOT NULL, `achrev` text NOT NULL default '',
`daily` varchar(255) NOT NULL DEFAULT '', `daily` varchar(255) NOT NULL DEFAULT '',
`nick` text NOT NULL, `nick` text NOT NULL default '',
`nicks` text NOT NULL, `nicks` text NOT NULL default '',
`nicksrev` text NOT NULL default '', `nicksrev` text NOT NULL default '',
`validgames` smallint(5) unsigned NOT NULL DEFAULT '0', `validgames` smallint(5) unsigned NOT NULL DEFAULT '0',
`wingames` smallint(5) unsigned NOT NULL DEFAULT '0', `wingames` smallint(5) unsigned NOT NULL DEFAULT '0',
...@@ -93,9 +89,9 @@ CREATE TABLE bra_users ( ...@@ -93,9 +89,9 @@ CREATE TABLE bra_users (
DROP TABLE IF EXISTS bra_winners; DROP TABLE IF EXISTS bra_winners;
CREATE TABLE bra_winners ( CREATE TABLE bra_winners (
`gid` smallint(5) unsigned NOT NULL DEFAULT '0', `gid` smallint(5) unsigned NOT NULL DEFAULT '0',
`type` tinyint(3) unsigned NOT NULL DEFAULT '0', `type` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
`nick` text NOT NULL, `nick` text NOT NULL,
`skillpoint` smallint unsigned NOT NULL default '0', `skillpoint` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`name` char(15) NOT NULL DEFAULT '', `name` char(15) NOT NULL DEFAULT '',
`pass` char(32) NOT NULL DEFAULT '', `pass` char(32) NOT NULL DEFAULT '',
`gd` char(1) NOT NULL DEFAULT 'm', `gd` char(1) NOT NULL DEFAULT 'm',
...@@ -117,210 +113,118 @@ CREATE TABLE bra_winners ( ...@@ -117,210 +113,118 @@ CREATE TABLE bra_winners (
`money` smallint(5) unsigned NOT NULL DEFAULT '0', `money` smallint(5) unsigned NOT NULL DEFAULT '0',
`bid` smallint(5) unsigned NOT NULL DEFAULT '0', `bid` smallint(5) unsigned NOT NULL DEFAULT '0',
`inf` char(10) NOT NULL DEFAULT '', `inf` char(10) NOT NULL DEFAULT '',
`rage` tinyint(3) unsigned NOT NULL DEFAULT '0', `rage` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
`pose` tinyint(1) unsigned NOT NULL DEFAULT '0', `pose` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`tactic` tinyint(1) unsigned NOT NULL DEFAULT '0', `tactic` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`killnum` smallint(5) unsigned NOT NULL DEFAULT '0', `killnum` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`killnum2` smallint(5) unsigned NOT NULL DEFAULT '0', `killnum2` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`state` tinyint(3) unsigned NOT NULL DEFAULT '0', `state` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
`wp` smallint(5) unsigned NOT NULL DEFAULT '0', `wp` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`wk` smallint(5) unsigned NOT NULL DEFAULT '0', `wk` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`wg` smallint(5) unsigned NOT NULL DEFAULT '0', `wg` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`wc` smallint(5) unsigned NOT NULL DEFAULT '0', `wc` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`wd` smallint(5) unsigned NOT NULL DEFAULT '0', `wd` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`wf` smallint(5) unsigned NOT NULL DEFAULT '0', `wf` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`teamID` char(15) NOT NULL DEFAULT '', `teamID` char(15) NOT NULL DEFAULT '',
`teamPass` char(15) NOT NULL DEFAULT '', `teamPass` char(15) NOT NULL DEFAULT '',
`teamMate` text NOT NULL default '', `teamMate` text NOT NULL,
`teamIcon` smallint unsigned NOT NULL default '0', `clbpara` text NOT NULL,
wep char(30) NOT NULL default '', `teamIcon` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
wepk char(40) not null default '', `wep` char(30) NOT NULL DEFAULT '',
wepe int(10) unsigned NOT NULL DEFAULT '0', `wepk` char(40) NOT NULL DEFAULT '',
weps char(10) not null default '0', `wepe` int(10) UNSIGNED NOT NULL DEFAULT '0',
wepsk char(40) not null default '', `weps` char(10) NOT NULL DEFAULT '0',
wep2 char(30) NOT NULL default '', `wepsk` char(40) NOT NULL DEFAULT '',
wep2k char(40) not null default '', `arb` char(30) NOT NULL DEFAULT '',
wep2e int(10) unsigned NOT NULL DEFAULT '0', `arbk` char(40) NOT NULL DEFAULT '',
wep2s char(10) not null default '0', `arbe` int(10) UNSIGNED NOT NULL DEFAULT '0',
wep2sk char(40) not null default '', `arbs` char(10) NOT NULL DEFAULT '0',
arb char(30) NOT NULL default '', `arbsk` char(40) NOT NULL DEFAULT '',
arbk char(40) not null default '', `arh` char(30) NOT NULL DEFAULT '',
arbe int(10) unsigned NOT NULL DEFAULT '0', `arhk` char(40) NOT NULL DEFAULT '',
arbs char(10) not null default '0', `arhe` int(10) UNSIGNED NOT NULL DEFAULT '0',
arbsk char(40) not null default '', `arhs` char(10) NOT NULL DEFAULT '0',
arh char(30) NOT NULL default '', `arhsk` char(40) NOT NULL DEFAULT '',
arhk char(40) not null default '', `ara` char(30) NOT NULL DEFAULT '',
arhe int(10) unsigned NOT NULL DEFAULT '0', `arak` char(40) NOT NULL DEFAULT '',
arhs char(10) not null default '0', `arae` int(10) UNSIGNED NOT NULL DEFAULT '0',
arhsk char(40) not null default '', `aras` char(10) NOT NULL DEFAULT '0',
ara char(30) NOT NULL default '', `arask` char(40) NOT NULL DEFAULT '',
arak char(40) not null default '', `arf` char(30) NOT NULL DEFAULT '',
arae int(10) unsigned NOT NULL DEFAULT '0', `arfk` char(40) NOT NULL DEFAULT '',
aras char(10) not null default '0', `arfe` int(10) UNSIGNED NOT NULL DEFAULT '0',
arask char(40) not null default '', `arfs` char(10) NOT NULL DEFAULT '0',
arf char(30) NOT NULL default '', `arfsk` char(40) NOT NULL DEFAULT '',
arfk char(40) not null default '', `art` char(30) NOT NULL DEFAULT '',
arfe int(10) unsigned NOT NULL DEFAULT '0', `artk` char(40) NOT NULL DEFAULT '',
arfs char(10) not null default '0', `arte` int(10) UNSIGNED NOT NULL DEFAULT '0',
arfsk char(40) not null default '', `arts` char(10) NOT NULL DEFAULT '0',
art char(30) NOT NULL default '', `artsk` char(40) NOT NULL DEFAULT '',
artk char(40) not null default '', `itm0` char(30) NOT NULL DEFAULT '',
arte int(10) unsigned NOT NULL DEFAULT '0', `itmk0` char(40) NOT NULL DEFAULT '',
arts char(10) not null default '0', `itme0` int(10) UNSIGNED NOT NULL DEFAULT '0',
artsk char(40) not null default '', `itms0` char(10) NOT NULL DEFAULT '0',
itm0 char(30) NOT NULL default '', `itmsk0` char(40) NOT NULL DEFAULT '',
itmk0 char(40) not null default '', `itm1` char(30) NOT NULL DEFAULT '',
itme0 int(10) unsigned NOT NULL DEFAULT '0', `itmk1` char(40) NOT NULL DEFAULT '',
itms0 char(10) not null default '0', `itme1` int(10) UNSIGNED NOT NULL DEFAULT '0',
itmsk0 char(40) not null default '', `itms1` char(10) NOT NULL DEFAULT '0',
itm1 char(30) NOT NULL default '', `itmsk1` char(40) NOT NULL DEFAULT '',
itmk1 char(40) not null default '', `itm2` char(30) NOT NULL DEFAULT '',
itme1 int(10) unsigned NOT NULL DEFAULT '0', `itmk2` char(40) NOT NULL DEFAULT '',
itms1 char(10) not null default '0', `itme2` int(10) UNSIGNED NOT NULL DEFAULT '0',
itmsk1 char(40) not null default '', `itms2` char(10) NOT NULL DEFAULT '0',
itm2 char(30) NOT NULL default '', `itmsk2` char(40) NOT NULL DEFAULT '',
itmk2 char(40) not null default '', `itm3` char(30) NOT NULL DEFAULT '',
itme2 int(10) unsigned NOT NULL DEFAULT '0', `itmk3` char(40) NOT NULL DEFAULT '',
itms2 char(10) not null default '0', `itme3` int(10) UNSIGNED NOT NULL DEFAULT '0',
itmsk2 char(40) not null default '', `itms3` char(10) NOT NULL DEFAULT '0',
itm3 char(30) NOT NULL default '', `itmsk3` char(40) NOT NULL DEFAULT '',
itmk3 char(40) not null default '', `itm4` char(30) NOT NULL DEFAULT '',
itme3 int(10) unsigned NOT NULL DEFAULT '0', `itmk4` char(40) NOT NULL DEFAULT '',
itms3 char(10) not null default '0', `itme4` int(10) UNSIGNED NOT NULL DEFAULT '0',
itmsk3 char(40) not null default '', `itms4` char(10) NOT NULL DEFAULT '0',
itm4 char(30) NOT NULL default '', `itmsk4` char(40) NOT NULL DEFAULT '',
itmk4 char(40) not null default '', `itm5` char(30) NOT NULL DEFAULT '',
itme4 int(10) unsigned NOT NULL DEFAULT '0', `itmk5` char(40) NOT NULL DEFAULT '',
itms4 char(10) not null default '0', `itme5` int(10) UNSIGNED NOT NULL DEFAULT '0',
itmsk4 char(40) not null default '', `itms5` char(10) NOT NULL DEFAULT '0',
itm5 char(30) NOT NULL default '', `itmsk5` char(40) NOT NULL DEFAULT '',
itmk5 char(40) not null default '', `itm6` char(30) NOT NULL DEFAULT '',
itme5 int(10) unsigned NOT NULL DEFAULT '0', `itmk6` char(40) NOT NULL DEFAULT '',
itms5 char(10) not null default '0', `itme6` int(10) UNSIGNED NOT NULL DEFAULT '0',
itmsk5 char(40) not null default '', `itms6` char(10) NOT NULL DEFAULT '0',
itm6 char(30) NOT NULL default '', `itmsk6` char(40) NOT NULL DEFAULT '',
itmk6 char(40) not null default '',
itme6 int(10) unsigned NOT NULL DEFAULT '0',
itms6 char(10) not null default '0',
itmsk6 char(40) not null default '',
`motto` char(30) NOT NULL DEFAULT '', `motto` char(30) NOT NULL DEFAULT '',
`wmode` tinyint(3) unsigned NOT NULL DEFAULT '0', `wmode` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
`vnum` smallint(5) unsigned NOT NULL DEFAULT '0', `vnum` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`gtime` int(10) unsigned NOT NULL DEFAULT '0', `gtime` int(10) UNSIGNED NOT NULL DEFAULT '0',
`gstime` int(10) unsigned NOT NULL DEFAULT '0', `gstime` int(10) UNSIGNED NOT NULL DEFAULT '0',
`getime` int(10) unsigned NOT NULL DEFAULT '0', `getime` int(10) UNSIGNED NOT NULL DEFAULT '0',
`hdmg` int(10) unsigned NOT NULL DEFAULT '0', `hdmg` int(10) UNSIGNED NOT NULL DEFAULT '0',
`hdp` char(15) NOT NULL DEFAULT '', `hdp` char(15) NOT NULL DEFAULT '',
`hkill` smallint(5) unsigned NOT NULL DEFAULT '0', `hkill` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`hkp` char(15) NOT NULL DEFAULT '', `hkp` char(15) NOT NULL DEFAULT '',
UNIQUE KEY (gid) UNIQUE KEY (gid)
) TYPE=MyISAM; ) TYPE=MyISAM;
DROP TABLE IF EXISTS bra_vnmixitem;
-- CREATE TABLE bra_vnmixitem (
-- 表的结构 `bra_players` `iid` mediumint(8) UNSIGNED NOT NULL,
-- 储存角色数据的激活信息,包括PC和NPC。 `creator` varchar(40) NOT NULL DEFAULT '',
-- `istatus` int(10) UNSIGNED NOT NULL DEFAULT '0',
`class` varchar(30) NOT NULL DEFAULT '',
DROP TABLE IF EXISTS bra_players; `stf0` varchar(30) NOT NULL DEFAULT '',
CREATE TABLE bra_players ( `stf1` varchar(30) NOT NULL DEFAULT '',
pid smallint unsigned NOT NULL auto_increment, `stf2` varchar(30) NOT NULL DEFAULT '',
type tinyint NOT NULL default 0, `stf3` varchar(30) NOT NULL DEFAULT '',
name char(15) NOT NULL default '', `stf4` varchar(30) NOT NULL DEFAULT '',
pass char(32) NOT NULL default '', `itm` varchar(30) NOT NULL DEFAULT '',
gd char(1) NOT NULL default 'm', `itmk` varchar(40) NOT NULL DEFAULT '',
sNo smallint unsigned NOT NULL default 0, `itme` int(10) UNSIGNED NOT NULL DEFAULT '0',
icon smallint unsigned NOT NULL default 0, `itms` char(10) NOT NULL DEFAULT '0',
club tinyint unsigned NOT NULL default 0, `itmsk` varchar(40) NOT NULL DEFAULT '',
endtime int(10) unsigned NOT NULL default 0,
hp smallint unsigned NOT NULL default 0, PRIMARY KEY (iid)
mhp smallint unsigned NOT NULL default 0, ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
sp smallint unsigned NOT NULL default 0, \ No newline at end of file
msp smallint unsigned NOT NULL default 0,
att smallint unsigned NOT NULL default 0,
def smallint unsigned NOT NULL default 0,
pls tinyint unsigned NOT NULL default 0,
lvl tinyint unsigned NOT NULL default 0,
`exp` smallint unsigned NOT NULL default 0,
money smallint unsigned NOT NULL default 0,
bid smallint unsigned NOT NULL default 0,
`inf` char(10) not null default '',
rage tinyint unsigned NOT NULL default 0,
pose tinyint(1) unsigned NOT NULL default 0,
tactic tinyint(1) unsigned NOT NULL default 0,
killnum smallint unsigned NOT NULL default 0,
state tinyint unsigned NOT NULL default 0,
`wp` smallint unsigned not null default 0,
`wk` smallint unsigned not null default 0,
`wg` smallint unsigned not null default 0,
`wc` smallint unsigned not null default 0,
`wd` smallint unsigned not null default 0,
`wf` smallint unsigned not null default 0,
`teamID` char(15) not null default '',
`teamPass` char(15) not null default '',
wep char(30) NOT NULL default '',
wepk char(5) not null default '',
wepe smallint unsigned NOT NULL default 0,
weps char(5) not null default 0,
wepsk char(5) not null default '',
arb char(30) NOT NULL default '',
arbk char(5) not null default '',
arbe smallint unsigned NOT NULL default 0,
arbs char(5) not null default 0,
arbsk char(5) not null default '',
arh char(30) NOT NULL default '',
arhk char(5) not null default '',
arhe smallint unsigned NOT NULL default 0,
arhs char(5) not null default 0,
arhsk char(5) not null default '',
ara char(30) NOT NULL default '',
arak char(5) not null default '',
arae smallint unsigned NOT NULL default 0,
aras char(5) not null default 0,
arask char(5) not null default '',
arf char(30) NOT NULL default '',
arfk char(5) not null default '',
arfe smallint unsigned NOT NULL default 0,
arfs char(5) not null default 0,
arfsk char(5) not null default '',
art char(30) NOT NULL default '',
artk char(5) not null default '',
arte smallint unsigned NOT NULL default 0,
arts char(5) not null default 0,
artsk char(5) not null default '',
itm0 char(30) NOT NULL default '',
itmk0 char(5) not null default '',
itme0 smallint unsigned NOT NULL default 0,
itms0 char(5) not null default 0,
itmsk0 char(5) not null default '',
itm1 char(30) NOT NULL default '',
itmk1 char(5) not null default '',
itme1 smallint unsigned NOT NULL default 0,
itms1 char(5) not null default 0,
itmsk1 char(5) not null default '',
itm2 char(30) NOT NULL default '',
itmk2 char(5) not null default '',
itme2 smallint unsigned NOT NULL default 0,
itms2 char(5) not null default 0,
itmsk2 char(5) not null default '',
itm3 char(30) NOT NULL default '',
itmk3 char(5) not null default '',
itme3 smallint unsigned NOT NULL default 0,
itms3 char(5) not null default 0,
itmsk3 char(5) not null default '',
itm4 char(30) NOT NULL default '',
itmk4 char(5) not null default '',
itme4 smallint unsigned NOT NULL default 0,
itms4 char(5) not null default 0,
itmsk4 char(5) not null default '',
itm5 char(30) NOT NULL default '',
itmk5 char(5) not null default '',
itme5 smallint unsigned NOT NULL default 0,
itms5 char(5) not null default 0,
itmsk5 char(5) not null default '',
PRIMARY KEY (pid),
INDEX TYPE (type, sNo),
INDEX NAME (name, type)
) TYPE=MyISAM;
<?php
define('CURSCRIPT', 'record');
require './include/common.inc.php';
include template('record');
?>
<?php
define('CURSCRIPT', 'record_backend');
require './include/common.inc.php';
try {
$jsonData = file_get_contents('php://input');
$requestData = json_decode($jsonData, true);
if ($requestData === null) {
http_response_code(400);
$response = ["message" => "Invalid JSON data"];
echo json_encode($response);
return;
}
global $gamenum;
$lastRecord = $requestData['lastRecord'];
$nickinfo = $requestData['nickinfo'];
$directoryPath = "./records/$gamenum/$nickinfo";
$filePath = "$directoryPath/record.txt";
// 创建目录
if (!is_dir($directoryPath) && !mkdir($directoryPath, 0777, true)) {
throw new Exception('Failed to create directory');
}
// 写入数据到文件
if (!file_put_contents($filePath, $lastRecord . "\n", FILE_APPEND)) {
throw new Exception('Failed to write data to file');
}
// 返回信息
echo json_encode([
"message" => "Success",
]);
} catch (Exception $e) {
http_response_code(500);
$response = ["message" => $e->getMessage()];
echo json_encode($response);
}
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
<script type="text/javascript" src="include/common.js"></script> <script type="text/javascript" src="include/common.js"></script>
<script type="text/javascript" src="include/game20130526.js"></script> <script type="text/javascript" src="include/game20130526.js"></script>
<script type="text/javascript" src="include/json.js"></script> <script type="text/javascript" src="include/json.js"></script>
<script type="text/javascript" src="include/pako.js"></script>
<!--{if (CURSCRIPT == 'game')}-->
<script type="text/javascript" src="include/record.js"></script>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='1')}--> <!--{if (CURSCRIPT == 'game' && $pls=='1')}-->
<style> <style>
body {background-image: url("../../img/location/1.jpg");background-position: center;} body {background-image: url("../../img/location/1.jpg");background-position: center;}
...@@ -205,6 +209,10 @@ ...@@ -205,6 +209,10 @@
</div> </div>
</a> </a>
</span> </span>
<!--{if (CURSCRIPT == 'game')}-->
<a href="javascript:void(0)" onclick="stopRecording()">>>停止录像</a>
<!--{/if}-->
<a href="record.php">>>回放录像</a>
<a href="admin.php">>>{lang admin}</a> <a href="admin.php">>>{lang admin}</a>
<a href="https://bbs.brdts.online/" target="_blank">>>{lang report}</a> <a href="https://bbs.brdts.online/" target="_blank">>>{lang report}</a>
<a href="https://bbs.brdts.online/?thread-2.htm" target="_blank">>>{lang donate}</a> <a href="https://bbs.brdts.online/?thread-2.htm" target="_blank">>>{lang donate}</a>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<table border="0" width="720" cellspacing="0" cellpadding="0" valign="middle"> <table border="0" width="720" cellspacing="0" cellpadding="0" valign="middle">
<tr> <tr>
<!--{eval $nickinfo = titles_get_desc($nick,1);}--> <!--{eval $nickinfo = titles_get_desc($nick,1);}-->
<td width="210" colspan="3" class="b1"><span>{$nickinfo} {$name}</span></td> <td width="210" colspan="3" class="b1" id="nickinfo"><span>{$nickinfo} {$name}</span></td>
<td width="100" colspan="1" class="b1"><span>{$sexinfo[$gd]}{$sNo}号</span></td> <td width="100" colspan="1" class="b1"><span>{$sexinfo[$gd]}{$sNo}号</span></td>
<td width="95" colspan="2" class="b1"><span>{lang weather}:$wthinfo[$weather]</span></td> <td width="95" colspan="2" class="b1"><span>{lang weather}:$wthinfo[$weather]</span></td>
<td width="215" colspan="1" class="b1"><span>{lang gamedate}<!--{if $gamestate == 40 }--><span class="yellow">{lang combo}</span><!--{/if}--><!--{if $gamestate == 50 }--><span class="red">{lang duel}</span><!--{/if}--></span></td> <td width="215" colspan="1" class="b1"><span>{lang gamedate}<!--{if $gamestate == 40 }--><span class="yellow">{lang combo}</span><!--{/if}--><!--{if $gamestate == 50 }--><span class="red">{lang duel}</span><!--{/if}--></span></td>
......
{template header}
<div class="subtitle">回放录像</div>
<div id="notice"></div>
<center>
<button onclick="selectRecordedFile()">选择录像文件</button>
</center>
<div id="recordedData"></div>
{template footer}
想购买什么物品?<br><br> 想购买什么物品?<br><br>
<input type="hidden" name="mode" value="shop"> <input type="hidden" name="mode" value="shop">
<input type="hidden" name="shoptype" value="$shop"> <input type="hidden" name="shoptype" value="$shop">
<input type="radio" name="command" id="menu" value="menu" checked><a onclick=sl('menu'); href="javascript:void(0);" onmouseover="status=' ';return true;">离开商店</a><br> <input type="hidden" id="command" name="command" value="menu">
<input type="radio" name="command" id="shop" value="shop"><a onclick=sl('shop'); href="javascript:void(0);" onmouseover="status=' ';return true;">返回列表</a><br><br> <input type="hidden" id="buynum" name="buynum" value="1">
<input type="button" class="cmdbutton" value="离开商店" onclick="$('command').value='menu';postCmd('gamecmd','command.php');this.disabled=true;">
&nbsp;
<input type="button" class="cmdbutton" value="返回列表" onclick="$('command').value='shop';postCmd('gamecmd','command.php');this.disabled=true;">
<br><br>
<!--{loop $itemdata $idata}--> <!--{loop $itemdata $idata}-->
<!--{if $idata['sid']}--> <!--{if $idata['sid']}-->
<a onclick=sl("$idata['sid']"); href="javascript:void(0);" onmouseover="status=' ';return true;"><input type="radio" name="command" id="$idata['sid']" value="$idata['sid']">$idata['item_words']/$idata['itmk_words']/$idata['itme']/$idata['itms']<!--{if $idata['itmsk_words']}-->/$idata['itmsk_words']<!--{/if}--> 【价:$idata['price'],数:$idata['num']】</a><br> <!--{eval $idsid = $idata['sid'];$buynumflag = $shop==1||$shop==2||$shop==6||$shop==7||$shop==8||$shop==10||$shop==11||$shop==12 ? 1 : 0;}-->
<!--{/if}--> <div class="shoprow">
<!--{/loop}--> <div class="leftbox">
<!--{if $shop==1||$shop==2||$shop==6||$shop==7||$shop==8||$shop==10||$shop==11||$shop==12}--> <input type="button" class="cmdbutton" value="购买" onclick="$('command').value='$idsid';<!--{if $buynumflag}-->$('buynum').value=$('buynum{$idsid}').value;<!--{/if}-->postCmd('gamecmd','command.php');this.disabled=true;">
请输入购买数量:<input type="number" name="buynum" value="1" min="1" max="1000"> </div>
<!--{else}--> <div <!--{if $buynumflag}-->style="width:185px;"<!--{/if}-->>
<input type="hidden" name="buynum" value="1"> $idata['item_words']/$idata['itmk_words']/$idata['itme']/$idata['itms']<!--{if $idata['itmsk_words']}-->/$idata['itmsk_words']<!--{/if}-->/价:$idata['price']/数:$idata['num']
</div>
<div class="rightbox">
<!--{if $buynumflag}-->
<input type="number" id="buynum{$idsid}" style="width:60px" value="1" min="1" max="1000"><span class="inputunit"></span>
<!--{/if}-->
</div>
</div>
<!--{/if}--> <!--{/if}-->
<br><br> <!--{/loop}-->
<input type="button" class="cmdbutton" id="zz" name="submit" value="[Z]提交" onclick="postCmd('gamecmd','command.php');this.disabled=true;"> \ No newline at end of file
\ No newline at end of file
想购买什么物品?<br><br> 想购买什么物品?<br><br>
<input type="hidden" name="mode" value="special"> <input type="hidden" name="mode" value="special">
<input type="radio" name="command" id="menu" value="menu" checked><a onclick=sl('menu'); href="javascript:void(0);" onmouseover="status=' ';return true;">离开商店</a><br><br> <input type="hidden" id="command" name="command" value="menu">
<input type="radio" name="command" id="shop1" value="shop1"><a onclick=sl('shop1'); href="javascript:void(0);" onmouseover="status=' ';return true;">【补给品】</a><br> <input type="button" class="cmdbutton" value="离开" onclick="$('command').value='menu';postCmd('gamecmd','command.php');this.disabled=true;">
<input type="radio" name="command" id="shop2" value="shop2"><a onclick=sl('shop2'); href="javascript:void(0);" onmouseover="status=' ';return true;">【药剂】</a><br> <br>
<input type="radio" name="command" id="shop3" value="shop3"><a onclick=sl('shop3'); href="javascript:void(0);" onmouseover="status=' ';return true;">【$iteminfo['WP']】</a><br> <!--{loop Array(1=>'补给品',2=>'药剂',3=>$iteminfo['WP'],4=>$iteminfo['WK'],5=>$iteminfo['WG'],6=>$iteminfo['WC'],7=>$iteminfo['WD'],8=>$iteminfo['WF'].'材料',9=>'防具',10=>'书籍',11=>'电子装备',12=>'杂物',17=>'限量福袋',13=>'埃克法轻工特供武器',14=>'林苍月的提示',15=>'Key社纪念品专卖',16=>'NPC解锁钥匙',18=>'上级者向物品') $sid $scmt}-->
<input type="radio" name="command" id="shop4" value="shop4"><a onclick=sl('shop4'); href="javascript:void(0);" onmouseover="status=' ';return true;">【$iteminfo['WK']】</a><br> <!--{if $sid % 2}--><br><!--{/if}-->
<input type="radio" name="command" id="shop5" value="shop5"><a onclick=sl('shop5'); href="javascript:void(0);" onmouseover="status=' ';return true;">【$iteminfo['WG']】</a><br> <input type="button" class="cmdbutton" name="$sid" value="{$scmt}" style="
<input type="radio" name="command" id="shop6" value="shop6"><a onclick=sl('shop6'); href="javascript:void(0);" onmouseover="status=' ';return true;">【$iteminfo['WC']】</a><br> <!--{if mb_strlen($scmt)>8}-->width:140px;<!--{else}-->width:100px;<!--{/if}-->
<input type="radio" name="command" id="shop7" value="shop7"><a onclick=sl('shop7'); href="javascript:void(0);" onmouseover="status=' ';return true;">【$iteminfo['WD']】</a><br> <!--{if $sid == 17}-->background-image:url(img/backround2.gif) repeat-x<!--{elseif $sid == 13 || $sid == 14 || $sid == 15 || $sid == 16}-->background-image:url(img/backround3.gif) repeat-x<!--{elseif $sid == 18}-->background-image:url(img/backround9.gif) repeat-x<!--{/if}-->"
<input type="radio" name="command" id="shop8" value="shop8"><a onclick=sl('shop8'); href="javascript:void(0);" onmouseover="status=' ';return true;">【{$iteminfo['WF']}材料】</a><br> onclick="$('command').value='shop{$sid}';postCmd('gamecmd','command.php');this.disabled=true;">
<input type="radio" name="command" id="shop9" value="shop9"><a onclick=sl('shop9'); href="javascript:void(0);" onmouseover="status=' ';return true;">【防具】</a><br> <!--{/loop}-->
<input type="radio" name="command" id="shop10" value="shop10"><a onclick=sl('shop10'); href="javascript:void(0);" onmouseover="status=' ';return true;">【书籍】</a><br> \ No newline at end of file
<input type="radio" name="command" id="shop11" value="shop11"><a onclick=sl('shop11'); href="javascript:void(0);" onmouseover="status=' ';return true;">【电子装备】</a><br>
<input type="radio" name="command" id="shop12" value="shop12"><a onclick=sl('shop12'); href="javascript:void(0);" onmouseover="status=' ';return true;">【杂物】</a><br>
<input type="radio" name="command" id="shop17" value="shop17"><a onclick=sl('shop17'); href="javascript:void(0);" onmouseover="status=' ';return true;"><font style="background:url(img/backround2.gif) repeat-x">【限量福袋】</font></a><br>
<input type="radio" name="command" id="shop13" value="shop13"><a onclick=sl('shop13'); href="javascript:void(0);" onmouseover="status=' ';return true;"><font style="background:url(img/backround3.gif) repeat-x">【埃克法轻工特供武器】</font></a><br>
<input type="radio" name="command" id="shop14" value="shop14"><a onclick=sl('shop14'); href="javascript:void(0);" onmouseover="status=' ';return true;"><font style="background:url(img/backround3.gif) repeat-x">【林苍月的提示】</font></a><br>
<input type="radio" name="command" id="shop15" value="shop15"><a onclick=sl('shop15'); href="javascript:void(0);" onmouseover="status=' ';return true;"><font style="background:url(img/backround3.gif) repeat-x">【Key社纪念品专卖】</font></a><br>
<input type="radio" name="command" id="shop16" value="shop16"><a onclick=sl('shop16'); href="javascript:void(0);" onmouseover="status=' ';return true;"><font style="background:url(img/backround3.gif) repeat-x">【NPC解锁钥匙】</font></a><br>
<input type="radio" name="command" id="shop18" value="shop18"><a onclick=sl('shop18'); href="javascript:void(0);" onmouseover="status=' ';return true;"><font style="background:url(img/backround9.gif) repeat-x">【上级者向物品】</font></a><br>
<br><br>
<input type="button" class="cmdbutton" id="zz" name="submit" value="[Z]提交" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
...@@ -3,12 +3,13 @@ ...@@ -3,12 +3,13 @@
<tr> <tr>
<td>{lang usertitle}</td> <td>{lang usertitle}</td>
<td> <td>
<select name="nick"> <select id="nick" name="nick" onchange="var nicklabel=$('nick').options[$('nick').selectedIndex].label;if(''!=nicklabel) $('nickcmt').innerHTML=nicklabel; else $('nickcmt').innerHTML='<br><br><br>';">
<!--{loop $nicksrev['nicks'] $val}--> <!--{loop $nicksrev['nicks'] $val}-->
<option value="{$val}"<!--{if $udata['nick'] == $val}-->selected<!--{/if}-->>$titles_list[$val]</option> <!--{eval $title_desc_tmp = str_replace("\r","<br>",$title_desc[$val]['title']);}-->
<option value="{$val}"<!--{if $udata['nick'] == $val}-->selected<!--{/if}--> label="{$title_desc_tmp}">$titles_list[$val]</option>
<!--{/loop}--> <!--{/loop}-->
</select> </select>
选择一个有趣的头衔,部分头衔存在特殊的入场效果。 <span id="nickcmt">选择一个有趣的头衔,部分头衔存在特殊的入场效果。<br><br><br></span>
</td> </td>
</tr> </tr>
<!--{if !empty($t1_list) && !empty($t2_list)}--> <!--{if !empty($t1_list) && !empty($t2_list)}-->
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
<input type="button" value="角色信息" <!--{if $info['wmode'] && $info['wmode'] != 1 && $info['wmode'] !=4 && $info['wmode'] != 6}-->onclick="$('command').value='info';$('gnum').value='$gid';document.info.submit();"<!--{else}-->disabled<!--{/if}-->> <input type="button" value="角色信息" <!--{if $info['wmode'] && $info['wmode'] != 1 && $info['wmode'] !=4 && $info['wmode'] != 6}-->onclick="$('command').value='info';$('gnum').value='$gid';document.info.submit();"<!--{else}-->disabled<!--{/if}-->>
<!--{if $info['wmode'] && $info['wmode'] !=4}--><span class="white"><a href="winner.php?command=news&gnum=$info[gid]">📼</a></span><!--{else}--> <!--{/if}--> <!--{if $info['wmode'] && $info['wmode'] !=4}--><span class="white"><a href="winner.php?command=news&gnum=$info[gid]">📼</a></span><!--{else}--> <!--{/if}-->
<input type="button" value="该局状况" <!--{if $info['wmode'] && $info['wmode'] !=4}-->onclick="$('command').value='news';$('gnum').value='$gid';document.info.submit();"<!--{else}-->disabled<!--{/if}-->> <input type="button" value="该局状况" <!--{if $info['wmode'] && $info['wmode'] !=4}-->onclick="$('command').value='news';$('gnum').value='$gid';document.info.submit();"<!--{else}-->disabled<!--{/if}-->>
$download_buttons[$gid]
</span> </span>
</TD> </TD>
</TR> </TR>
......
...@@ -23,6 +23,7 @@ if($command == 'info') { ...@@ -23,6 +23,7 @@ if($command == 'info') {
$hnewsinfo = readover($hnewsfile); $hnewsinfo = readover($hnewsfile);
} }
} else { } else {
$download_button = [];
if(!isset($start) || !$start){ if(!isset($start) || !$start){
$result = $db->query("SELECT gid,name,nick,icon,gd,wep,wmode,teamID,teamMate,teamIcon,getime,motto,hdp,hdmg,hkp,hkill FROM {$gtablepre}winners ORDER BY gid desc LIMIT $winlimit"); $result = $db->query("SELECT gid,name,nick,icon,gd,wep,wmode,teamID,teamMate,teamIcon,getime,motto,hdp,hdmg,hkp,hkill FROM {$gtablepre}winners ORDER BY gid desc LIMIT $winlimit");
} else { } else {
...@@ -50,7 +51,14 @@ if($command == 'info') { ...@@ -50,7 +51,14 @@ if($command == 'info') {
$wdata['nickinfo'] = (!empty($wdata['nick']) || $wdata['nick'] === '0') ? titles_get_desc($wdata['nick']) : ''; $wdata['nickinfo'] = (!empty($wdata['nick']) || $wdata['nick'] === '0') ? titles_get_desc($wdata['nick']) : '';
} }
} }
$winfo[$wdata['gid']] = $wdata; $winfo[$wdata['gid']] = $wdata;
//遍历./records/$wdata['gid']/下的所有gz文件
$filelist = glob("./records/{$wdata['gid']}/**/*.gz");
foreach ($filelist as $file) {
//下载按钮,html
$dirname = basename(dirname($file));
$download_buttons[$wdata['gid']] .= "<br><a href=\"$file\" download=\"$dirname\">下载 $dirname</a>";
}
} }
$listnum = floor($gamenum/$winlimit); $listnum = floor($gamenum/$winlimit);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment