Ver código fonte

Dungeons and Dimensional Hole runs logged. Items working. Run filters.

Iñigo Valentin 6 anos atrás
pai
commit
ad12fe4161

+ 12 - 0
application/Filter.php

@@ -131,4 +131,16 @@
         "assigned" => 1,
         "group" => "SLOT"
     ];
+
+    $FILTER_RUN = [
+        "area_type" => 0,
+        "area" => 0,
+        "stage" => 0,
+        "difficulty" => 0,
+        "date_min" => null,
+        "date_max" => null,
+        "defeat" => false,
+        "helper" => false,
+        "number" => 20,
+    ];
 ?>

+ 18 - 9
application/entity/K_Area.php

@@ -37,23 +37,28 @@
          */
         public function __construct($db, $id, $type){
             global $path;
+            global $AREA_TYPE;
             parent::__construct($db);
+            $this->id = $id;
             $s = "
                 SELECT
                   id,
                   type,
                   name
                 FROM k_area
-                WHERE id = $id
-                ORDER BY type = $type DESC;
+                WHERE id = '$id'
+                ORDER BY type = '$type' DESC;
             ";
             $q = $this->db->query($s);
             $r = $q->fetchArray(SQLITE3_ASSOC);
             if ($r){
-                $this->id = $r["id"];
                 $this->type = $r["type"];
                 $this->name = $r["name"];
             }
+            elseif($this->id > 1000){
+                $this->type = $AREA_TYPE["CAIROS_DUNGEON"];
+                $this->name = "Hall of Heroes";
+            }
         }
 
         /**
@@ -69,7 +74,11 @@
             global $path;
             global $AREA_TYPE;
             global $DUNGEON;
-            if (
+            if ($this->id > 10000 && file_exists($base_dir . "img/content/area/HOH.png")){
+                // Hall of Heroes
+                return $path["img"]["content"] . "area/HOH.png";
+            }
+            elseif (
               (
                 $this->type == $AREA_TYPE["SCENARIO"] ||
                 $this->type == $AREA_TYPE["RIFT_DUNGEON"] ||
@@ -88,8 +97,8 @@
             }
             elseif ($this->type == $AREA_TYPE["CAIROS_DUNGEON"] && in_array($this->id, $DUNGEON)){
                 switch ($this->id){
-                    case $DUNGEON["DRAGONS_LAIR"]:
-                        switch ($this->stage){
+                    case $DUNGEON["GIANTS_KEEP"]:
+                        switch ($stage){
                             case 1:
                             case 6:
                                 // Light
@@ -128,8 +137,8 @@
                                 break;
                         }
                         break;
-                    case $DUNGEON["GIANTS_KEEP"]:
-                        switch ($this->stage){
+                    case $DUNGEON["DRAGONS_LAIR"]:
+                        switch ($stage){
                             case 1:
                             case 6:
                                 // Wind
@@ -169,7 +178,7 @@
                         }
                         break;
                     case $DUNGEON["NECROPOLIS"]:
-                        switch ($this->stage){
+                        switch ($stage){
                             case 1:
                             case 6:
                                 // Water

+ 1 - 10
application/entity/Run.php

@@ -200,7 +200,7 @@
             ";
             $q = $this->db->query($s);
             while ($r = $q->fetchArray(SQLITE3_ASSOC)){
-                $i = new K_Inventory($this->db, $r["item"]);
+                $i = new Inventory($this->db, $r["item"]);
                 $i->amount =  $r["quantity"];
                 array_push($this->item, $i);
             }
@@ -272,19 +272,10 @@
                 FROM run_drop_rune
                 WHERE run = $this->id;
             ";
-            if ($this->id == 9){
-                error_log("DEBUG RUNE: " . $s);
-            }
             $q = $this->db->query($s);
             while ($r = $q->fetchArray(SQLITE3_ASSOC)){
                 $rune = new Rune($this->db, $r["id"]);
-                //if ($this->id == 9){
-                    error_log("DEBUG RUNE ID: " . $rune->id);
-                //}
                 if (!isset($rune->id)){
-                    if ($this->id == 9){
-                        error_log("DEBUG RUNE: NEW");
-                    }
                     $rune->id = $r["id"];
                     $rune->assigned_to = null;
                     $rune->type = new K_Rune_Set($this->db, $r["type"]);

+ 0 - 2
application/page/Report_Runecraft_Page.php

@@ -42,8 +42,6 @@
         public function __construct($db){
             global $path;
             global $root;
-            global $a;
-            error_log("VAR a: " . $a);
             parent::__construct($db);
             $this->view = $path["view"] . "report_runecraft.php";
             $this->parse_filters();

+ 56 - 58
application/page/Runs_Page.php

@@ -14,15 +14,9 @@
         public $runs = [];
 
         /**
-         * The filters the page can handle.
+         * Filters the page can handle.
          */
-        public $filters = [
-            "area" => [],
-            "stage" => [],
-            "difficulty" => [],
-            "win_lose" => 0,
-            "helper" => false
-        ];
+        public $filters;
 
         /**
          * Constructor.
@@ -52,33 +46,43 @@
          * and adds them to the $filters array.
          */
         private function parse_filters(){
-            if (isset($_GET["area"])){
-                $areas = $_GET["area"];
-                foreach ($areas as $area){
-                    array_push($this->filters["area"], intval($ara));
-                }
-            }
-            if (isset($_GET["stage"])){
-                $stages = $_GET["stage"];
-                foreach ($stages as $stage){
-                    array_push($this->filters["stage"], intval($ara));
-                }
-            }
-            if (isset($_GET["difficulty"])){
-                $difficultys = $_GET["difficulty"];
-                foreach ($difficultys as $difficulty){
-                    array_push($this->filters["difficulty"], intval($ara));
-                }
-            }
-            if (isset($_GET["win_lose"]) && intval($_GET["win_lose"]) >= 0 && intval($_GET["win_lose"]) <= 2){
-                $this->filters["win_lose"] = $_GET["win_lose"];
-            }
-            if (isset($_GET["helper"]) && $_GET["elper"] == "on"){
+            global $FILTER_RUN;
+            global $DIFFICULTY;
+            $this->filters = $FILTER_RUN;
+            
+            if (isset($_GET["area_type"]) && intval($_GET["area_type"]) > 0){
+                $this->filters["area_type"] = $_GET["area_type"];
+            }
+            if (isset($_GET["area"]) && intval($_GET["area"]) > 0){
+                $this->filters["area"] = $_GET["area"];
+            }
+            if (isset($_GET["stage"]) && intval($_GET["stage"]) > 0){
+                $this->filters["stage"] = $_GET["stage"];
+            }
+            if (isset($_GET["difficulty"]) && intval($_GET["difficulty"]) >= $DIFFICULTY["NORMAL"] && intval($_GET["difficulty"]) <= $DIFFICULTY["HELL"]){
+                $this->filters["difficulty"] = $_GET["difficulty"];
+            }
+            if (isset($_GET["date_min"]) && strlen($_GET["date_min"]) > 0){
+                $this->filters["date_min"] = DateTime::createFromFormat('Y-m-d', $_GET["date_min"])->format('Y-m-d');
+            }
+            if (isset($_GET["date_max"]) && strlen($_GET["date_max"]) > 0){
+                $this->filters["date_max"] = DateTime::createFromFormat('Y-m-d', $_GET["date_max"])->format('Y-m-d');
+            }
+            if (isset($_GET["defeat"]) && $_GET["defeat"] == "on"){
+                $this->filters["defeat"] = true;
+            }
+            else{
+                $this->filters["helper"] = false;
+            }
+            if (isset($_GET["helper"]) && $_GET["helper"] == "on"){
                 $this->filters["helper"] = true;
             }
             else{
                 $this->filters["helper"] = false;
             }
+            if (isset($_GET["number"]) && intval($_GET["number"]) > 0){
+                $this->filters["number"] = $_GET["number"];
+            }
             return;
         }
 
@@ -94,35 +98,29 @@
                 FROM run
                 WHERE 1 = 1
              ";
-            if (count($this->filters["area"]) > 0){
-                $s = $s . " AND area IN ( ";
-                foreach($this->filters["area"] as $t){
-                    $s = $s . "'$t', ";
-                }
-                $s = $s . "'DUMMY0') ";
-            }
-            if (count($this->filters["stage"]) > 0){
-                $s = $s . " AND stage IN ( ";
-                foreach($this->filters["stage"] as $t){
-                    $s = $s . "'$t', ";
-                }
-                $s = $s . "'DUMMY0') ";
-            }
-            if (count($this->filters["difficulty"]) > 0){
-                $s = $s . " AND difficulty IN ( ";
-                foreach($this->filters["difficulty"] as $t){
-                    $s = $s . "'$t', ";
-                }
-                $s = $s . "'DUMMY0') ";
-            }
-            switch ($this->filters["win_lose"]){
-                case 1:
-                    $s = $s . " AND win = 1 ";
-                    break;
-                case 2:
-                    $s = $s . " AND win = 0 ";
-                    break;
+            if ($this->filters["area"] > 0){
+                $s = $s . " AND area =  " . $this->filters["area"] . " ";
+            }
+            if ($this->filters["stage"] > 0){
+                $s = $s . " AND stage =  " . $this->filters["stage"] . " ";
+            }
+            if ($this->filters["difficulty"] > 0){
+                $s = $s . " AND difficulty =  " . $this->filters["difficulty"] . " ";
+            }
+            if (!$this->filters["defeat"]){
+                $s = $s . " AND win = 1 ";
+            }
+            if (!$this->filters["helper"]){
+                $s = $s . " AND helper = 0 ";
+            }
+            if ($this->filters["date_min"] != null){
+                $s = $s . " AND date(dtime) >= date('" . $this->filters["date_min"] . "') ";
+            }
+            if ($this->filters["date_max"] != null){
+                $s = $s . " AND date(dtime) >= date('" . $this->filters["date_max"] . "') ";
             }
+            $s = $s . " ORDER BY dtime DESC ";
+            $s = $s . " LIMIT " . $this->filters["number"] . ";";
             return $s;
         }
     }

+ 116 - 0
application/view/inc/filter_runs.php

@@ -0,0 +1,116 @@
+<?php
+    global $AREA_TYPE;
+?>
+<form action='runs' method='get' id='filter_runeupgrade' class='filter'>
+    <table>
+        <tr>
+            <td class='filter filter_title'>
+                <span>
+                    Area
+                </span>
+            </td>
+            <td class='filter'>
+<?php
+                $selected = [];
+                $selected[$filters["area_type"]] = "selected";
+?>
+                <span>Region:</span>
+                <select name='area_type' id='filter_area'>
+                    <option value='0'>All</option>
+                    <option value='<?=$AREA_TYPE["SCENARIO"]?>' <?=$selected[$AREA_TYPE["SCENARIO"]]?>>Scenario</option>
+                    <option value='<?=$AREA_TYPE["CAIROS_DUNGEON"]?>' <?=$selected[$AREA_TYPE["CAIROS_DUNGEON"]]?>>Cairos Dungeon</option>
+                    <option value='<?=$AREA_TYPE["RIFT_DUNGEON"]?>' <?=$selected[$AREA_TYPE["RIFT_DUNGEON"]]?>>Rift Beast</option>
+                    <option value='<?=$AREA_TYPE["RIFT_RAID"]?>' <?=$selected[$AREA_TYPE["RIFT_RAID"]]?>>Rift Raid</option>
+                    <option value='<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>' <?=$selected[$AREA_TYPE["DIMENSIONAL_HOLE"]]?>>Dimensional Hole</option>
+                    <option value='<?=$AREA_TYPE["ARENA"]?>' <?=$selected[$AREA_TYPE["ARENA"]]?>>Arena</option>
+                    <option value='<?=$AREA_TYPE["GUILD_WAR"]?>' <?=$selected[$AREA_TYPE["GUILD_WAR"]]?>>Guild War</option>
+                    <option value='<?=$AREA_TYPE["GUILD_SIEGE"]?>' <?=$selected[$AREA_TYPE["GUILD_SIEGE"]]?>>Guild Siege</option>
+                    <option value='<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>' <?=$selected[$AREA_TYPE["TARTARUS_LABYRINTH"]]?>>Tartarus Labyrinth</option>
+                    <option value='<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>' <?=$selected[$AREA_TYPE["TRIAL_OF_ASCENSION"]]?>>Trial of Ascension</option>
+                    <option value='<?=$AREA_TYPE["WORLD_BOSS"]?>' <?=$selected[$AREA_TYPE["WORLD_BOSS"]]?>>World Boss</option>
+                    <option value='<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>' <?=$selected[$AREA_TYPE["DIMENSIONAL_RIFT"]]?>>Dimensional Rift</option>
+                </select>
+            </td>
+            <td class='filter'>
+<?php
+                $selected = [];
+                $selected[$filters["area00"]] = "selected";
+?>
+                <span>Area:</span>
+                <select name='area_scenario'>
+                    <option value='0'>All</option>
+                    <option value='1' <?=$selected[1]?>>Garen Forest</option>
+                    <option value='2' <?=$selected[2]?>>Mt. Siz</option>
+                    <option value='3' <?=$selected[3]?>>Kabir Ruins</option>
+                    <option value='4' <?=$selected[4]?>>Mt. White Ragon</option>
+                    <option value='5' <?=$selected[5]?>>Telain Forest</option>
+                    <option value='6' <?=$selected[6]?>>Hydeni Ruins</option>
+                    <option value='7' <?=$selected[7]?>>Tamor Desert</option>
+                    <option value='8' <?=$selected[8]?>>Vrofagus Ruins</option>
+                    <option value='9' <?=$selected[9]?>>Faimon Volcano</option>
+                    <option value='10' <?=$selected[10]?>>Aiden Forest</option>
+                    <option value='11' <?=$selected[11]?>>Ferun Castle</option>
+                    <option value='12' <?=$selected[12]?>>Mt. Runar</option>
+                    <option value='13' <?=$selected[13]?>>Charuka Remains</option>
+                </select>
+                <select name='area_cairos'>
+                    <option value='0'>All</option>
+                    <option value='1001' <?=$selected[1001]?>>Hall of Dark</option>
+                    <option value='2001' <?=$selected[2001]?>>Hall of Fire</option>
+                    <option value='3001' <?=$selected[3001]?>>Hall of Water</option>
+                    <option value='4001' <?=$selected[4001]?>>Hall of Wind</option>
+                    <option value='5001' <?=$selected[5001]?>>Hall of Magic</option>
+                    <option value='6001' <?=$selected[6001]?>>Necropolis</option>
+                    <option value='7001' <?=$selected[7001]?>>Hall of Light</option>
+                    <option value='8001' <?=$selected[8001]?>>Giant&#39;s Keep</option>
+                    <option value='9001' <?=$selected[9001]?>>Dragon&#39;s Lair</option>
+                </select>
+            </td>
+        </tr>
+        <tr>
+            <td class='filter filter_title filter_separator' rowspan='4'>
+                <span>
+                    Extra
+                </span>
+            </td>
+            <td class='filter filter_separator' colspan='2'>
+                <span>Date range:</span>
+                <input type='date' name='date_min' id='date_min' value='<?=$filters["date_min"]?>'/>
+                -
+                <input type='date' name='date_max' id='date_max' value='<?=$filters["date_max"]?>'/>
+            </td>
+        </tr>
+        <tr>
+            <td class='filter' colspan='2'>
+<?php
+                $checked = "";
+                if ($filters["defeat"]){
+                    $checked = "checked";
+                }
+?>
+                <input type='checkbox' name='defeat' <?=$checked?>/>
+                Show defeats
+            </td>
+        </tr>
+        <tr>
+            <td class='filter' colspan='2'>
+<?php
+                $checked = "";
+                if ($filters["helper"]){
+                    $checked = "checked";
+                }
+?>
+                <input type='checkbox' name='helper' <?=$checked?>/>
+                Show runs with friends/mentors
+            </td>
+        </tr>
+        <tr>
+            <td class='filter' colspan='2'>
+                <input type='number' name='number' id='number' min='1' value='<?=$filters["number"]?>'/> runs per page
+            </td>
+        </tr>
+    </table>
+    <div id='filter_apply'>
+        <input type='submit' value='Apply'/>
+    </div>
+</form>

+ 25 - 16
application/view/runs.php

@@ -40,12 +40,12 @@
 ?>
             <section class='filters'>
                 <h2>
-                    Rune filters
+                    Run filters
                 </h2>
 <?php
                 $filters = $page->filters;
                 //TODO
-                //include __DIR__ . "/inc/filter_runs.php";
+                include __DIR__ . "/inc/filter_runs.php";
 ?>
 
             </section> <!-- #filters -->
@@ -141,14 +141,23 @@
                                 </td>
                                 <td class='time'>
 <?php
-                                    $s = floor($run->time / 1000);
-                                    $m = floor($s / 60);
-                                    $s = floor($s % 60);
-                                    $ms = ($run-> time - (1000 * 60 * $m) - (1000 * 60 * $s) / 100);
-                                    $s = str_pad($s, 2, '0', STR_PAD_LEFT);
-                                    $ms = str_pad($ms, 2, '0', STR_PAD_LEFT);
+                                    if ($run->win == 1){
+                                        $s = floor($run->time / 1000);
+                                        $m = floor($s / 60);
+                                        $s = floor($s % 60);
+                                        $ms = ($run-> time - (1000 * 60 * $m) - (1000 * 60 * $s) / 100);
+                                        $s = str_pad($s, 2, '0', STR_PAD_LEFT);
+                                        $ms = str_pad($ms, 2, '0', STR_PAD_LEFT);
+?>
+                                        <?=$m?>:<?=$s?><span class='ms'>.<?=$ms?></span>
+<?php
+                                    }
+                                    else{
+?>
+                                        <span class='defeated'>Defeated</span>
+<?php
+                                    }
 ?>
-                                    <?=$m?>:<?=$s?><span class='ms'>.<?=$ms?></span>
                                 </td>
                                 <td class='reward'>
 <?php
@@ -179,32 +188,32 @@
                                     foreach ($run->unit as $unit){
 ?>
                                         <div class='item'>
-                                            <img class='item' title='<?$unit->title?>' src='<?=$unit->get_image()?>'/>
+                                            <img class='item' title='<?=$unit->title?>' src='<?=$unit->get_image()?>'/>
                                         </div>
 <?php
                                     }
                                     foreach ($run->item as $item){
 ?>
                                         <div class='item'>
-                                            <img class='item' title='<?$item->name?>' src='<?=$item->get_image()?>'/>
+                                            <img class='item' title='<?=$item->name?>' src='<?=$item->get_image()?>'/>
+                                            <span class='item'><?=$item->amount?></span>
                                         </div>
 <?php
                                     }
                                     foreach ($run->sd as $sd){
 ?>
                                         <div class='item'>
-                                            <img class='item' title='<?$sd->unit->title?>' src='<?=$sd->unit->get_image()?>'/>
+                                            <img class='item' title='<?=$sd->unit->title?>' src='<?=$sd->unit->get_image()?>'/>
                                             <img class='item' title=' ' src='<?=$path["img"]["layout"]?>misc/mask-sd.png'/>
-                                            <span><?=$sq->quantity?></span>
                                         </div>
 <?php
                                     }
                                     foreach ($run->unit_piece as $piece){
 ?>
                                         <div class='item'>
-                                            <img class='item' title='<?$piece->unit->title?>' src='<?=$piece->unit->get_image()?>'/>
+                                            <img class='item' title='<?=$piece->unit->title?>' src='<?=$piece->unit->get_image()?>'/>
                                             <img class='item' title=' ' src='<?=$path["img"]["layout"]?>misc/mask-piece.png'/>
-                                            <span><?=$piece->quantity?></span>
+                                            <span class='item'><?=$piece->quantity?></span>
                                         </div>
 <?php
                                     }
@@ -212,7 +221,7 @@
 ?>
                                         <div class='item'>
                                             <img class='item' title='Shapeshifting Stones' src='<?=$path["img"]["layout"]?>currency/costumestone.png'/>
-                                            <span><?=$run->shapeshifting?></span>
+                                            <span class='item'><?=$run->shapeshifting?></span>
                                         </div>
 <?php
                                     }

+ 3 - 0
data.sql

@@ -671,6 +671,9 @@ INSERT INTO k_inventory VALUES(5004, 29, 'Crystal of Light', '');
 INSERT INTO k_inventory VALUES(5005, 29, 'Crystal of Dark', '');
 INSERT INTO k_inventory VALUES(6001, 29, 'Crystal of Magic', '');
 INSERT INTO k_inventory VALUES(7001, 29, 'Crystal of Pure', '');
+INSERT INTO k_inventory VALUES(8002, 29, 'Ancient Magic Origin', '');
+INSERT INTO k_inventory VALUES(9002, 27, 'Karzhan''s Rune Ore', '');
+INSERT INTO k_inventory VALUES(8001, 27, 'Ancient Magic Stone', '');
 INSERT INTO k_inventory VALUES(142110115, 61, 'Water Angelmon', '');
 INSERT INTO k_inventory VALUES(142120115, 61, 'Fire Angelmon', '');
 INSERT INTO k_inventory VALUES(142130115, 61, 'Wind Angelmon', '');

+ 6 - 0
public/css/runs.css

@@ -69,6 +69,11 @@ table#runs td.time span.ms{
     font-size: 70%;
 }
 
+table#runs td.time span.defeated{
+    color: #cc0000;
+    text-shadow: 0 0 0.05em #ffffff;
+}
+
 table#runs td.reward div.item{
     display: inline-block;
     width: 1.6em;
@@ -82,6 +87,7 @@ table#runs td.reward div.item{
 table#runs td.reward div.item img.item{
     width: 1.6em;
     height: 1.6em;
+    border-radius: 0.4em;
 }
 
 table#runs td.reward div.item span.item{

+ 1 - 1
public/css/ui.css

@@ -278,7 +278,7 @@ input[type=button], input[type=submit]{
     cursor: pointer;
     box-shadow: 0 0 0.3em #000000;
 }
-input[type=text], input[type=number]{
+input[type=text], input[type=number], input[type=date]{
     font-size: 80%;
     font-weight: bold;
     padding: 0 0.3em;

+ 21 - 20
swex-plugin/swdb.js

@@ -44,11 +44,9 @@ module.exports = {
                     //    this.log('DEBUG', `IVV SCE START: ${key}: ${req[key]}`);
                     //}
                     if (req["helper_list"] != null || req["mentor_helper_list"] != null || req["npc_friend_helper_list"] != null ){
-                        //this.log('DEBUG', `IVV MENTOR 1`);
                         this.temp[wizardID].helper = 1;
                     }
                     else{
-                        //this.log('DEBUG', `IVV MENTOR 0`);
                         this.temp[wizardID].helper = 0;
                     }
                     this.temp[wizardID].area = req.region_id;
@@ -58,12 +56,12 @@ module.exports = {
 
                 if (command === 'BattleScenarioResult' || command === 'BattleDungeonResult' || command === 'BattleDimensionHoleDungeonResult') {
                     //proxy.log({ type: 'info', source: 'plugin', name: this.pluginName, message: `IVV RUN RESULT: ${resp}` })
-                    //for (var key in req) {
-                    //    this.log("info", `IVV REQ: ${key}: ${req[key]}`);
-                    //}
-                    //for (var key in resp) {
-                    //    this.log("info", `IVV RES: ${key}: ${resp[key]}`);
-                    //}
+                    for (var key in req) {
+                        this.log("info", `IVV REQ: ${key}: ${req[key]}`);
+                    }
+                    for (var key in resp) {
+                        this.log("info", `IVV RES: ${key}: ${resp[key]}`);
+                    }
                     this.parse_normal(req, resp);
                 }
 
@@ -122,7 +120,6 @@ module.exports = {
             item = crate.craft_stuff.item_master_id;
             quantity = crate.craft_stuff.item_quantity;
         }
-        //this.log('DEBUG', `Item: ${item}, ${unit}, ${pieces}, ${quantity}, ${shapeshifting}`);
         drop = {item, unit, pieces, quantity, shapeshifting}
         return drop;
     },
@@ -206,9 +203,9 @@ module.exports = {
         log = true;
 
         if (command === 'BattleDungeonResult') {
-            for (var key in req) {
-                this.log("DEBUG", `IVV DUNGEON REQ: ${key}: ${req[key]}`);
-            }
+            //for (var key in req) {
+            //    this.log("DEBUG", `IVV DUNGEON REQ: ${key}: ${req[key]}`);
+            //}
             if (req.dungeon_id > 10000){
                 // Hall of Heroes or unknown
                 log = false;
@@ -237,8 +234,11 @@ module.exports = {
             //if (gMapping.dungeon[resp.dungeon_id]) {
             //    run.dungeon = `${gMapping.dungeon[resp.dungeon_id]} Level ${resp.difficulty}`;
             //}
-            run.area = req.dungeon_id;
-            run.stage = req.stage_id;
+            //for (var key in req) {
+            //    this.log("DEBUG", `IVV DIMENSONALE REQ: ${key}: ${req[key]}`);
+            //}
+            run.area = resp.dungeon_id;
+            run.stage = resp.difficulty;
             run.difficulty = 0
             run.helper = 0;
         }
@@ -271,9 +271,9 @@ module.exports = {
 
             if (reward.crate.rune) {
                 const rune = reward.crate.rune;
-                for (var key in rune) {
-                    this.proxy.log({ type: 'info', source: 'plugin', name: this.pluginName, message: `IVV RUNE: ${key}: ${rune[key]}` })
-                }
+                //for (var key in rune) {
+                //    this.proxy.log({ type: 'info', source: 'plugin', name: this.pluginName, message: `IVV RUNE: ${key}: ${rune[key]}` })
+                //}
                 run.rune.id = rune.rune_id;
                 run.rune.grade = rune.class;
                 run.rune.value = rune.sell_value;
@@ -301,6 +301,9 @@ module.exports = {
                 });
             }
             else {
+                for (var key in reward.crate) {
+                    this.proxy.log({ type: 'info', source: 'plugin', name: this.pluginName, message: `IVV ITEM: ${key}: ${reward.crate[key]}` })
+                }
                 drop = this.getItem(reward.crate);
                 if (drop.unit){
                     run.unit.id = drop.unit;
@@ -356,7 +359,7 @@ module.exports = {
         json_rune = json_rune + "]";
 
         json_item = '[';
-        if (run.item.length > 0){
+        if (run.item.id != undefined){
             json_item += '{';
             json_item += `"id": "${run.item.id}", `;
             json_item += `"quantity": "${run.item.quantity}"`;
@@ -379,8 +382,6 @@ module.exports = {
         });
         json_party = json_party.slice(0, -1) + "]";
 
-        //this.log('DEBUG', `IVV json_party: ${json_party}`)
-
         json = `{`;
         json += `"uid": "${run.uid}", `;
         json += `"dtime": "${run.dtime}", `;