Commit 6d5d0a17 authored by hisuinohoshi's avatar hisuinohoshi

rev achievement phase 0.81

- 新增一个管理后台的临时功能:批量将玩家的旧成就数据转移至新成就结构内;
parent a5c689d0
...@@ -34,7 +34,7 @@ if($urcmd){ ...@@ -34,7 +34,7 @@ if($urcmd){
$resultinfo = '第'.$startno.'条-第'.$endno.'条记录'; $resultinfo = '第'.$startno.'条-第'.$endno.'条记录';
} }
} }
if($urcmd == 'ban' || $urcmd == 'unban' || $urcmd == 'del') { if($urcmd == 'ban' || $urcmd == 'unban' || $urcmd == 'del' || $urcmd == 'checkach') {
$operlist = $gfaillist = $ffaillist = array(); $operlist = $gfaillist = $ffaillist = array();
for($i=0;$i<$showlimit;$i++){ for($i=0;$i<$showlimit;$i++){
if(isset(${'user_'.$i})) { if(isset(${'user_'.$i})) {
...@@ -46,6 +46,35 @@ if($urcmd == 'ban' || $urcmd == 'unban' || $urcmd == 'del') { ...@@ -46,6 +46,35 @@ if($urcmd == 'ban' || $urcmd == 'unban' || $urcmd == 'del') {
$urdata[$i]['groupid'] = 1; $urdata[$i]['groupid'] = 1;
}elseif($urcmd == 'del'){ }elseif($urcmd == 'del'){
unset($urdata[$i]); unset($urdata[$i]);
}elseif($urcmd == 'checkach'){
$adata = $urdata[$i]; $n = $urdata[$i]['username'];
$adata['achrev'] = json_decode($adata['achrev'],true);
$new_ach = Array(); $cpl = Array(); $prc = Array();
//手动变化成就储存结构
if(!empty($adata['achievement']) && empty($adata['achrev']))
{
include_once GAME_ROOT.'./include/game/achievement.func.php';
$alist = get_achlist();
foreach($alist as $a => $aarr)
{
if($a <= 57)
{
$cpl[$a]=check_achievement($a,$n);
$prc[$a]=fetch_achievement($a,$n);
//新成就储存结构内,只会保存有进度的成就
if(!empty($cpl[$a]) || !empty($prc[$a]))
{
// 到达999阶段的成就 替换为配置中预设的达成等级
if($cpl[$a] == 999) $cpl[$a] = $aarr['lvl'] ?: count($aarr['name']);
$new_ach[$a]['l'] = $cpl[$a] ?: 0;
$new_ach[$a]['v'] = $prc[$a] ?: 0;
}
}
}
$new_ach = json_encode($new_ach);
$db->query("UPDATE {$tablepre}users SET achrev='$new_ach' WHERE username='".$n."'" );
}
//$new_ach = '';
} }
// adminlog('banur',$urdata[$i]['username']); // adminlog('banur',$urdata[$i]['username']);
}elseif(isset($urdata[$i]) && $urdata[$i]['uid'] == ${'user_'.$i}){ }elseif(isset($urdata[$i]) && $urdata[$i]['uid'] == ${'user_'.$i}){
...@@ -66,8 +95,10 @@ if($urcmd == 'ban' || $urcmd == 'unban' || $urcmd == 'del') { ...@@ -66,8 +95,10 @@ if($urcmd == 'ban' || $urcmd == 'unban' || $urcmd == 'del') {
}elseif($urcmd == 'del'){ }elseif($urcmd == 'del'){
$operword = '删除'; $operword = '删除';
$qryword = "DELETE FROM {$tablepre}users "; $qryword = "DELETE FROM {$tablepre}users ";
}elseif($urcmd == 'checkach'){
$cmd_info .= " 帐户 $opernames 调整了成就储存结构";
} }
if($operlist){ if($operlist && $urcmd != 'checkach'){
$qrywhere = '('.implode(',',array_keys($operlist)).')'; $qrywhere = '('.implode(',',array_keys($operlist)).')';
$opernames = implode(',',($operlist)); $opernames = implode(',',($operlist));
$db->query("$qryword WHERE uid IN $qrywhere"); $db->query("$qryword WHERE uid IN $qrywhere");
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<th>头像</th> <th>头像</th>
<th>社团</th> <th>社团</th>
<th>成就</th> <th>成就</th>
<th>成就(新)</th>
<th>称号表</th> <th>称号表</th>
<th>口头禅</th> <th>口头禅</th>
<th>杀人留言</th> <th>杀人留言</th>
...@@ -59,6 +60,7 @@ ...@@ -59,6 +60,7 @@
<td><input type="text" name="icon_$n" size="2" maxlength="2" value="$ur['icon']" disabled="true"></td> <td><input type="text" name="icon_$n" size="2" maxlength="2" value="$ur['icon']" disabled="true"></td>
<td>{$clubinfo[$ur['club']]}</td> <td>{$clubinfo[$ur['club']]}</td>
<td><input type="text" name="achievement_$n" size="20" maxlength="400" value="$ur['achievement']" disabled="true"></td> <td><input type="text" name="achievement_$n" size="20" maxlength="400" value="$ur['achievement']" disabled="true"></td>
<td><input type="text" name="achrev_$n" size="20" maxlength="400" value="$ur['achrev']" disabled="true"></td>
<td><input type="text" name="nicks_$n" size="20" maxlength="300" value="$ur['nicks']" disabled="true"></td> <td><input type="text" name="nicks_$n" size="20" maxlength="300" value="$ur['nicks']" disabled="true"></td>
<td><input type="text" name="motto_$n" size="20" maxlength="60" value="$ur['motto']" disabled="true"></td> <td><input type="text" name="motto_$n" size="20" maxlength="60" value="$ur['motto']" disabled="true"></td>
<td><input type="text" name="killmsg_$n" size="20" maxlength="20" value="$ur['killmsg']" disabled="true"></td> <td><input type="text" name="killmsg_$n" size="20" maxlength="20" value="$ur['killmsg']" disabled="true"></td>
...@@ -85,6 +87,7 @@ ...@@ -85,6 +87,7 @@
<td><input type="text" name="icon_$n" size="2" maxlength="2" value="$ur['icon']"></td> <td><input type="text" name="icon_$n" size="2" maxlength="2" value="$ur['icon']"></td>
<td>{$clubinfo[$ur['club']]}</td> <td>{$clubinfo[$ur['club']]}</td>
<td><input type="text" name="achievement_$n" size="20" maxlength="400" value="$ur['achievement']"></td> <td><input type="text" name="achievement_$n" size="20" maxlength="400" value="$ur['achievement']"></td>
<td><textarea name="achrev_$n" style="overflow:auto">$ur['achrev']</textarea></td>
<td><input type="text" name="nicks_$n" size="20" maxlength="300" value="$ur['nicks']"></td> <td><input type="text" name="nicks_$n" size="20" maxlength="300" value="$ur['nicks']"></td>
<td><input type="text" name="motto_$n" size="20" maxlength="60" value="$ur['motto']"></td> <td><input type="text" name="motto_$n" size="20" maxlength="60" value="$ur['motto']"></td>
<td><input type="text" name="killmsg_$n" size="20" maxlength="60" value="$ur['killmsg']"></td> <td><input type="text" name="killmsg_$n" size="20" maxlength="60" value="$ur['killmsg']"></td>
...@@ -97,10 +100,11 @@ ...@@ -97,10 +100,11 @@
<!--{/loop}--> <!--{/loop}-->
<tr> <tr>
<td colspan=2><input type="checkbox" name="user_all" onchange="for(i=0; i<=$n;i++){if(! $('user_'+i).disabled){if(this.checked==true){$('user_'+i).checked=true}else{$('user_'+i).checked=false}}}">全选</td> <td colspan=2><input type="checkbox" name="user_all" onchange="for(i=0; i<=$n;i++){if(! $('user_'+i).disabled){if(this.checked==true){$('user_'+i).checked=true}else{$('user_'+i).checked=false}}}">全选</td>
<td colspan=12 style="text-align:center;"> <td colspan=16 style="text-align:center;">
<input type="submit" name="submit" value="封停选中玩家" onclick="$('urcmd').value='ban'"> <input type="submit" name="submit" value="封停选中玩家" onclick="$('urcmd').value='ban'">
<input type="submit" name="submit" value="解封选中玩家" onclick="$('urcmd').value='unban'"> <input type="submit" name="submit" value="解封选中玩家" onclick="$('urcmd').value='unban'">
<input type="submit" name="submit" value="删除选中玩家" onclick="$('urcmd').value='del'"> <input type="submit" name="submit" value="删除选中玩家" onclick="$('urcmd').value='del'">
<input type="submit" name="submit" value="更新选中玩家的成就结构" onclick="$('urcmd').value='checkach'">
</td> </td>
</tr> </tr>
<!--{/if}--> <!--{/if}-->
......
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