Skip to content

Undeterminable Neighbouring If Two Robots are Bought #50

Description

@twobiers

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"
      }
   ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions