명장일람 버그 수정

This commit is contained in:
2020-04-20 23:04:03 +09:00
parent 51f24748a9
commit 6af3c1d523
3 changed files with 77 additions and 31 deletions
+58 -29
View File
@@ -47,7 +47,7 @@ $templates = new \League\Plates\Engine(__DIR__.'/templates');
</td></tr> </td></tr>
</form> </form>
</table> </table>
<div style="margin:auto;width:1000px;"> <div style="margin:auto;width:1100px;">
<?php <?php
$ownerNameList = []; $ownerNameList = [];
@@ -227,7 +227,7 @@ foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){
} }
?> ?>
</div> </div>
<div style="margin:auto;width:1000px;margin-top:5px;"> <div style="margin:auto;width:1100px;margin-top:5px;">
<?php <?php
//유니크 아이템 소유자 //유니크 아이템 소유자
$itemTypes = [ $itemTypes = [
@@ -238,50 +238,79 @@ $itemTypes = [
]; ];
$simpleItemTypes = array_keys($itemTypes); array_map(function($itemType){return $itemType[1];}, $itemTypes); $simpleItemTypes = array_keys($itemTypes); array_map(function($itemType){return $itemType[1];}, $itemTypes);
$itemOwners = [];
foreach($generals as $general){ foreach($generals as $general){
foreach($itemTypes as $itemIdx=>[,$itemType, $itemFunc,,,]){ foreach($itemTypes as $itemType=>$itemTypeName){
$itemCode = $general[$itemType]; $itemClassName = $general[$itemType];
$itemClass = buildItemClass($itemCode); $itemClass = buildItemClass($itemClassName);
if(!$itemClass->isBuyable()){ if($itemClass->isBuyable()){
continue;
}
if(key_exists($itemClassName, $itemOwners)){
$itemOwners[$itemClassName][] = $general;
}
else{
$itemOwners[$itemClassName] = [$general];
}
}
}
foreach(GameConst::$allItems as $itemType=>$itemList){
$itemNameType = $itemTypes[$itemType];
$itemList = array_reverse($itemList, true);
$itemRanker = [];
foreach($itemList as $itemClassName=>$itemCnt){
if($itemCnt==0){
continue;
}
$itemClass = buildItemClass($itemClassName);
if($itemClass->isBuyable()){
continue; continue;
} }
$info = $itemClass->getInfo(); $info = $itemClass->getInfo();
$name = $itemClass->getName(); $name = $itemClass->getName();
if($info){ if($info){
$name = $templates->render('tooltip', [ $name = $templates->render('tooltip', [
'text'=>$text, 'text'=>$name,
'info'=>$info, 'info'=>$info,
]); ]);
} }
foreach(Util::range($itemCnt) as $itemIdx){
if(($itemOwners[$itemClassName][$itemIdx]??null) === null){
$emptyCard = [
'rankName' => $name,
'pictureFullPath' => GetImageURL(0)."/default.jpg",
'value'=>$itemClassName,
'name'=>'미발견',
'bgColor'=>GameConst::$basecolor4,
'fgColor'=>newColor(GameConst::$basecolor4),
];
$itemRanker[] = $emptyCard;
continue;
}
$general = $itemOwners[$itemClassName][$itemIdx];
$general['rankName'] = $name; $card = [
$general['value'] = $itemCode; 'rankName' => $name,
$itemTypes[$itemIdx][5][$itemCode] = $general; 'pictureFullPath' => $general['pictureFullPath'],
} 'value'=>$itemClassName,
} 'nationName'=>$general['nationName'],
'name'=>$general['name'],
foreach($itemTypes as [$itemNameType, $itemType, $itemFunc, $itemMinCode, $itemMaxCode, $itemOwners]){ 'bgColor'=>$general['bgColor'],
$itemRanker = []; 'fgColor'=>$general['dfColor'],
for($itemCode = $itemMaxCode; $itemCode >= $itemMinCode; $itemCode--){
if(!key_exists($itemCode, $itemOwners)){
$emptyCard = [
'rankName' => ($itemFunc)($itemCode),
'pictureFullPath' => GetImageURL(0)."/default.jpg",
'value'=>$itemCode,
'name'=>'미발견',
'bgColor'=>GameConst::$basecolor4,
'fgColor'=>newColor(GameConst::$basecolor4),
]; ];
$itemRanker[$itemCode] = $emptyCard; $itemRanker[] = $card;
continue;
} }
$general = $itemOwners[$itemCode];
$itemRanker[$itemCode] = $general;
} }
echo $templates->render('hallOfFrame', [ echo $templates->render('hallOfFrame', [
+7
View File
@@ -24,6 +24,13 @@ class BaseItem implements iAction{
return $this->rawName; return $this->rawName;
} }
public function getRawClassName(bool $shortName=true):string{
if($shortName){
return Util::getClassNameFromObj($this);
}
return static::class;
}
function getCost(){ function getCost(){
return $this->cost; return $this->cost;
} }
+11 -1
View File
@@ -4,6 +4,15 @@ namespace sammo;
require(__DIR__.'/vendor/autoload.php'); require(__DIR__.'/vendor/autoload.php');
$session = Session::requireLogin('./')->setReadOnly(); $session = Session::requireLogin('./')->setReadOnly();
if(key_exists('from', $_REQUEST) && is_numeric($_REQUEST['from'])){
$from = (int)$_REQUEST['from'];
if($from < 0){
$from = 0;
}
}
else{
$from = 0;
}
$allowUpdate = false; $allowUpdate = false;
@@ -34,7 +43,7 @@ $err_logs = $fdb->select('err_log', [
'webuser' 'webuser'
], [ ], [
'ORDER'=>['id'=>'DESC'], 'ORDER'=>['id'=>'DESC'],
'LIMIT'=>100 'LIMIT'=>[$from, 100]
]); ]);
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@@ -74,6 +83,7 @@ $err_logs = $fdb->select('err_log', [
</div> </div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<a href="showErrorLog.php?from=<?=$from+100?>" class="btn btn-primary btn-lg active" role="button">+100</a>
</div> </div>
</body> </body>
</html> </html>