-
Notifications
You must be signed in to change notification settings - Fork 0
Events Sequences
As can be seen in the AsyncAPI documentation, here is a list of the events thrown by Trading and examples of the payloads defined.
{ "playerId": "35184259-d156-4290-94ed-3a4b4f2c36f8", "money": 1000 }
[ { "name": "ROCKET", "price": 100 }, { "name": "NUKE", "price": 200 }, ... ]
[ { "name": "COAL", "price": 10 }, { "name": "IRON", "price": 40 }, { "name": "GOLD", "price": 60 }, ]
{ "success": false, "moneyChangedBy": 0, "message": "not enough money", "data": null }
{ "success": true, "moneyChangedBy": -500, "message": "robot bought", "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "player": "ae2cfcf0-e870-4360-a41e-3b3bb3312234", "planet": "2faf337d-d8d1-40fc-983e-5f130540496b", "alive": true, "maxHealth": 100, "maxEnergy": 60, "energyRegen": 8, "attackDamage": 5, "miningSpeed": 10, "health": 75, "energy": 43, "healthLevel": 5, "damageLevel": 5, "miningSpeedLevel": 5, "miningLevel": 5, "energyLevel": 5, "energyRegenLevel": 5, "storageLevel": 5, "inventory": { "maxStorage": 20, "usedStorage": 5, "coal": 3, "iron": 2, "gem": 0, "gold": 0, "platin": 0 }, "items": { "rocket": 0, "wormhole": 2, "longRangeBombardement": 0, "selfDestruction": 1, "repairSwarm": 0, "nuke": 3 } } }
{ "success": true, "moneyChangedBy": -100, "message": "item bought", "data": { "itemType": "ROCKET" } }
{ "success": true, "moneyChangedBy": 1337, "message": "resources sold", "data": { "coal": 3, "iron": 2, "gem": 0, "gold": 0, "platin": 0 } }