@novabyte, thank you for replaying but I think i did not make my question clear.
I mean each player will have a limited number of messages for chatting.
Lets say a player logged for first time. He will get free 30 messages. If he send to a friend (A) 5 messages. The remaining is 25 messages and so on
As we know we are going to store the number of messages in account metadata or storage or even wallet
How to control the number of chat mesaages the player has send and prevent him if he dont have any messages remaining
my current approach is to use
The register “ChannelMessageSend” hook func will be called whenever the player send a message
My concern is that for each message sent i will have to
read storage => unmarshal json => decrease measages cout by 1 => marshal => store it
This will be done for each chat message
Is this how things normally done? Or there is a better approach.