Cardinal game account system
Cardinal uses the concept of Persona to represent a game account. When submitting a message to Cardinal, you provide a persona tag to identify who is sending the message and a cryptographic signature to prove that you are an authorized user of that persona.
In contrast to the typical Ethereum account/address, Persona has the following superpowers:
Within a system, you can loop over transactions of a particular type. These transactions called TxData contain the following methods:
Msg
returns the custom message data that you set up when you initially called NewMessageType.
Tx
returns the Transaction, a struct containing signature information, including the Persona that was used to sign the transaction.
Hash
returns the hash of the transaction.
In this sample code, an “attack” message type is created, as well as a system that simply logs the Persona Tag of each incoming Attack message.
The easiest way to set up a Persona Tag with your cardinal game it to use the Cardinal plugin for Nakama. The /nakama/claim-persona
RPC endpoint takes a request with a body of:
and registers that persona with your Cardinal backend. For more details about what Nakama is specifically doing under the hood, see the Creating a Persona Tag section of the Nakama plugin documentation.
Cardinal game account system
Cardinal uses the concept of Persona to represent a game account. When submitting a message to Cardinal, you provide a persona tag to identify who is sending the message and a cryptographic signature to prove that you are an authorized user of that persona.
In contrast to the typical Ethereum account/address, Persona has the following superpowers:
Within a system, you can loop over transactions of a particular type. These transactions called TxData contain the following methods:
Msg
returns the custom message data that you set up when you initially called NewMessageType.
Tx
returns the Transaction, a struct containing signature information, including the Persona that was used to sign the transaction.
Hash
returns the hash of the transaction.
In this sample code, an “attack” message type is created, as well as a system that simply logs the Persona Tag of each incoming Attack message.
The easiest way to set up a Persona Tag with your cardinal game it to use the Cardinal plugin for Nakama. The /nakama/claim-persona
RPC endpoint takes a request with a body of:
and registers that persona with your Cardinal backend. For more details about what Nakama is specifically doing under the hood, see the Creating a Persona Tag section of the Nakama plugin documentation.