Kxnrl / Store

Store plugin for Source Engine Games.
https://github.com/Kxnrl/Store
90 stars 46 forks source link

Oudated insertitem.php #153

Open teammate165 opened 4 years ago

teammate165 commented 4 years ago

The 2.3 Pet update has added additional columns, being "idle2", "spawn", "scale"

insertitem.php's SQL Query is missing those columns as well as not extracting the value for those in the above $escape section, here is an example: INSERT IGNORE INTO store_item_child VALUES ((SELECT id FROM store_item_parent WHERE name = '".$escape['parent']."'), '".$escape['type']."', '".$escape['uid']."', ".$escape['buyable'].", ".$escape['giftable'].", ".$escape['only'].", '".$escape['auth']."', ".$escape['vip'].", '".$escape['name']."', '".$escape['lvls']."', '".$escape['desc']."', ".$escape['case'].", ".$escape['compose'].", '".$escape['1d']."', '".$escape['1m']."', '".$escape['pm']."', '".$escape['model']."', '".$escape['arms']."', '".$escape['team']."', '".$escape['sound']."', '".$escape['position']."', '".$escape['angles']."', '".$escape['attachment']."', '".$escape['slot']."', '".$escape['material']."', '".$escape['color']."', '".$escape['grenade']."', '".$escape['shortname']."', '".$escape['volume']."', '".$escape['cooldown']."', '".$escape['worldmodel']."', '".$escape['dropmodel']."', '".$escape['weapon']."', '".$escape['effect']."', '".$escape['brightness']."', '".$escape['distance']."', '".$escape['distancefade']."', '".$escape['tag']."', '".$escape['idle']."', '".$escape['run']."', '".$escape['death']."', '".$escape['seed']."', '".$escape['weart']."', '".$escape['paint']."', '".$escape['wearf']."')";

Resulting in this error when executing script: Insert Failed 1: Column count doesn't match value count at row 1 -> INSERT IGNORE INTO store_item_child VALUES ((SELECT id FROM store_item_parent WHERE name = '受限级'), 'playerskin', 'skin_ninomiya_normal', 1, 1, 0, 'ITEM_NOT_PERSONAL', 0, '二宮飛鳥', '0', '《偶像大师》的中二偶像', 0, 0, '688', '16888', '68888', 'models/player/custom_player/maoling/idolm@ster/ninomiya_asuka/ninomiya.mdl', 'models/player/custom_player/maoling/idolm@ster/ninomiya_asuka/ninomiya_arms.mdl', '3', 'ITEM_NO_SOUND', '0.0 0.0 0.0', '0.0 0.0 0.0', 'ITEM_NO_ATTACHMENT', '0', 'ITEM_NO_MATERIAL', 'ITEM_NO_COLOR', 'ITEM_NO_GRENADE', 'ITEM_NO_SHORTNAME', '1', '60', 'ITEM_NO_WORLDMODEL', 'ITEM_NO_DROPMODEL', 'ITEM_NO_ENTITY', 'ITEM_NO_ID', '5', '150', '50', 'ITEM_NO_TAG', 'ITEM_NO_IDLE', 'ITEM_NO_RUN', 'ITEM_NO_DEATH', '0', '-1', '0', '0')

I also noticed that all entries id column in store_items_child are 0 except for "Buy VIP" which read the correct id from store_items_parent. Could be a result of me incorrectly applying the fix for other categories. I'll double check and respond to this issue later.

teammate165 commented 4 years ago

Additionally, some items aren't being imported using the php script, those are nested in 3 layers deep

"Store"
{
     "Player Accessories"
     {
          "Sound"
          {
                "Overwatch"
                     {
                      Item1
                      Item2
                      Item3
                     }
          }
     }
}

Something like this will result in Item1, Item2, Item3 not being imported the database