Selaa lähdekoodia

APIv2 updatet to handle grouped rune craft items (game v5.2.6)

Iñigo Valentin 6 vuotta sitten
vanhempi
sitoutus
c3bc912f90
2 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  1. 3 2
      application/API/v2/bin/upload_profile.py
  2. 2 1
      install_data/install_base.sql

+ 3 - 2
application/API/v2/bin/upload_profile.py

@@ -980,17 +980,18 @@ def parseRuneCraft(db, data):
         id = item["craft_item_id"]
         id = item["craft_item_id"]
         type = item["craft_type"]
         type = item["craft_type"]
         value = item["sell_value"]
         value = item["sell_value"]
-        info = str(item["craft_type_id"])
+        amount = str(item["amount"])
         """
         """
         info : 5 or 6 digit number: RRSSQ
         info : 5 or 6 digit number: RRSSQ
           RR: Rune
           RR: Rune
           SS: Stat
           SS: Stat
           Q:  Quality
           Q:  Quality
         """
         """
+        info = str(item["craft_type_id"])
         quality = int(info[-1:])
         quality = int(info[-1:])
         stat = int(info[-4:-2])
         stat = int(info[-4:-2])
         rune = int(info[:-4])
         rune = int(info[:-4])
-        insert(db, "rune_craft", (uid, id, type, quality, rune, stat, value))
+        insert(db, "rune_craft", (uid, id, type, quality, rune, stat, value, amount))
 
 
 """
 """
 Parses guild data (tables guild, guild_member).
 Parses guild data (tables guild, guild_member).

+ 2 - 1
install_data/install_base.sql

@@ -576,7 +576,8 @@ CREATE TABLE k_rune_craft_type(
     name TEXT NOT NULL UNIQUE,
     name TEXT NOT NULL UNIQUE,
     gem INT NOT NULL CHECK(gem IN (1, 0)),
     gem INT NOT NULL CHECK(gem IN (1, 0)),
     inmemorial INT NOT NULL CHECK(inmemorial IN (1, 0)),
     inmemorial INT NOT NULL CHECK(inmemorial IN (1, 0)),
-    ancient INT NOT NULL CHECK(ancient IN (1, 0))
+    ancient INT NOT NULL CHECK(ancient IN (1, 0)),
+    amount INT NOT NULL CHECK(amount > 0)
 );
 );
 INSERT INTO k_rune_craft_type VALUES(1,'Enchant Gem',1,0,0);
 INSERT INTO k_rune_craft_type VALUES(1,'Enchant Gem',1,0,0);
 INSERT INTO k_rune_craft_type VALUES(2,'Grindstone',0,0,0);
 INSERT INTO k_rune_craft_type VALUES(2,'Grindstone',0,0,0);