diff --git a/data/ava2-itemshop/compatibility.json b/data/ava2-itemshop/compatibility.json new file mode 100644 index 00000000..a25cddf0 --- /dev/null +++ b/data/ava2-itemshop/compatibility.json @@ -0,0 +1,1747 @@ +{ + "source_products": 217, + "all_disabled": true, + "summary": { + "missing_server_prototype": 55, + "requires_gameplay_and_asset_acceptance": 107, + "placeholder_item_none": 55 + }, + "products": [ + { + "id": 1, + "vnum": 71500, + "price": 75, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 2, + "vnum": 71501, + "price": 149, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 3, + "vnum": 71502, + "price": 349, + "type": 28, + "subtype": 2, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 4, + "vnum": 71503, + "price": 75, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 5, + "vnum": 71504, + "price": 149, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 6, + "vnum": 71505, + "price": 349, + "type": 28, + "subtype": 2, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 7, + "vnum": 71506, + "price": 75, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 8, + "vnum": 71507, + "price": 149, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 9, + "vnum": 71508, + "price": 349, + "type": 28, + "subtype": 2, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 10, + "vnum": 71509, + "price": 75, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 11, + "vnum": 71510, + "price": 149, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 12, + "vnum": 71511, + "price": 349, + "type": 28, + "subtype": 2, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 13, + "vnum": 53002, + "price": 75, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 14, + "vnum": 53003, + "price": 149, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 15, + "vnum": 53004, + "price": 349, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 16, + "vnum": 53005, + "price": 75, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 17, + "vnum": 53006, + "price": 149, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 18, + "vnum": 53007, + "price": 349, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 19, + "vnum": 53008, + "price": 75, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 20, + "vnum": 53009, + "price": 149, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 21, + "vnum": 53010, + "price": 349, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 22, + "vnum": 53011, + "price": 75, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 23, + "vnum": 53012, + "price": 149, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 24, + "vnum": 53013, + "price": 349, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 25, + "vnum": 54706, + "price": 69, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 26, + "vnum": 54707, + "price": 69, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 27, + "vnum": 54708, + "price": 99, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 28, + "vnum": 54709, + "price": 69, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 29, + "vnum": 54710, + "price": 49, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 30, + "vnum": 54711, + "price": 39, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 31, + "vnum": 55402, + "price": 140, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 32, + "vnum": 55405, + "price": 140, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 33, + "vnum": 55407, + "price": 140, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 34, + "vnum": 55001, + "price": 15, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 35, + "vnum": 55036, + "price": 20, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 36, + "vnum": 55034, + "price": 39, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 37, + "vnum": 55033, + "price": 90, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 38, + "vnum": 55009, + "price": 10, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 39, + "vnum": 25163, + "price": 2, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 40, + "vnum": 25164, + "price": 4, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 41, + "vnum": 25165, + "price": 5, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 42, + "vnum": 25166, + "price": 6, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 43, + "vnum": 25167, + "price": 8, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 44, + "vnum": 25168, + "price": 8, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 45, + "vnum": 25169, + "price": 10, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 48, + "vnum": 71035, + "price": 4, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 49, + "vnum": 30250, + "price": 10, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 50, + "vnum": 70028, + "price": 90, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 51, + "vnum": 41119, + "price": 99, + "type": 28, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 52, + "vnum": 41120, + "price": 99, + "type": 28, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 53, + "vnum": 41121, + "price": 99, + "type": 28, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 54, + "vnum": 41122, + "price": 99, + "type": 28, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 55, + "vnum": 45005, + "price": 99, + "type": 28, + "subtype": 1, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 56, + "vnum": 45006, + "price": 99, + "type": 28, + "subtype": 1, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 57, + "vnum": 45057, + "price": 99, + "type": 28, + "subtype": 1, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 58, + "vnum": 45058, + "price": 99, + "type": 28, + "subtype": 1, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 59, + "vnum": 40129, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 60, + "vnum": 40130, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 61, + "vnum": 40131, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 62, + "vnum": 40132, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 63, + "vnum": 40133, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 64, + "vnum": 40134, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 65, + "vnum": 40445, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 66, + "vnum": 40446, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 67, + "vnum": 40447, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 68, + "vnum": 40448, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 69, + "vnum": 40449, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 70, + "vnum": 40450, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 71, + "vnum": 72319, + "price": 4, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 72, + "vnum": 72320, + "price": 2, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 73, + "vnum": 53998, + "price": 39, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 74, + "vnum": 53999, + "price": 69, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 75, + "vnum": 71097, + "price": 39, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 76, + "vnum": 85009, + "price": 40, + "type": 3, + "subtype": 14, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 77, + "vnum": 71153, + "price": 19, + "type": 3, + "subtype": 8, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 78, + "vnum": 54003, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 79, + "vnum": 54006, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 80, + "vnum": 54009, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 81, + "vnum": 54012, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 82, + "vnum": 54015, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 83, + "vnum": 54018, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 84, + "vnum": 54021, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 85, + "vnum": 54024, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 86, + "vnum": 54027, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 87, + "vnum": 54030, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 88, + "vnum": 54033, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 89, + "vnum": 54036, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 90, + "vnum": 54039, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 91, + "vnum": 54042, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 92, + "vnum": 54045, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 93, + "vnum": 54048, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 94, + "vnum": 54051, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 95, + "vnum": 54054, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 96, + "vnum": 54057, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 97, + "vnum": 54060, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 98, + "vnum": 54063, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 99, + "vnum": 54066, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 100, + "vnum": 54069, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 101, + "vnum": 54072, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 102, + "vnum": 54075, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 103, + "vnum": 54078, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 104, + "vnum": 54081, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 105, + "vnum": 54084, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 106, + "vnum": 54087, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 107, + "vnum": 54090, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 108, + "vnum": 54093, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 109, + "vnum": 54096, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 110, + "vnum": 54099, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 111, + "vnum": 54102, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 112, + "vnum": 54105, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 113, + "vnum": 54108, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 114, + "vnum": 54111, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 115, + "vnum": 54114, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 116, + "vnum": 54117, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 117, + "vnum": 54120, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 118, + "vnum": 54123, + "price": 60, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 123, + "vnum": 54712, + "price": 349, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 124, + "vnum": 54713, + "price": 120, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 125, + "vnum": 54714, + "price": 549, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 126, + "vnum": 54715, + "price": 49, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 127, + "vnum": 54716, + "price": 79, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 128, + "vnum": 54717, + "price": 159, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 129, + "vnum": 86004, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 130, + "vnum": 86008, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 131, + "vnum": 86014, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 132, + "vnum": 86018, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 133, + "vnum": 86024, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 134, + "vnum": 86028, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 135, + "vnum": 86034, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 136, + "vnum": 86038, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 137, + "vnum": 86044, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 138, + "vnum": 86048, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 139, + "vnum": 86054, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 140, + "vnum": 86058, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 141, + "vnum": 71221, + "price": 39, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 142, + "vnum": 55008, + "price": 49, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 143, + "vnum": 55035, + "price": 9, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 144, + "vnum": 100001, + "price": 9, + "type": 3, + "subtype": 27, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 145, + "vnum": 100002, + "price": 17, + "type": 3, + "subtype": 28, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 146, + "vnum": 77913, + "price": 69, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 147, + "vnum": 77914, + "price": 299, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 148, + "vnum": 77915, + "price": 549, + "type": 23, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 149, + "vnum": 100500, + "price": 4, + "type": 5, + "subtype": 7, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 150, + "vnum": 6884, + "price": 8, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 153, + "vnum": 70043, + "price": 10, + "type": 16, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 154, + "vnum": 72067, + "price": 5, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 155, + "vnum": 72068, + "price": 49, + "type": 18, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 170, + "vnum": 70002, + "price": 99, + "type": 3, + "subtype": 10, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 171, + "vnum": 71233, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 172, + "vnum": 71234, + "price": 99, + "type": 28, + "subtype": 4, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 173, + "vnum": 71235, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 174, + "vnum": 71236, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 175, + "vnum": 71249, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 176, + "vnum": 71248, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 177, + "vnum": 71254, + "price": 99, + "type": 28, + "subtype": 4, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 178, + "vnum": 71255, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 179, + "vnum": 71246, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 180, + "vnum": 71247, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 181, + "vnum": 71252, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 182, + "vnum": 71253, + "price": 99, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 183, + "vnum": 54126, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 184, + "vnum": 54129, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 185, + "vnum": 54132, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 186, + "vnum": 54135, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 187, + "vnum": 54138, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 188, + "vnum": 54141, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 189, + "vnum": 54144, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 190, + "vnum": 54147, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 191, + "vnum": 54150, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 192, + "vnum": 54153, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 193, + "vnum": 54156, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 194, + "vnum": 54159, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 195, + "vnum": 54162, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 197, + "vnum": 54168, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 198, + "vnum": 54171, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 199, + "vnum": 54174, + "price": 60, + "type": 3, + "subtype": 18, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 200, + "vnum": 71230, + "price": 149, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 201, + "vnum": 55406, + "price": 149, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 202, + "vnum": 54177, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 203, + "vnum": 54180, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 204, + "vnum": 54183, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 205, + "vnum": 54186, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 206, + "vnum": 54189, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 207, + "vnum": 54192, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 208, + "vnum": 54195, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 209, + "vnum": 54198, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 210, + "vnum": 54201, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 211, + "vnum": 54204, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 212, + "vnum": 54207, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 213, + "vnum": 54210, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 214, + "vnum": 54213, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 215, + "vnum": 54216, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 216, + "vnum": 54219, + "price": 50, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 217, + "vnum": 54222, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 218, + "vnum": 54225, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 219, + "vnum": 54228, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 220, + "vnum": 54231, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 221, + "vnum": 54234, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 222, + "vnum": 54237, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 223, + "vnum": 54240, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 224, + "vnum": 54243, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 225, + "vnum": 54246, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 226, + "vnum": 54249, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 227, + "vnum": 54252, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 228, + "vnum": 54255, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 229, + "vnum": 54258, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 230, + "vnum": 54261, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 231, + "vnum": 54264, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 232, + "vnum": 54267, + "price": 45, + "type": 0, + "subtype": 0, + "reason": "placeholder_item_none" + }, + { + "id": 233, + "vnum": 39063, + "price": 19, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 234, + "vnum": 39064, + "price": 19, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 235, + "vnum": 71136, + "price": 29, + "type": 16, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 236, + "vnum": 25159, + "price": 149, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 237, + "vnum": 20059, + "price": 149, + "type": -1, + "subtype": -1, + "reason": "missing_server_prototype" + }, + { + "id": 240, + "vnum": 77921, + "price": 1, + "type": 21, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 241, + "vnum": 77922, + "price": 2, + "type": 21, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + }, + { + "id": 242, + "vnum": 77923, + "price": 5, + "type": 21, + "subtype": 0, + "reason": "requires_gameplay_and_asset_acceptance" + } + ] +} diff --git a/data/ava2-itemshop/original-products.tsv b/data/ava2-itemshop/original-products.tsv new file mode 100644 index 00000000..1590e4c4 --- /dev/null +++ b/data/ava2-itemshop/original-products.tsv @@ -0,0 +1,217 @@ +1 3 0 71500 75 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +2 3 0 71501 149 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +3 3 0 71502 349 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +4 3 0 71503 75 0 0000-00-00 00:00:00 0000-00-00 00:00:00 3 0 0 -1 +5 3 0 71504 149 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +6 3 0 71505 349 0 0000-00-00 00:00:00 0000-00-00 00:00:00 7 0 0 -1 +7 3 0 71506 75 0 0000-00-00 00:00:00 0000-00-00 00:00:00 5 0 0 -1 +8 3 0 71507 149 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4 0 0 -1 +9 3 0 71508 349 0 0000-00-00 00:00:00 0000-00-00 00:00:00 12 0 0 -1 +10 3 0 71509 75 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +11 3 0 71510 149 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +12 3 0 71511 349 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4 0 0 -1 +13 3 2 53002 75 0 0000-00-00 00:00:00 0000-00-00 00:00:00 5 0 0 -1 +14 3 2 53003 149 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +15 3 2 53004 349 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +16 3 2 53005 75 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +17 3 2 53006 149 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +18 3 2 53007 349 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +19 3 2 53008 75 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4 0 0 -1 +20 3 2 53009 149 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +21 3 2 53010 349 0 0000-00-00 00:00:00 0000-00-00 00:00:00 9 0 0 -1 +22 3 2 53011 75 0 0000-00-00 00:00:00 0000-00-00 00:00:00 3 0 0 -1 +23 3 2 53012 149 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +24 3 2 53013 349 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +25 7 0 54706 69 0 0000-00-00 00:00:00 0000-00-00 00:00:00 12 0 0 -1 +26 7 0 54707 69 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +27 7 0 54708 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 38 0 0 -1 +28 7 0 54709 69 0 0000-00-00 00:00:00 0000-00-00 00:00:00 65 0 0 -1 +29 7 0 54710 49 0 0000-00-00 00:00:00 0000-00-00 00:00:00 29 0 0 -1 +30 7 0 54711 39 0 0000-00-00 00:00:00 0000-00-00 00:00:00 12 0 0 -1 +31 3 1 55402 140 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +32 3 1 55405 140 0 0000-00-00 00:00:00 0000-00-00 00:00:00 7 0 0 -1 +33 3 1 55407 140 0 0000-00-00 00:00:00 0000-00-00 00:00:00 5 0 0 -1 +34 1 0 55001 15 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +35 1 0 55036 20 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4 0 0 -1 +36 1 0 55034 39 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +37 1 0 55033 90 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +38 1 0 55009 10 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +39 4 0 25163 2 0 0000-00-00 00:00:00 0000-00-00 00:00:00 11 0 0 -1 +40 4 0 25164 4 0 0000-00-00 00:00:00 0000-00-00 00:00:00 11 0 0 -1 +41 4 0 25165 5 0 0000-00-00 00:00:00 0000-00-00 00:00:00 3 0 0 -1 +42 4 0 25166 6 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +43 4 0 25167 8 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +44 4 0 25168 8 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +45 4 0 25169 10 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +48 1 0 71035 4 0 0000-00-00 00:00:00 0000-00-00 00:00:00 6 0 0 -1 +49 1 0 30250 10 0 0000-00-00 00:00:00 0000-00-00 00:00:00 3 0 0 -1 +50 1 0 70028 90 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +51 2 1 41119 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +52 2 1 41120 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +53 2 1 41121 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4 0 0 -1 +54 2 1 41122 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +55 2 2 45005 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 3 0 0 -1 +56 2 2 45006 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +57 2 2 45057 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 6 0 0 -1 +58 2 2 45058 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +59 2 0 40129 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4 0 0 -1 +60 2 0 40130 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +61 2 0 40131 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +62 2 0 40132 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 5 0 0 -1 +63 2 0 40133 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +64 2 0 40134 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +65 2 0 40445 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 13 0 0 -1 +66 2 0 40446 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +67 2 0 40447 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +68 2 0 40448 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 6 0 0 -1 +69 2 0 40449 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +70 2 0 40450 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +71 1 0 72319 4 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +72 1 0 72320 2 0 0000-00-00 00:00:00 0000-00-00 00:00:00 7 0 0 -1 +73 1 0 53998 39 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +74 1 0 53999 69 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +75 6 0 71097 39 0 0000-00-00 00:00:00 0000-00-00 00:00:00 3 0 0 -1 +76 1 0 85009 40 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +77 1 0 71153 19 0 0000-00-00 00:00:00 0000-00-00 00:00:00 48 0 0 -1 +78 5 1 54003 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 9 0 0 -1 +79 5 1 54006 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +80 5 1 54009 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +81 5 1 54012 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +82 5 1 54015 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 6 0 0 -1 +83 5 1 54018 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +84 5 1 54021 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 11 0 0 -1 +85 5 1 54024 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 7 0 0 -1 +86 5 1 54027 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 3 0 0 -1 +87 5 2 54030 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +88 5 2 54033 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +89 5 2 54036 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +90 5 2 54039 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +91 5 2 54042 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +92 5 2 54045 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +93 5 2 54048 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +94 5 2 54051 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +95 5 2 54054 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 3 0 0 -1 +96 5 2 54057 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +97 5 2 54060 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +98 5 2 54063 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +99 5 2 54066 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +100 5 2 54069 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 11 0 0 -1 +101 5 2 54072 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +102 5 2 54075 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 11 0 0 -1 +103 5 2 54078 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 12 0 0 -1 +104 5 0 54081 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +105 5 0 54084 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +106 5 0 54087 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +107 5 0 54090 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +108 5 0 54093 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +109 5 0 54096 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +110 5 0 54099 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +111 5 0 54102 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 6 0 0 -1 +112 5 0 54105 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +113 5 0 54108 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +114 5 0 54111 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +115 5 0 54114 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 17 0 0 -1 +116 5 0 54117 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 33 0 0 -1 +117 5 0 54120 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 12 0 0 -1 +118 5 0 54123 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 27 0 0 -1 +123 0 1 54712 349 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4 0 0 -1 +124 0 1 54713 120 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +125 0 1 54714 549 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +126 0 1 54715 49 0 0000-00-00 00:00:00 0000-00-00 00:00:00 19 0 0 -1 +127 0 1 54716 79 0 0000-00-00 00:00:00 0000-00-00 00:00:00 3 0 0 -1 +128 0 1 54717 159 0 0000-00-00 00:00:00 0000-00-00 00:00:00 13 0 0 -1 +129 2 3 86004 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +130 2 3 86008 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 3 0 0 -1 +131 2 3 86014 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +132 2 3 86018 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +133 2 3 86024 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +134 2 3 86028 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +135 2 3 86034 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +136 2 3 86038 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +137 2 3 86044 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +138 2 3 86048 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +139 2 3 86054 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +140 2 3 86058 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +141 1 0 71221 39 0 2022-05-27 23:59:00 0000-00-00 00:00:00 0 0 0 -1 +142 1 0 55008 49 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +143 1 0 55035 9 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +144 6 0 100001 9 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +145 6 0 100002 17 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +146 6 0 77913 69 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +147 6 0 77914 299 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +148 6 0 77915 549 0 0000-00-00 00:00:00 0000-00-00 00:00:00 5 0 0 -1 +149 6 0 100500 4 0 0000-00-00 00:00:00 0000-00-00 00:00:00 5 0 0 -1 +150 1 0 6884 8 0 0000-00-00 00:00:00 0000-00-00 00:00:00 534 0 0 -1 +153 1 0 70043 10 0 0000-00-00 00:00:00 0000-00-00 00:00:00 39 0 0 -1 +154 1 0 72067 5 0 0000-00-00 00:00:00 0000-00-00 00:00:00 6 0 0 -1 +155 1 0 72068 49 0 0000-00-00 00:00:00 0000-00-00 00:00:00 5 0 0 -1 +170 1 0 70002 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 12 0 0 -1 +171 2 4 71233 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +172 2 4 71234 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +173 2 4 71235 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +174 2 4 71236 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +175 2 4 71249 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +176 2 4 71248 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +177 2 4 71254 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +178 2 4 71255 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +179 2 4 71246 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +180 2 4 71247 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +181 2 4 71252 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +182 2 4 71253 99 0 0000-00-00 00:00:00 0000-00-00 00:00:00 3 0 0 -1 +183 5 3 54126 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +184 5 3 54129 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +185 5 3 54132 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +186 5 3 54135 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +187 5 3 54138 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +188 5 3 54141 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +189 5 3 54144 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +190 5 3 54147 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +191 5 3 54150 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +192 5 3 54153 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +193 5 3 54156 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 13 0 0 -1 +194 5 3 54159 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 16 0 0 -1 +195 5 3 54162 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 19 0 0 -1 +197 5 3 54168 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4 0 0 -1 +198 5 3 54171 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +199 5 3 54174 60 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4 0 0 -1 +200 0 2 71230 149 0 2022-09-30 23:59:00 0000-00-00 00:00:00 7 0 0 -1 +201 0 2 55406 149 0 2022-09-30 23:59:00 0000-00-00 00:00:00 8 0 0 -1 +202 5 4 54177 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4 0 0 -1 +203 5 4 54180 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 11 0 0 -1 +204 5 4 54183 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 13 0 0 -1 +205 5 4 54186 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +206 5 4 54189 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +207 5 4 54192 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +208 5 4 54195 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +209 5 4 54198 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +210 5 4 54201 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +211 5 4 54204 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +212 5 4 54207 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +213 5 4 54210 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +214 5 4 54213 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +215 5 4 54216 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 10 0 0 -1 +216 5 4 54219 50 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +217 5 5 54222 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +218 5 5 54225 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +219 5 5 54228 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4 0 0 -1 +220 5 5 54231 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +221 5 5 54234 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +222 5 5 54237 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +223 5 5 54240 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +224 5 5 54243 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 0 0 -1 +225 5 5 54246 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +226 5 5 54249 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +227 5 5 54252 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 3 0 0 -1 +228 5 5 54255 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +229 5 5 54258 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +230 5 5 54261 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +231 5 5 54264 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +232 5 5 54267 45 0 0000-00-00 00:00:00 0000-00-00 00:00:00 2 0 0 -1 +233 1 0 39063 19 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +234 1 0 39064 19 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +235 1 0 71136 29 0 0000-00-00 00:00:00 0000-00-00 00:00:00 12 0 0 -1 +236 0 0 25159 149 0 2022-10-25 23:59:59 0000-00-00 00:00:00 0 0 0 -1 +237 0 0 20059 149 0 2022-10-31 23:59:59 0000-00-00 00:00:00 0 0 0 -1 +240 1 0 77921 1 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +241 1 0 77922 2 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 +242 1 0 77923 5 0 0000-00-00 00:00:00 0000-00-00 00:00:00 0 0 0 -1 diff --git a/data/ava2-itemshop/source.json b/data/ava2-itemshop/source.json new file mode 100644 index 00000000..26cdc434 --- /dev/null +++ b/data/ava2-itemshop/source.json @@ -0,0 +1,8 @@ +{ + "source_archive": "AVA2/2. Backup SF+SRC and SQL/MYSQL56.tgz", + "archive_sha256": "0a578f4036fff69c36d0ad0d4d6692d267284be10689105a173ac30337ec0787", + "source_table": "player.ishop_data", + "format": "native MyISAM recovered in isolated reference schema; sorted by id; dates preserved", + "rows": 217, + "tsv_sha256": "7e2fc0ccb630168b0466d097eaa9b41858df1ea0e67ab7b7fad2ba17fc975276" +} diff --git a/data/ava2-itemshop/verified-products.json b/data/ava2-itemshop/verified-products.json new file mode 100644 index 00000000..10368965 --- /dev/null +++ b/data/ava2-itemshop/verified-products.json @@ -0,0 +1,300 @@ +{ + "count": 49, + "scope": "Existing implemented item systems only. Does not authorize production deployment.", + "products": [ + { + "id": 3, + "vnum": 71502, + "original_price": 349, + "basis": "ported mount costume and mount skin; game/src/port_mount.cpp, client MountScript and staged model resources" + }, + { + "id": 6, + "vnum": 71505, + "original_price": 349, + "basis": "ported mount costume and mount skin; game/src/port_mount.cpp, client MountScript and staged model resources" + }, + { + "id": 9, + "vnum": 71508, + "original_price": 349, + "basis": "ported mount costume and mount skin; game/src/port_mount.cpp, client MountScript and staged model resources" + }, + { + "id": 12, + "vnum": 71511, + "original_price": 349, + "basis": "ported mount costume and mount skin; game/src/port_mount.cpp, client MountScript and staged model resources" + }, + { + "id": 78, + "vnum": 54003, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 79, + "vnum": 54006, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 80, + "vnum": 54009, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 81, + "vnum": 54012, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 82, + "vnum": 54015, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 83, + "vnum": 54018, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 84, + "vnum": 54021, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 85, + "vnum": 54024, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 86, + "vnum": 54027, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 87, + "vnum": 54030, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 88, + "vnum": 54033, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 89, + "vnum": 54036, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 90, + "vnum": 54039, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 91, + "vnum": 54042, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 92, + "vnum": 54045, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 93, + "vnum": 54048, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 94, + "vnum": 54051, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 95, + "vnum": 54054, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 96, + "vnum": 54057, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 97, + "vnum": 54060, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 98, + "vnum": 54063, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 99, + "vnum": 54066, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 100, + "vnum": 54069, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 101, + "vnum": 54072, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 102, + "vnum": 54075, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 103, + "vnum": 54078, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 170, + "vnum": 70002, + "original_price": 99, + "basis": "AVA2 third-hand pickup status; docs/AVA2-CHEST-PICKUP.md in metin2-client" + }, + { + "id": 172, + "vnum": 71234, + "original_price": 99, + "basis": "ported mount costume and mount skin; game/src/port_mount.cpp, client MountScript and staged model resources" + }, + { + "id": 177, + "vnum": 71254, + "original_price": 99, + "basis": "ported mount costume and mount skin; game/src/port_mount.cpp, client MountScript and staged model resources" + }, + { + "id": 183, + "vnum": 54126, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 184, + "vnum": 54129, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 185, + "vnum": 54132, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 186, + "vnum": 54135, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 187, + "vnum": 54138, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 188, + "vnum": 54141, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 189, + "vnum": 54144, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 190, + "vnum": 54147, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 191, + "vnum": 54150, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 192, + "vnum": 54153, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 193, + "vnum": 54156, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 194, + "vnum": 54159, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 195, + "vnum": 54162, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 197, + "vnum": 54168, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 198, + "vnum": 54171, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + }, + { + "id": 199, + "vnum": 54174, + "original_price": 60, + "basis": "ported body/hair/mount-skin fixed enchants; game/src/port_costume_attr.cpp and make_items.ENCHANT_KEEP" + } + ] +} diff --git a/src/server/common/ava2_itemshop.h b/src/server/common/ava2_itemshop.h new file mode 100644 index 00000000..55c197ec --- /dev/null +++ b/src/server/common/ava2_itemshop.h @@ -0,0 +1,24 @@ +#pragma once +#include +#pragma pack(push,1) +struct Ava2ShopRequest { + uint8_t operation; uint32_t account,player,product,count,expectedVnum; int64_t expectedTotal; char token[33],name[25],ip[16]; +}; +struct Ava2ShopReply { uint32_t account,player,size; }; +struct Ava2ShopProduct { + uint32_t id,vnum; int64_t price; int32_t top; uint8_t discount; + int32_t expiry,added; int64_t sold; int32_t weekly,monthly,stock; +}; +struct Ava2ShopLog { + uint32_t account; char name[25],date[21]; int32_t time; char ip[16]; + uint32_t product,vnum; int32_t count; int64_t price; +}; +#pragma pack(pop) +static_assert(sizeof(Ava2ShopRequest)==103,"itemshop request"); +static_assert(sizeof(Ava2ShopProduct)==49,"native TIShopData"); +static_assert(sizeof(Ava2ShopLog)==90,"native TIShopLogData"); + +inline bool Ava2ShopTotal(int64_t unit,uint32_t count,uint8_t discount,int64_t& total) { + if(unit<0 || unit>1000000000000LL || count<1 || count>20 || discount>100)return false; + total=unit*int64_t(count)*(100-discount)/100;return true; +} diff --git a/src/server/db/src/Ava2ItemShop.cpp b/src/server/db/src/Ava2ItemShop.cpp new file mode 100644 index 00000000..6eec2a8a --- /dev/null +++ b/src/server/db/src/Ava2ItemShop.cpp @@ -0,0 +1,162 @@ +// AVA2 GC93 catalogue with transactional, replay-safe purchases. +#include "stdafx.h" +#include "ClientManager.h" +#include "Config.h" +#include "DBManager.h" +#include "ItemAwardManager.h" +#include "../../common/ava2_itemshop.h" +#include +#include +#include +#include +namespace { +using Query=std::unique_ptr; +Query query(const std::string& sql) { return Query(CDBManager::instance().DirectQuery(sql.c_str(),SQL_PLAYER)); } +bool ok(const Query& q) { return q && !q->uiSQLErrno && q->Get(); } +bool run(const std::string& sql) { auto q=query(sql);return ok(q); } +std::string decimal(uint64_t n) { return std::to_string(n); } +std::string escape(const char* text) { char out[513];size_t n=strnlen(text,255);CDBManager::instance().EscapeString(out,text,n);return std::string(out); } +std::string accountDB() { + char a[257]={},p[257]={}; + if (!CConfig::instance().GetValue("SQL_ACCOUNT",a,256) || !CConfig::instance().GetValue("SQL_PLAYER",p,256)) return ""; + std::string ah,ad,au,ap,ph,pd,pu,pp;int aport=3306,pport=3306; + std::istringstream as(a),ps(p);as>>ah>>ad>>au>>ap>>aport;ps>>ph>>pd>>pu>>pp>>pport; + if (ah!=ph || aport!=pport || ad.empty()) return ""; // One MySQL connection must own the whole transaction. + for (auto c:ad) if (!std::isalnum(static_cast(c)) && c!='_') return ""; + return "`"+ad+"`"; +} +bool transactional(const std::string& account) { + auto q=query("SELECT COUNT(*) FROM information_schema.tables WHERE ENGINE='InnoDB' AND ((TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('ishop_data','port_itemshop_orders','item_award')) OR (TABLE_SCHEMA='"+account.substr(1,account.size()-2)+"' AND TABLE_NAME='account'))"); + if (!ok(q) || !q->Get()->uiNumRows)return false; + return atoi(mysql_fetch_row(q->Get()->pSQLResult)[0])==4; +} +struct Transaction { + bool active; MYSQL* connection; unsigned previousTimeout; + Transaction():active(false),connection(CDBManager::instance().DirectHandle(SQL_PLAYER)),previousTimeout(50) { + // A reconnect inside a transaction would silently resume subsequent statements in autocommit. + my_bool reconnect=false;mysql_options(connection,MYSQL_OPT_RECONNECT,&reconnect); + auto settings=query("SELECT @@session.innodb_lock_wait_timeout"); + if(!ok(settings) || settings->Get()->uiNumRows!=1)return; + previousTimeout=strtoul(mysql_fetch_row(settings->Get()->pSQLResult)[0],0,10); + active=run("SET SESSION innodb_lock_wait_timeout=3") && run("START TRANSACTION"); + } + ~Transaction(){ + if(mysql_errno(connection)!=CR_SERVER_LOST && mysql_errno(connection)!=CR_SERVER_GONE_ERROR) { + if(active)run("ROLLBACK"); + if(mysql_errno(connection)!=CR_SERVER_LOST && mysql_errno(connection)!=CR_SERVER_GONE_ERROR) + run("SET SESSION innodb_lock_wait_timeout="+decimal(previousTimeout)); + } + my_bool reconnect=true;mysql_options(connection,MYSQL_OPT_RECONNECT,&reconnect); + } + bool commit(){if(!active || !run("COMMIT"))return false;active=false;return true;} +}; +templatevoid append(std::vector& out,const T& value){const char* p=reinterpret_cast(&value);out.insert(out.end(),p,p+sizeof(value));} +void reply(CPeer* peer,DWORD handle,const Ava2ShopRequest& request,const std::vector& out) { + if (out.empty() || out.size()>32763)return; + Ava2ShopReply h={request.account,request.player,uint32_t(out.size())}; + peer->EncodeHeader(76,handle,sizeof(h)+out.size());peer->Encode(&h,sizeof(h));peer->Encode(out.data(),out.size()); +} +Ava2ShopProduct product(MYSQL_ROW r) { + Ava2ShopProduct p={};p.id=strtoul(r[0],0,10);p.vnum=strtoul(r[1],0,10);p.price=strtoll(r[2],0,10);p.discount=atoi(r[3]);p.expiry=atoi(r[4]);p.added=atoi(r[5]);p.sold=strtoll(r[6],0,10);p.weekly=atoi(r[7]);p.monthly=atoi(r[8]);p.stock=atoi(r[9]);return p; +} +const char* fields="id,itemVnum,itemPrice,discount,IFNULL(UNIX_TIMESTAMP(offerTime),0),IFNULL(UNIX_TIMESTAMP(addedTime),0),sellCount,week_limit,month_limit,maxSellCount"; +bool valid(const Ava2ShopProduct& p) {return p.id && p.vnum && p.price>=0 && p.price<=1000000000000LL && p.discount<=100 && p.weekly>=0 && p.monthly>=0 && p.stock>=-1;} +} +void CClientManager::Ava2ItemShop(CPeer* peer,DWORD handle,const char* data,DWORD length) { + if (length!=sizeof(Ava2ShopRequest))return; + Ava2ShopRequest r;memcpy(&r,data,sizeof(r)); + if (r.operation>2 || !r.account || !r.player || r.token[32] || r.name[24] || r.ip[15])return; + auto login=GetLoginDataByAID(r.account); + if (!login || !login->IsPlay() || login->GetConnectedPeerHandle()!=peer->GetHandle())return; + bool owned=false;for (const auto& p:login->GetAccountRef().players)if(p.dwID==r.player)owned=true; + if(!owned)return; + std::vector out; + const std::string adb=accountDB(),aid=decimal(r.account); + int64_t balance=0; + auto wallet=adb.empty()?Query():query("SELECT coins FROM "+adb+".account WHERE id="+aid); + if(!ok(wallet) || wallet->Get()->uiNumRows!=1) { + append(out,uint8_t(8));reply(peer,handle,r,out);return; + } + balance=strtoll(mysql_fetch_row(wallet->Get()->pSQLResult)[0],0,10); + if(r.operation==0) { + auto rows=query(std::string("SELECT ")+fields+",categoryType,categorySubType FROM ishop_data WHERE enabled=1 ORDER BY categoryType,categorySubType,id LIMIT 511"); + if (!ok(rows) || rows->Get()->uiNumRows>510) {append(out,uint8_t(8));reply(peer,handle,r,out);return;} + std::map>> catalogue; + MYSQL_ROW row; + while((row=mysql_fetch_row(rows->Get()->pSQLResult))) { + auto p=product(row);int cat=atoi(row[10]),sub=atoi(row[11]); + if(!valid(p) || cat<0 || cat>7 || sub<0 || sub>9 || (!m_map_itemTableByVnum.count(p.vnum) || m_map_itemTableByVnum.at(p.vnum)->bType==ITEM_NONE))continue; + catalogue[cat][sub].push_back(p); + } + std::vector ranked; + for(auto& cat:catalogue)for(auto& sub:cat.second)for(auto& p:sub.second)ranked.push_back(&p); + std::sort(ranked.begin(),ranked.end(),[](const Ava2ShopProduct* a,const Ava2ShopProduct* b){return a->sold!=b->sold?a->sold>b->sold:a->idid;}); + for(size_t i=0;itop=int32_t(i+1); + append(out,uint8_t(0));append(out,balance);append(out,int32_t(time(0)));append(out,int32_t(catalogue.size())); + for (auto& cat:catalogue) { + append(out,cat.first);append(out,uint8_t(cat.second.size())); + for(auto& sub:cat.second) { + if(sub.second.size()>255){out.clear();append(out,uint8_t(8));reply(peer,handle,r,out);return;} + append(out,sub.first);append(out,uint8_t(sub.second.size()));for(auto& p:sub.second)append(out,p); + } + } + } else if(r.operation==1) { + auto rows=query("SELECT player_name,created_at,UNIX_TIMESTAMP(created_at),ip,product,vnum,quantity,paid FROM port_itemshop_orders WHERE account_id="+aid+" ORDER BY id DESC LIMIT 100"); + if(!ok(rows)){append(out,uint8_t(8));reply(peer,handle,r,out);return;} + append(out,uint8_t(1));append(out,int32_t(rows->Get()->uiNumRows));MYSQL_ROW row; + while((row=mysql_fetch_row(rows->Get()->pSQLResult))) { + Ava2ShopLog log={};log.account=r.account;strlcpy(log.name,row[0],sizeof(log.name));strlcpy(log.date,row[1],sizeof(log.date));log.time=atoi(row[2]);strlcpy(log.ip,row[3],sizeof(log.ip));log.product=strtoul(row[4],0,10);log.vnum=strtoul(row[5],0,10);log.count=atoi(row[6]);log.price=strtoll(row[7],0,10);append(out,log); + } + } else { + if (r.count<1 || r.count>20 || strlen(r.token)!=32)return; + for(char c:std::string(r.token))if(!std::isxdigit(static_cast(c)))return; + uint8_t status=6; // unavailable; errors always leave balance/stock/awards untouched + if(transactional(adb)) { + Transaction tx; + if(tx.active) { + auto locked=query("SELECT coins FROM "+adb+".account WHERE id="+aid+" FOR UPDATE"); + if(ok(locked) && locked->Get()->uiNumRows==1) { + balance=strtoll(mysql_fetch_row(locked->Get()->pSQLResult)[0],0,10); + auto previous=query("SELECT product,quantity,paid,vnum FROM port_itemshop_orders WHERE account_id="+aid+" AND token='"+r.token+"'"); + if(ok(previous) && previous->Get()->uiNumRows) { + auto row=mysql_fetch_row(previous->Get()->pSQLResult); + status=(strtoul(row[0],0,10)==r.product && strtoul(row[1],0,10)==r.count && strtoll(row[2],0,10)==r.expectedTotal && strtoul(row[3],0,10)==r.expectedVnum)?0:7; + } else if(ok(previous)) { + auto rows=query(std::string("SELECT ")+fields+" FROM ishop_data WHERE enabled=1 AND id="+decimal(r.product)+" FOR UPDATE"); + if(ok(rows) && rows->Get()->uiNumRows==1) { + auto p=product(mysql_fetch_row(rows->Get()->pSQLResult)); + auto proto=m_map_itemTableByVnum.find(p.vnum); + if(valid(p) && proto!=m_map_itemTableByVnum.end() && proto->second->bType!=ITEM_NONE) { + int64_t price=0;Ava2ShopTotal(p.price,r.count,p.discount,price); + status=0; + if(price!=r.expectedTotal || p.vnum!=r.expectedVnum)status=9; + else if(balance=0 && uint32_t(p.stock)p.expiry)status=5; + if(!status && (p.weekly || p.monthly)) { + auto limits=query("SELECT IFNULL(SUM(IF(created_at>=DATE_SUB(CURDATE(),INTERVAL WEEKDAY(CURDATE()) DAY),quantity,0)),0),IFNULL(SUM(quantity),0) FROM port_itemshop_orders WHERE account_id="+aid+" AND product="+decimal(p.id)+" AND created_at>=DATE_FORMAT(NOW(),'%Y-%m-01')-INTERVAL 7 DAY"); + // Month and week are computed independently across month boundaries. + auto month=query("SELECT IFNULL(SUM(quantity),0) FROM port_itemshop_orders WHERE account_id="+aid+" AND product="+decimal(p.id)+" AND created_at>=DATE_FORMAT(NOW(),'%Y-%m-01')"); + if(!ok(limits)||!ok(month))status=6; + else {auto a=mysql_fetch_row(limits->Get()->pSQLResult);auto b=mysql_fetch_row(month->Get()->pSQLResult);if(p.weekly && strtoull(a[0],0,10)+r.count>uint64_t(p.weekly))status=2;else if(p.monthly && strtoull(b[0],0,10)+r.count>uint64_t(p.monthly))status=3;} + } + if(!status) { + bool success=run("UPDATE "+adb+".account SET coins=coins-"+decimal(price)+" WHERE id="+aid) && run("UPDATE ishop_data SET sellCount=sellCount+"+decimal(r.count)+",maxSellCount=IF(maxSellCount<0,-1,maxSellCount-"+decimal(r.count)+") WHERE id="+decimal(p.id)); + success=success && run("INSERT INTO port_itemshop_orders(account_id,token,product,vnum,quantity,paid,player_name,ip) VALUES("+aid+",'"+r.token+"',"+decimal(p.id)+","+decimal(p.vnum)+","+decimal(r.count)+","+decimal(price)+",'"+escape(r.name)+"','"+escape(login->GetIP())+"')"); + const bool stackable=(proto->second->dwFlags&ITEM_FLAG_STACKABLE)!=0; + for(uint32_t left=r.count;success && left;) { + uint32_t count=stackable?left:1;left-=count; + success=run("INSERT INTO item_award(login,vnum,count,mall,why,given_time) VALUES('"+escape(login->GetAccountRef().login)+"',"+decimal(p.vnum)+","+decimal(count)+",1,'ISHOP:"+r.token+"',NOW())"); + } + if(success){if(tx.commit())balance-=price;else status=8;}else status=6; + } + } + } + } + } + } + } + append(out,uint8_t(7));out.insert(out.end(),r.token,r.token+32);append(out,status);append(out,balance); + } + reply(peer,handle,r,out); +} diff --git a/src/server/db/src/ClientManager.cpp b/src/server/db/src/ClientManager.cpp index ba89ed7b..351a04f6 100755 --- a/src/server/db/src/ClientManager.cpp +++ b/src/server/db/src/ClientManager.cpp @@ -2327,7 +2327,9 @@ void CClientManager::ProcessPackets(CPeer * peer) switch (header) { - case HEADER_GD_BOOT: + case 76: + Ava2ItemShop(peer,dwHandle,data,dwLength);break; + case HEADER_GD_BOOT: QUERY_BOOT(peer, (TPacketGDBoot *) data); break; diff --git a/src/server/db/src/ClientManager.h b/src/server/db/src/ClientManager.h index a6d1a0ef..1cd259f9 100755 --- a/src/server/db/src/ClientManager.h +++ b/src/server/db/src/ClientManager.h @@ -200,6 +200,7 @@ class CClientManager : public CNetBase, public singleton int Process(); void ProcessPackets(CPeer * peer); + void Ava2ItemShop(CPeer* peer, DWORD handle, const char* data, DWORD length); CLoginData * GetLoginData(DWORD dwKey); CLoginData * GetLoginDataByLogin(const char * c_pszLogin); diff --git a/src/server/db/src/ClientManagerBoot.cpp b/src/server/db/src/ClientManagerBoot.cpp index 368fc269..d655bcf3 100755 --- a/src/server/db/src/ClientManagerBoot.cpp +++ b/src/server/db/src/ClientManagerBoot.cpp @@ -815,6 +815,8 @@ bool CClientManager::InitializeItemTable() // InitializeQuestItemTable(); // END_OF_QUEST_ITEM_PROTO_DISABLE + // Build pointers only after sorting; otherwise each key can point to another prototype. + sort(m_vec_itemTable.begin(), m_vec_itemTable.end(), FCompareVnum()); m_map_itemTableByVnum.clear(); itertype(m_vec_itemTable) it = m_vec_itemTable.begin(); @@ -842,7 +844,6 @@ bool CClientManager::InitializeItemTable() m_map_itemTableByVnum.insert(std::map::value_type(item_table->dwVnum, item_table)); } - sort(m_vec_itemTable.begin(), m_vec_itemTable.end(), FCompareVnum()); return true; } diff --git a/src/server/db/src/DBManager.h b/src/server/db/src/DBManager.h index b7b544db..0788bd98 100755 --- a/src/server/db/src/DBManager.h +++ b/src/server/db/src/DBManager.h @@ -46,6 +46,7 @@ class CDBManager : public singleton void ReturnQuery(const char * c_pszQuery, int iType, DWORD dwIdent, void * pvData, int iSlot = SQL_PLAYER); void AsyncQuery(const char * c_pszQuery, int iSlot = SQL_PLAYER); + MYSQL* DirectHandle(int slot=SQL_PLAYER) { return m_directSQL[slot]->GetSQLHandle(); } SQLMsg * DirectQuery(const char * c_pszQuery, int iSlot = SQL_PLAYER); SQLMsg * PopResult(); diff --git a/src/server/db/src/Makefile b/src/server/db/src/Makefile index 4fa76cb7..3ebfa299 100755 --- a/src/server/db/src/Makefile +++ b/src/server/db/src/Makefile @@ -39,7 +39,7 @@ SRCS = Config.cpp NetBase.cpp Peer.cpp PeerBase.cpp Main.cpp Lock.cpp DBManager. ClientManagerBoot.cpp ClientManagerParty.cpp ClientManagerGuild.cpp GuildManager.cpp HB.cpp \ PrivManager.cpp MoneyLog.cpp ItemAwardManager.cpp ClientManagerEventFlag.cpp Marriage.cpp \ Monarch.cpp BlockCountry.cpp ItemIDRangeManager.cpp ClientManagerHorseName.cpp version.cpp \ - AuctionManager.cpp ProtoReader.cpp CsvReader.cpp + AuctionManager.cpp ProtoReader.cpp CsvReader.cpp Ava2ItemShop.cpp OBJS = $(SRCS:%.cpp=$(OBJDIR)/%.o) diff --git a/src/server/game/src/Makefile b/src/server/game/src/Makefile index c203a043..3f6ed852 100755 --- a/src/server/game/src/Makefile +++ b/src/server/game/src/Makefile @@ -61,7 +61,7 @@ CPPFILE = BattleArena.cpp FSM.cpp MarkConvert.cpp MarkImage.cpp MarkManager.cpp desc_client.cpp desc_manager.cpp desc_p2p.cpp dev_log.cpp dungeon.cpp empire_text_convert.cpp entity.cpp\ entity_view.cpp event.cpp event_queue.cpp exchange.cpp file_loader.cpp fishing.cpp gm.cpp guild.cpp\ guild_manager.cpp guild_war.cpp horse_rider.cpp horsename_manager.cpp input.cpp input_auth.cpp input_db.cpp\ - input_login.cpp input_main.cpp input_p2p.cpp port_boss_track.cpp ava2_channel.cpp new_mob_timer.cpp ava2_track.cpp ava2_ticket_shop.cpp port_attr_lock.cpp port_sash.cpp port_mount.cpp port_costume_attr.cpp port_pendant.cpp port_rings.cpp port_switchbot.cpp port_ava2_dungeon.cpp input_teen.cpp input_udp.cpp ip_ban.cpp\ + input_login.cpp input_main.cpp input_p2p.cpp port_boss_track.cpp ava2_channel.cpp new_mob_timer.cpp ava2_track.cpp ava2_ticket_shop.cpp ava2_itemshop.cpp port_attr_lock.cpp port_sash.cpp port_mount.cpp port_costume_attr.cpp port_pendant.cpp port_rings.cpp port_switchbot.cpp port_ava2_dungeon.cpp input_teen.cpp input_udp.cpp ip_ban.cpp\ item.cpp item_addon.cpp item_attribute.cpp item_manager.cpp item_manager_idrange.cpp locale.cpp\ locale_service.cpp log.cpp login_data.cpp lzo_manager.cpp marriage.cpp matrix_card.cpp\ messenger_manager.cpp mining.cpp mob_manager.cpp monarch.cpp motion.cpp over9refine.cpp p2p.cpp packet_info.cpp\ diff --git a/src/server/game/src/ava2_itemshop.cpp b/src/server/game/src/ava2_itemshop.cpp new file mode 100644 index 00000000..67458c58 --- /dev/null +++ b/src/server/game/src/ava2_itemshop.cpp @@ -0,0 +1,43 @@ +#include "stdafx.h" +#include "utils.h" +#include "char.h" +#include "desc.h" +#include "desc_client.h" +#include "desc_manager.h" +#include "packet.h" +#include "cmd.h" +#include "ava2_itemshop.h" +#include "../../common/ava2_itemshop.h" +#include +#include +ACMD(do_ishop) { + if(!ch || !ch->IsPC() || !ch->GetDesc() || ch->IsWarping() || ch->IsDead())return; + const char* version=strstr(ch->GetDesc()->GetClientVersion(),"mt"); + if(!version || atoi(version+2)<20261020) {ch->ChatPacket(CHAT_TYPE_INFO,"Please update your client to use the item shop.");return;} + std::istringstream input(argument);std::string op,extra;input>>op; + Ava2ShopRequest p={};p.account=ch->GetDesc()->GetAccountTable().id;p.player=ch->GetPlayerID(); + strlcpy(p.name,ch->GetName(),sizeof(p.name));strlcpy(p.ip,ch->GetDesc()->GetHostName(),sizeof(p.ip)); + if(op=="data") {p.operation=0;int revision=-1;if(!(input>>revision))return;} + else if(op=="log")p.operation=1; + else if(op=="buy") { + p.operation=2;std::string token; + if(!(input>>p.product>>p.count>>token>>p.expectedTotal>>p.expectedVnum) || !p.product || p.count<1 || p.count>20 || token.size()!=32 || p.expectedTotal<0 || p.expectedTotal>20000000000000LL || !p.expectedVnum)return; + for(char c:token)if(!std::isxdigit(static_cast(c)))return; + strlcpy(p.token,token.c_str(),sizeof(p.token)); + } else return; + if(input>>extra)return; + const std::string throttle="ishop."+op; + if(ch->GetProtectTime(throttle)>get_global_time())return; + ch->SetProtectTime(throttle,get_global_time()+1); + db_clientdesc->DBPacket(76,ch->GetDesc()->GetHandle(),&p,sizeof(p)); +} +void Ava2ItemShopReply(unsigned long handle,const char* data) { + Ava2ShopReply r;memcpy(&r,data,sizeof(r)); + auto d=DESC_MANAGER::instance().FindByHandle(handle); + if(!d || !d->IsPhase(PHASE_GAME) || !d->GetCharacter() || d->GetAccountTable().id!=r.account || d->GetCharacter()->GetPlayerID()!=r.player)return; + #pragma pack(push,1) + struct Header {uint8_t header;uint32_t size;}; + #pragma pack(pop) + Header h={93,uint32_t(sizeof(Header)+r.size)}; + d->BufferedPacket(&h,sizeof(h));d->Packet(data+sizeof(r),r.size); +} diff --git a/src/server/game/src/ava2_itemshop.h b/src/server/game/src/ava2_itemshop.h new file mode 100644 index 00000000..f310712d --- /dev/null +++ b/src/server/game/src/ava2_itemshop.h @@ -0,0 +1,2 @@ +#pragma once +void Ava2ItemShopReply(unsigned long handle,const char* data); diff --git a/src/server/game/src/cmd.cpp b/src/server/game/src/cmd.cpp index 647a8f0a..98868e9f 100755 --- a/src/server/game/src/cmd.cpp +++ b/src/server/game/src/cmd.cpp @@ -294,9 +294,11 @@ ACMD (do_dragon_soul); ACMD (do_ds_list); ACMD (do_clear_affect); +ACMD(do_ishop); struct command_info cmd_info[] = { { "!RESERVED!", NULL, 0, POS_DEAD, GM_IMPLEMENTOR }, /* 반드시 이 것이 처음이어야 한다. */ + { "ishop", do_ishop, 0, POS_DEAD, GM_PLAYER }, { "autohunt_pull", do_autohunt_pull, 0, POS_FIGHTING, GM_PLAYER }, { "bio", do_port_biolog, 0, POS_DEAD, GM_PLAYER }, { "biolog", do_port_biolog, 0, POS_DEAD, GM_PLAYER }, diff --git a/src/server/game/src/input_db.cpp b/src/server/game/src/input_db.cpp index 93769f20..9891d8fe 100755 --- a/src/server/game/src/input_db.cpp +++ b/src/server/game/src/input_db.cpp @@ -1,4 +1,6 @@ #include "stdafx.h" +#include "ava2_itemshop.h" +#include "../../common/ava2_itemshop.h" #include "new_mob_timer.h" #include "ava2_track.h" #include "constants.h" @@ -2285,7 +2287,9 @@ int CInputDB::Analyze(LPDESC d, BYTE bHeader, const char * c_pData) SafeboxChangePasswordAnswer(DESC_MANAGER::instance().FindByHandle(m_dwHandle), c_pData); break; - case HEADER_DG_MALL_LOAD: + case 76: + Ava2ItemShopReply(m_dwHandle,c_pData);break; + case HEADER_DG_MALL_LOAD: MallLoad(DESC_MANAGER::instance().FindByHandle(m_dwHandle), c_pData); break; @@ -2599,7 +2603,9 @@ bool CInputDB::Process(LPDESC d, const void * orig, int bytes, int & r_iBytesPro const char * pRealData = (c_pData + 9); - if (Analyze(d, bHeader, pRealData) < 0) + if (bHeader==76 && (iSize32775 || reinterpret_cast(pRealData)->size!=iSize-sizeof(Ava2ShopReply))) { d->SetPhase(PHASE_CLOSE);return true; } + + if (Analyze(d, bHeader, pRealData) < 0) { sys_err("in InputDB: UNKNOWN HEADER: %d, LAST HEADER: %d(%d), REMAIN BYTES: %d, DESC: %d", bHeader, bLastHeader, iLastPacketLen, m_iBufferLeft, d->GetSocket()); diff --git a/tests/features/test_itemshop.py b/tests/features/test_itemshop.py new file mode 100644 index 00000000..a4e14801 --- /dev/null +++ b/tests/features/test_itemshop.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 +"""Compile the production wire and total-price helper, including malformed bounds.""" +import subprocess,tempfile,unittest +from pathlib import Path +ROOT=Path(__file__).resolve().parents[2] +class ItemShop(unittest.TestCase): + def test_native_wire_and_integer_quantity_discount(self): + source=r''' +#include "src/server/common/ava2_itemshop.h" +#include +#include +int main(){ + static_assert(sizeof(Ava2ShopRequest)==103,"request"); + static_assert(sizeof(Ava2ShopProduct)==49,"native catalogue"); + static_assert(sizeof(Ava2ShopLog)==90,"native log"); + int64_t price=123; + assert(Ava2ShopTotal(99,2,25,price) && price==148); + assert(Ava2ShopTotal(1,1,99,price) && price==0); + assert(Ava2ShopTotal(1000000000000LL,20,0,price) && price==20000000000000LL); + assert(!Ava2ShopTotal(-1,1,0,price));assert(!Ava2ShopTotal(1000000000001LL,1,0,price)); + assert(!Ava2ShopTotal(1,0,0,price));assert(!Ava2ShopTotal(1,21,0,price));assert(!Ava2ShopTotal(1,1,101,price)); + Ava2ShopProduct p={};p.id=0x01020304;p.vnum=71084;p.price=99;p.discount=25;p.stock=-1; + const unsigned char* bytes=reinterpret_cast(&p); + assert(bytes[0]==4 && bytes[3]==1 && bytes[20]==25 && bytes[45]==255); +} +''' + with tempfile.TemporaryDirectory() as d: + p=Path(d);(p/'test.cpp').write_text(source) + subprocess.run(['c++','-std=c++17','-I'+str(ROOT),str(p/'test.cpp'),'-o',str(p/'test')],check=True);subprocess.run([str(p/'test')],check=True) + def test_sorted_prototype_index_points_to_the_matching_item(self): + source=(ROOT/'src/server/db/src/ClientManagerBoot.cpp').read_bytes().decode('latin1') + body=source[source.index('bool CClientManager::InitializeItemTable()'):source.index('bool CClientManager::InitializeSkillTable()')] + start=body.rindex('// END_OF_QUEST_ITEM_PROTO_DISABLE') + tail=body[start:body.rfind('return true;')+len('return true;')] + harness=r""" +#include +#include +#include +#include +#define sys_log(...) ((void)0) +#define itertype(c) decltype(c)::iterator +using namespace std; +using DWORD=unsigned; +struct TItemTable { DWORD dwVnum;unsigned bType; }; +struct FCompareVnum { bool operator()(const TItemTable& a,const TItemTable& b)const {return a.dwVnum m_vec_itemTable={{71084,3},{54051,3},{1,0},{71502,28}}; + map m_map_itemTableByVnum; + bool Build() { BODY } +}; +int main(){ Database db;assert(db.Build());for(auto& row:db.m_map_itemTableByVnum)assert(row.first==row.second->dwVnum);assert(db.m_map_itemTableByVnum[54051]->bType==3);assert(db.m_map_itemTableByVnum[71502]->bType==28); } +""".replace('BODY',tail) + with tempfile.TemporaryDirectory() as d: + p=Path(d);(p/'test.cpp').write_text(harness) + subprocess.run(['c++','-std=c++17',str(p/'test.cpp'),'-o',str(p/'test')],check=True) + subprocess.run([str(p/'test')],check=True) + +if __name__=='__main__':unittest.main() diff --git a/tests/features/test_switchbot.py b/tests/features/test_switchbot.py index 44ded178..5c9e2adb 100644 --- a/tests/features/test_switchbot.py +++ b/tests/features/test_switchbot.py @@ -103,8 +103,10 @@ if cpacket.is_file(): assert 'static_assert(sizeof(TPacketCGSwitchbot) == 7 && sizeof(TPacketGCSwitchbot) == 7,' in client stream=(CLIENT/'PythonNetworkStreamPhaseGame.cpp').read_bytes().decode('latin1') # the EU branch (the one every locale.cfg build takes) keeps 1215955205 first for the atoi version check - assert 'strncpy(kVersionPacket.timestamp, "1215955205 mt20261019", sizeof(kVersionPacket.timestamp)-1);' in stream - assert 'strncpy(kVersionPacket.timestamp, "mt20261019", sizeof(kVersionPacket.timestamp)-1);' in stream + modern=re.search(r'strncpy\(kVersionPacket.timestamp, "1215955205 mt(\d{8})"',stream) + legacy=re.search(r'strncpy\(kVersionPacket.timestamp, "mt(\d{8})"',stream) + assert modern and legacy and modern.group(1)==legacy.group(1) + assert int(modern.group(1))>=20261016 # switchbot gate; newer features may advance this revision pyswitch=(CLIENT/'PythonSwitchbot.h').read_bytes().decode('latin1') ctable=pyswitch[pyswitch.index('struct TSwitchbotTable'):];ctable=ctable[:ctable.index('};')] assert re.findall(r'^\s*[A-Za-z_][\w:]*\s+(\w+)(?:\[[^;]*\])?;',ctable,re.M)==table,ctable diff --git a/tools/ava2-itemshop/README.md b/tools/ava2-itemshop/README.md new file mode 100644 index 00000000..7fea8cd7 --- /dev/null +++ b/tools/ava2-itemshop/README.md @@ -0,0 +1,35 @@ +# Native AVA2 item shop + +Active UI is `uiitemshopnew.py`. GC93 retains the native catalogue/log layouts; +GD/DG76 transports authenticated account/character requests to the DB coordinator. +Purchase requests add a durable random token and the confirmed item/total quote. + +`data/ava2-itemshop/original-products.tsv` contains all 217 original offers recovered +from the supplied MySQL56 archive. `source.json` records hashes. No prices are invented. +`compatibility.json` records 55 absent prototypes, 55 ITEM_NONE placeholders and 107 +actual types needing item-system verification. `verified-products.json` selects 49 +existing implemented mount, mount-skin, fixed-enchant and third-hand products. + +Generate migration SQL with explicit configured schema names, review it and back up +account/award data before executing it: + +``` +python3 tools/ava2-itemshop/migrate.py --player player_sb --account account_sb --output /tmp/itemshop.sql +python3 tools/ava2-itemshop/enable_verified.py --player player_sb --output /tmp/itemshop-enable.sql +``` + +The migration uses InnoDB for account, catalogue, orders and awards. Account/player SQL +configurations must target the same MySQL host and port. Purchase failures leave all +four unchanged. A transaction temporarily disables reconnect and caps lock waits at +three seconds, restoring the original connection options afterwards. Unknown COMMIT +outcomes retry the same order. Unique `(account_id,token)` orders survive process restarts. + +The old prototype loader indexed vector pointers before sorting; it now sorts before building the index so lookup keys always match their templates. + +Awards use the existing mall redemption path; non-stackable purchases create separate +award rows. New clients use revision mt20261020. Legacy clients cannot request GC93. +No web recharge service or wheel reward service is enabled. + +Acceptance evidence: `metin2-client/docs/AVA2-ITEMSHOP.md` and +`metin2-client/audit/evidence/itemshop/`. Only sbtest was changed; production binaries, +prices, balances and catalogue activation were not deployed by this task. diff --git a/tools/ava2-itemshop/enable_verified.py b/tools/ava2-itemshop/enable_verified.py new file mode 100644 index 00000000..bcbe83b1 --- /dev/null +++ b/tools/ava2-itemshop/enable_verified.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 +"""Emit SQL enabling original offers backed by implemented item systems. Never executes SQL.""" +import argparse,json,re +from pathlib import Path +p=argparse.ArgumentParser();p.add_argument('--player',required=True);p.add_argument('--output',type=Path,required=True);a=p.parse_args() +if not re.fullmatch('[A-Za-z0-9_]+',a.player):p.error('invalid schema') +root=Path(__file__).resolve().parents[2];rows=json.loads((root/'data/ava2-itemshop/verified-products.json').read_text())['products'] +sql='USE `'+a.player+'`;\n' +for row in rows: + sql+='UPDATE ishop_data s JOIN item_proto p ON p.vnum=s.itemVnum SET s.enabled=1 WHERE s.id=%d AND s.itemVnum=%d AND p.type<>0;\n'%(row['id'],row['vnum']) +sql+='SELECT categoryType,categorySubType,COUNT(*) FROM ishop_data WHERE enabled=1 GROUP BY categoryType,categorySubType;\n' +a.output.parent.mkdir(parents=True,exist_ok=True);a.output.write_text(sql);print('SQL generated for',len(rows),'verified original offers; original prices preserved') diff --git a/tools/ava2-itemshop/migrate.py b/tools/ava2-itemshop/migrate.py new file mode 100644 index 00000000..6db2e49b --- /dev/null +++ b/tools/ava2-itemshop/migrate.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +"""Emit a reviewable migration for explicitly named isolated or production schemas. +Run mysql separately after backup. Native products are disabled until compatibility review. +""" +import argparse,re +from pathlib import Path +p=argparse.ArgumentParser();p.add_argument('--player',required=True);p.add_argument('--account',required=True);p.add_argument('--output',type=Path,required=True);a=p.parse_args() +for name in (a.player,a.account): + if not re.fullmatch('[A-Za-z0-9_]+',name):p.error('invalid schema') +sql=f'''USE `{a.player}`; +CREATE TABLE IF NOT EXISTS ishop_data ( + id INT UNSIGNED PRIMARY KEY, categoryType INT NOT NULL, categorySubType INT NOT NULL, + itemVnum INT UNSIGNED NOT NULL,itemPrice BIGINT UNSIGNED NOT NULL,discount INT NOT NULL DEFAULT 0, + offerTime DATETIME NULL,addedTime DATETIME NULL,sellCount BIGINT UNSIGNED NOT NULL DEFAULT 0, + week_limit INT NOT NULL DEFAULT 0,month_limit INT NOT NULL DEFAULT 0,maxSellCount INT NOT NULL DEFAULT -1, + enabled TINYINT NOT NULL DEFAULT 0 +) ENGINE=InnoDB; +CREATE TABLE IF NOT EXISTS port_itemshop_orders ( + id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,account_id INT UNSIGNED NOT NULL, + token CHAR(32) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,product INT UNSIGNED NOT NULL,vnum INT UNSIGNED NOT NULL, + quantity INT UNSIGNED NOT NULL,paid BIGINT UNSIGNED NOT NULL,player_name VARCHAR(24) NOT NULL,ip VARCHAR(45) NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + UNIQUE KEY request_once(account_id,token), KEY limits_by_account(account_id,product,created_at) +) ENGINE=InnoDB; +ALTER TABLE ishop_data ENGINE=InnoDB; +ALTER TABLE item_award ENGINE=InnoDB; +ALTER TABLE `{a.account}`.account ENGINE=InnoDB; +''' +# Upgrade an existing native catalogue without replacing its products or sales history. +sql+="""SET @enabled_exists=(SELECT COUNT(*) FROM information_schema.columns WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='ishop_data' AND COLUMN_NAME='enabled'); +SET @ddl=IF(@enabled_exists=0,'ALTER TABLE ishop_data ADD enabled TINYINT NOT NULL DEFAULT 0','SELECT 1'); +PREPARE shop_ddl FROM @ddl; EXECUTE shop_ddl; DEALLOCATE PREPARE shop_ddl; +""" +# Coins are added by a separate conditional step, since MySQL 5.6 lacks ADD IF NOT EXISTS. +sql+=f'''SET @column_exists=(SELECT COUNT(*) FROM information_schema.columns WHERE TABLE_SCHEMA='{a.account}' AND TABLE_NAME='account' AND COLUMN_NAME='coins'); +SET @ddl=IF(@column_exists=0,'ALTER TABLE `{a.account}`.account ADD coins BIGINT UNSIGNED NOT NULL DEFAULT 0','SELECT 1'); +PREPARE shop_ddl FROM @ddl; EXECUTE shop_ddl; DEALLOCATE PREPARE shop_ddl; +''' +source=Path(__file__).resolve().parents[2]/'data/ava2-itemshop/original-products.tsv' +for line in source.read_text().splitlines(): + row=line.split('\t');assert len(row)==12 + values=[str(int(v)) if i not in (6,7) else ('NULL' if v.startswith('0000') else "'"+v+"'") for i,v in enumerate(row)] + sql+='INSERT IGNORE INTO ishop_data(id,categoryType,categorySubType,itemVnum,itemPrice,discount,offerTime,addedTime,sellCount,week_limit,month_limit,maxSellCount) VALUES('+','.join(values)+');\n' +a.output.parent.mkdir(parents=True,exist_ok=True);a.output.write_text(sql) +print('217 native products imported disabled; review compatibility before enabling')