Closed dd84ai closed 1 year ago
Shouldn't you also be adding this to the list of commands you can't run with viewshop?
Uh, yeah!
Made dummy check with trying to load resulting JSON through Python, it still works. silly in game check performed as well
Ready for merge once author gives the go-ahead
manual CI is running:
https://sourceforge.net/projects/boost/files/boost-binaries/1.64.0/boost_1_64_0-msvc-14.1-32.exe/download
to C:\Users\user\repos\FLHook\Dependencies\boost
C:\Users\user\repos\FLHook\Dependencies\boost
user@WIN-GHKN5G5H3L9 MINGW64 ~/repos/FLHook/Dependencies/boost (base_shop_items_to_json)
$ ls
boost/ boost-build.jam bootstrap.log index.htm Jamroot LICENSE_1_0.txt status/
boost.css boostcpp.jam bootstrap.sh* index.html lib32-msvc-14.1/ more/ tools/
boost.png bootstrap.bat doc/ INSTALL libs/ rst.css
Welcome to FLHook Console (3.1.0-UNKNOWN plugin)
Plugin loaded: hookext (ahookext.dll)
Plugin loaded: alley (alley.dll)
Plugin loaded: autobuy (autobuy.dll)
Plugin loaded: balancemagic (balancemagic.dll)
Plugin loaded: base (base.dll)
Plugin loaded: cloak (cloak.dll)
Plugin loaded: commoditylimit (commoditylimit.dll)
Plugin loaded: conn (conn.dll)
Plugin loaded: dronebay (dronebay.dll)
Plugin loaded: events (event.dll)
Plugin loaded: exhelp (exhelp.dll)
Plugin loaded: getrep (getrep.dll)
Plugin loaded: jsonbuddy (JSONBuddy.dll)
Plugin loaded: marketfucker (MarketFucker.dll)
Plugin loaded: minecontrol (minecontrol.dll)
Plugin loaded: misc (MiscellaneousCommands.dll)
Plugin loaded: dock (mobiledock.dll)
Plugin loaded: npc (npc.dll)
Plugin loaded: playercntl (playercntl.dll)
Plugin loaded: pvecontroller (pvecontroller.dll)
Plugin loaded: tempban (tempban.dll)
Plugin loaded: template (template.dll)
Loading character name cache
Loaded 0 names
Saving character name cache
Saved 0 names
DEBUG: Rep of li05_05_base is pf_09_grp
DEBUG: Rep of lI16_02_base is pf_09_grp
DEBUG: Rep of li05_03_base is li_lsf_grp
DEBUG: Rep of lI16_01_base is li_n_grp
DEBUG: Rep of lI16_03_base is li_n_grp
DEBUG: Rep of Hi01_01_base is fc_neutral
DEBUG: Rep of Hi02_01_base is fc_neutral
DEBUG: Rep of br04_04_base is co_be_grp
DEBUG: Rep of li02_04_base is fc_neutral
DEBUG: Rep of iw01_02_base is fc_neutral
DEBUG: Rep of li15_02_base is fc_neutral
AUTOBUY: Loaded 137 ammo limit entries
AUTOBUY: Loaded 18 FLHook extra items
AUTOBUY: Loaded 20 stackable launchers
BALANCEMAGIC: Loaded 29 damage adjusts.
CLOAK: Loaded 12 cloaking devices
CLOAK: Loaded 5 cloak disruptors
CLOAK: Loaded 0 limited cloak setups
CL: Loaded 0 Limited Commodities
DRONEBAY: 0 bayarches loaded.
DRONEBAY: 0 dronearches loaded.
EVENT: Loaded 0 events
EVENT DEBUG: Loaded 0 event data
EVENT DEBUG: Loaded 0 event player data
EVENT DEBUG: Loaded 248 IDs
HELP MENUS: Loaded 19 help menus
Rep: Loaded 148 factions
JSONBuddy: Loaded 552 ships
JSONBuddy: Loaded 248 IDs
MARKETFUCKER: Ignoring Bastille Guard Station.
MARKETFUCKER: Loaded 1349 ships for 453 bases
MARKETFUCKER: Loaded 20 items for 604 bases
DockingModules: Loaded 0 equipment
DockingModules: Allowing ships below the cargo capacity of 275 to dock
Resetrep: Loaded 148 factions
HYPERJUMP NOTICE: Ship Whitelist is 1 (1=On, 0=Off)
HYPERJUMP NOTICE: System Whitelist is 1 (1=On, 0=Off)
HYPERJUMP NOTICE: Survey Plane Limit is 15000
Jumpdrive [8]
Beacon Matrix [1]
IP Bans [0]
ID Bans [0]
Playercntl: Loaded 54 tag rephacks
Notice: Loaded 574 locked ships
PVECONTROLLER: NPC bounties are enabled.
PVECONTROLLER: Loaded 0 NPC bounty group scale values.
PVECONTROLLER: Loaded 0 NPC bounty classes.
PVECONTROLLER: Loaded 0 NPC bounty ship overrides.
PVECONTROLLER: Loaded 0 NPC bounty fighter armor multipliers.
PVECONTROLLER: Loaded 0 NPC bounty system scale multipliers.
PVECONTROLLER: Loaded 0 ship class types.
PVECONTROLLER: Loaded 0 NPC bounty class difference multipliers.
PVECONTROLLER: Loaded 0 NPC bounty warzone scale multipliers.
PVECONTROLLER: NPC drops are enabled.
PVECONTROLLER: Loaded 0 NPC drops by class.
TEMPLATE: Loaded 0 TEMPLATE
socket(ascii): socket connection listening
socket(unicode): socket connection listening
socket(encrypted-ascii): socket connection listening
socket(encrypted-unicode): socket connection listening
Rep: Loaded 148 factions
base: AffList was loaded succesfully.
$ cat base_status.json
{"timestamp":"20230618T195600","bases":{"TB1929":{"passwords":["hastesucks"],"affiliation":"No Affiliation","type":"legacy","solar":"legacy","loadout":"legacy","level":1,"health":4.9982,"defensemode":1}}}
user@WIN-GHKN5G5H3L9 MINGW64 ~/repos/FLHook (base_shop_items_to_json)
$ git status
On branch base_shop_items_to_json
Your branch is up to date with 'origin/base_shop_items_to_json'.
New CI run: Diff
user@WIN-GHKN5G5H3L9 MINGW64 /c/stats $ python Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
exit()
- write file test.py
import json
with open("base_status.json") as file: data = file.read()
parsed = json.loads(data) print(parsed)
$ python test.py
{'timestamp': '20230618T201400', 'bases': {'TB1929': {'passwords': ['hastesucks'], 'shop': {'quantity': 100, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Aluminium'}, 'affiliation': 'No Affiliation', 'type': 'legacy', 'solar': 'legacy', 'loadout': 'legacy', 'level': 1, 'money': 999900, 'health': 4.9943, 'defensemode': 1}}}
- shutting down server
- CI has run succesfully ✅
git checkout . erasing target platform changes
- <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>^
New Build run:
Severity Code Description Project File Line Suppression State
Warning C4244 '*=': conversion from 'float' to 'int', possible loss of data PvE Controller C:\Users\user\repos\FLHook\Plugins\Public\pvecontroller\Main.cpp 663
Warning C4244 '*=': conversion from '_Ty2' to 'int', possible loss of data PvE Controller C:\Users\user\repos\FLHook\Plugins\Public\pvecontroller\Main.cpp 672
Warning C4244 '*=': conversion from '_Ty2' to 'int', possible loss of data PvE Controller C:\Users\user\repos\FLHook\Plugins\Public\pvecontroller\Main.cpp 687
Error MSB6006 "link.exe" exited with code 1114. HookExtension Plugin C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets 1096
Error LNK1114 cannot overwrite the original file 'C:\Users\user\repos\FLHook\Plugins\Public\hookext_plugin\Release\ahookext.lib'; error code 5 HookExtension Plugin C:\Users\user\repos\FLHook\Plugins\Public\hookext_plugin\LINK 1
Warning C4018 '>': signed/unsigned mismatch Base Plugin C:\Users\user\repos\FLHook\Plugins\Public\base_plugin\PlayerCommands.cpp 1826
🔴
New build run:
New CI test run:
user@WIN-GHKN5G5H3L9 MINGW64 /c/stats
$ python test.py
{'timestamp': '20230618T203800', 'bases': {'TB1929': {'passwords': ['hastesucks'], 'shop': {'quantity': 100, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Aluminium'}, 'affiliation': 'No Affiliation', 'type': 'legacy', 'solar': 'legacy', 'loadout': 'legacy', 'level': 1, 'money': 999900, 'health': 4.9883, 'defensemode': 1, 'shieldstate': 0}}}
Also after reconnect, items dissapear from shop 😢
Sold gold and food to base receiving user@WIN-GHKN5G5H3L9 MINGW64 /c/stats $ python test.py {'timestamp': '20230618T222400', 'bases': {'TB1929': {'passwords': ['hastesucks'], 'shop': {'quantity': 123, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Gin'}, 'affiliation': 'No Affiliation', 'type': 'legacy', 'solar': 'legacy', 'loadout': 'legacy', 'level': 1, 'money': 999047, 'health': 4.8233, 'defensemode': 1}}} and broken /base interface 🔴
CI rerun
adding dsacesrv.dll
back to folder, fixed most of issues.
Except incorrect JSON is still created. messed up data of all shop items into single dictionary with overriding keys to each other
🔴
https://github.com/DiscoveryGC/FLHook/pull/160/commits/98479250ca12407cb78846aa8d799716db9e1344 Fixed bugs
user@WIN-GHKN5G5H3L9 MINGW64 /c/stats
$ python test.py
{'timestamp': '20230618T232200', 'bases': {'TB1929': {'passwords': ['hastesucks'], 'shop_items': [{'quantity': 60, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Silencer CM Flare'}, {'quantity': 100, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': True, 'item': 'Gadolinium'}, {'quantity': 1, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Coalition Thruster'}, {'quantity': 1, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Adv. Flashpoint Turret'}, {'quantity': 123, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Food Rations'}, {'quantity': 429, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Gold'}, {'quantity': 120, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Nanobots'}, {'quantity': 100, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Aluminium'}, {'quantity': 2, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Light Mining Array'}, {'quantity': 123, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Gin'}], 'affiliation': 'No Affiliation', 'type': 'legacy', 'solar': 'legacy', 'loadout': 'legacy', 'level': 1, 'money': 998941, 'health': 4.8113, 'defensemode': 1}}}
State is succesfully changed to Public, saved for server restart (persistent) and succesfully oouputed to json and python is able to parse it correctly
CI passes ✅
CI rerun for rebased branch.
user@WIN-GHKN5G5H3L9 MINGW64 /c/stats
$ python test.py
{'timestamp': '20230618T232900', 'bases': {'TB1929': {'passwords': ['hastesucks'], 'shop_items': [{'quantity': 60, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Silencer CM Flare'}, {'quantity': 100, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': True, 'item': 'Gadolinium'}, {'quantity': 1, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Coalition Thruster'}, {'quantity': 1, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': True, 'item': 'Adv. Flashpoint Turret'}, {'quantity': 123, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Food Rations'}, {'quantity': 429, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Gold'}, {'quantity': 120, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Nanobots'}, {'quantity': 100, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Aluminium'}, {'quantity': 2, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Light Mining Array'}, {'quantity': 123, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'item': 'Gin'}], 'affiliation': 'No Affiliation', 'type': 'legacy', 'solar': 'legacy', 'loadout': 'legacy', 'level': 1, 'money': 998941, 'health': 4.8071, 'defensemode': 1, 'shieldstate': 0}}}
receiving expected json parsed by python
Manual CI:
user@WIN-GHKN5G5H3L9 MINGW64 /c/stats
$ python test.py
{'timestamp': '20230619T162300', 'bases': {'TB1929': {'passwords': ['hastesucks'], 'shop_items': [{'quantity': 60, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Silencer CM Flare', 'name_id': 501587, 'id': 2211913230, 'nickname': 'ge_s_cm_04_ammo'}, {'quantity': 100, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': True, 'name': 'Gadolinium', 'name_id': 505870, 'id': 2222120073, 'nickname': 'commodity_gadolinium'}, {'quantity': 1, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Coalition Thruster', 'name_id': 520454, 'id': 2394587014, 'nickname': 'dsy_thruster_coal'}, {'quantity': 1, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': True, 'name': 'Adv. Flashpoint Turret', 'name_id': 263498, 'id': 2759792129, 'nickname': 'co_turret01_mark03'}, {'quantity': 123, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Food Rations', 'name_id': 261622, 'id': 2863847232, 'nickname': 'commodity_food'}, {'quantity': 429, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Gold', 'name_id': 261610, 'id': 2866206539, 'nickname': 'commodity_gold'}, {'quantity': 120, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Nanobots', 'name_id': 263746, 'id': 2911012559, 'nickname': 'ge_s_repair_01'}, {'quantity': 100, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Aluminium', 'name_id': 505800, 'id': 2958831363, 'nickname': 'commodity_aluminium'}, {'quantity': 2, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Light Mining Array', 'name_id': 500189, 'id': 3103125006, 'nickname': 'hf_mining_gun'}, {'quantity': 123, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Gin', 'name_id': 505874, 'id': 3207769547, 'nickname': 'commodity_gin'}], 'affiliation': 'No Affiliation', 'type': 'legacy', 'solar': 'legacy', 'loadout': 'legacy', 'level': 1, 'money': 998941, 'health': 4.6343, 'defensemode': 1, 'shieldstate': 0}}}
Manual CI:
$ python test.py
{'timestamp': '20230619T164500', 'bases': {'TB1929': {'passwords': ['hastesucks'], 'shop_items': [{'quantity': 60, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Silencer CM Flare', 'name_id': 501587, 'id': 2211913230, 'nickname': 'ge_s_cm_04_ammo'}, {'quantity': 100, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': True, 'name': 'Gadolinium', 'name_id': 505870, 'id': 2222120073, 'nickname': 'commodity_gadolinium'}, {'quantity': 1, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Coalition Thruster', 'name_id': 520454, 'id': 2394587014, 'nickname': 'dsy_thruster_coal'}, {'quantity': 1, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': True, 'name': 'Adv. Flashpoint Turret', 'name_id': 263498, 'id': 2759792129, 'nickname': 'co_turret01_mark03'}, {'quantity': 123, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Food Rations', 'name_id': 261622, 'id': 2863847232, 'nickname': 'commodity_food'}, {'quantity': 429, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Gold', 'name_id': 261610, 'id': 2866206539, 'nickname': 'commodity_gold'}, {'quantity': 120, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Nanobots', 'name_id': 263746, 'id': 2911012559, 'nickname': 'ge_s_repair_01'}, {'quantity': 100, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Aluminium', 'name_id': 505800, 'id': 2958831363, 'nickname': 'commodity_aluminium'}, {'quantity': 2, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Light Mining Array', 'name_id': 500189, 'id': 3103125006, 'nickname': 'hf_mining_gun'}, {'quantity': 123, 'price': 1, 'min_stock': 100000, 'max_stock': 100000, 'is_public': False, 'name': 'Gin', 'name_id': 505874, 'id': 3207769547, 'nickname': 'commodity_gin'}], 'affiliation': 'No Affiliation', 'type': 'legacy', 'solar': 'legacy', 'loadout': 'legacy', 'level': 1, 'money': 998941, 'health': 4.6325, 'defensemode': 1, 'shieldstate': 0}}}
✅ still green
outputting base items to JSON with key
shop
which players are wishing to showby default all items are private with
/shop public #NumberInShop
, item can become public/shop private #NumberInShop
, in order to hide item backAlso added for output
money
which is needed in order to decide if the base is capable to buy things it made public