Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undeterminable Neighbouring If Two Robots are Bought #50

Open
twobiers opened this issue Apr 7, 2022 · 0 comments
Open

Undeterminable Neighbouring If Two Robots are Bought #50

twobiers opened this issue Apr 7, 2022 · 0 comments

Comments

@twobiers
Copy link
Member

twobiers commented Apr 7, 2022

Will be probably related to the refactoring of asynchronous communication and introduce breaking changes

If two robots are bought at a time the neighbours are undeterminable as the trade has a single Transaction ID.

Steps to reproduce:

  • Send a single command which buys two robots
  • After the command has been executed a single transaction ID is returned.
  • With this transaction ID the trade event is identifiable.
  • The Trade Event contains a payload of robot with their IDs and their planet location
  • Two Neighbours Events are published with the same transaction ID
  • It is undeterminable which neighbour event belongs to which robot
Offset: 0
Key: b2b00bcd-a17b-404b-a8fa-1ae5aec4e927
Timestamp: 2022-03-31 09:17:55.920
Headers:
  eventId: b2b00bcd-a17b-404b-a8fa-1ae5aec4e927
  timestamp: 2022-03-31T09:17:55Z
  transactionId: 2ea8b5d3-2bb1-4573-b7c8-e8acaf668acc
  type: buy-robot
  version: 1
 
{
   "data": [
      {
         "id": "47d8b47d-8a7f-4227-8849-9d8c8ef5b1a8",
         "player": "2254cfcd-9216-4637-8ecc-74305299273b",
         "planet": "8079ea5e-16f8-4137-ab6c-7f86108d98af",
         "alive": true,
         "maxHealth": 10,
         "maxEnergy": 20,
         "energyRegen": 4,
         "attackDamage": 1,
         "miningSpeed": 2,
         "health": 10,
         "energy": 20,
         "healthLevel": 0,
         "damageLevel": 0,
         "miningSpeedLevel": 0,
         "miningLevel": 0,
         "energyLevel": 0,
         "energyRegenLevel": 0,
         "storageLevel": 0,
         "inventory": {
            "maxStorage": 20,
            "usedStorage": 0,
            "storedCoal": 0,
            "storedIron": 0,
            "storedGem": 0,
            "storedGold": 0,
            "storedPlatin": 0
         },
         "items": {
            "rocket": 0,
            "wormhole": 0,
            "longRangeBombardment": 0,
            "selfDestruction": 0,
            "repairSwarm": 0,
            "nuke": 0
         }
      },
      {
         "id": "8875cc71-887d-4e53-8324-d1fc95ad64d5",
         "player": "2254cfcd-9216-4637-8ecc-74305299273b",
         "planet": "8079ea5e-16f8-4137-ab6c-7f86108d98af",
         "alive": true,
         "maxHealth": 10,
         "maxEnergy": 20,
         "energyRegen": 4,
         "attackDamage": 1,
         "miningSpeed": 2,
         "health": 10,
         "energy": 20,
         "healthLevel": 0,
         "damageLevel": 0,
         "miningSpeedLevel": 0,
         "miningLevel": 0,
         "energyLevel": 0,
         "energyRegenLevel": 0,
         "storageLevel": 0,
         "inventory": {
            "maxStorage": 20,
            "usedStorage": 0,
            "storedCoal": 0,
            "storedIron": 0,
            "storedGem": 0,
            "storedGold": 0,
            "storedPlatin": 0
         },
         "items": {
            "rocket": 0,
            "wormhole": 0,
            "longRangeBombardment": 0,
            "selfDestruction": 0,
            "repairSwarm": 0,
            "nuke": 0
         }
      }
   ],
   "success": true,
   "message": "robot-buy successful",
   "moneyChangedBy": -200
}

Offset: 0
Key: bc123b05-1fc5-4ae8-b09d-7f0357a62e54   
Timestamp: 2022-03-31 09:17:55.869 
Headers: 
  eventId: bc123b05-1fc5-4ae8-b09d-7f0357a62e54
  timestamp: 2022-03-31T09:17:55Z
  transactionId: 2ea8b5d3-2bb1-4573-b7c8-e8acaf668acc
  type: neighbours
  version: 1
 
{
   "neighbours": [
      {
         "planetId": "abec8004-aac6-4e5c-b988-47e90bad51e6",
         "movementDifficulty": 1,
         "direction": "south"
      },
      {
         "planetId": "70873b57-8583-4c32-9824-3b63dc0197e1",
         "movementDifficulty": 1,
         "direction": "north"
      },
      {
         "planetId": "45f6bb91-062c-42b1-977c-b8220c681b68",
         "movementDifficulty": 1,
         "direction": "west"
      }
   ]
}

Offset: 1
Key: b3abd0b1-3a0f-4162-9685-dace617f3067   
Timestamp: 2022-03-31 09:17:55.903 
Headers: 
  eventId: b3abd0b1-3a0f-4162-9685-dace617f3067
  timestamp: 2022-03-31T09:17:55Z
  transactionId: 2ea8b5d3-2bb1-4573-b7c8-e8acaf668acc
  type: neighbours
  version: 1
 
{
   "neighbours": [
      {
         "planetId": "abec8004-aac6-4e5c-b988-47e90bad51e6",
         "movementDifficulty": 1,
         "direction": "south"
      },
      {
         "planetId": "70873b57-8583-4c32-9824-3b63dc0197e1",
         "movementDifficulty": 1,
         "direction": "north"
      },
      {
         "planetId": "45f6bb91-062c-42b1-977c-b8220c681b68",
         "movementDifficulty": 1,
         "direction": "west"
      }
   ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant