8. Generic objects - HearthSim/kettle-design GitHub Wiki

Kettle page on hearthsim.net

Relations

  • AnyType -> Ack | Player <-> MatchMaking
  • AnyType -> NAck | Player <-> MatchMaking

Types

Ack

kettle:types/ack is a generic object that is sent to acknowledge a received object.

  • Acknowledged object: The string representation of the Types IRI.
{
    "type": "kettle:types/ack",
    "ack":
    {
        /*REQ*/ "acknowledged_object" := "kettle:types/[type_name]",
    }
}

NAck

kettle:types/nack is a generic object that is sent to notify the receiver that the received object was discarded.

  • NotAcknowledged object: The string representation of the Types IRI; and
  • Reason: Gives a set reason for why the object wasn't acknowledged. Possible values are explaing by the enum Reason; and
  • Message: An optionall accompanying message giving more information about the property Reason.
{
    "type": "kettle:types/nack",
    "nack":
    {
        /*REQ*/ "not_acknowledged_object" := "kettle:types/[type_name]",
        /*REQ*/ "reason" := Reason:integer,
        /*OPT*/ "message" := string,
    }
}

Enums

Reason

Reason explains why something happened.

The values are written in HEX format and the underlying type is int32.

0x0

Invalid/Undefined.

0x1

Shutdown. The sender was purposely shut down.

0x2

Cancel. The sender purposely cancelled the operation.

0x3

Invalid state. An internal error happened and the sender cut off this connection.

0x4

No error. Expected state transition.

Other sources

Homestone's Fireplace communication snippet

Stove's Kettle communication snippet