# A Game Deadline
In the previous section you introduced a FIFO that keeps the oldest games at its head and the most recently updated games at its tail.
Just because a game has not been updated in a while does not mean that it has expired. To ascertain this you need to add a new field,
deadline, to a game and test against it. Time to prepare the field.
# New information
To prepare the field, add in the
StoredGame's Protobuf definition:
To have Starport and Protobuf recompile this file. You can use:
On each update the deadline will always be now plus a fixed duration. In this context, now refers to the block's time. Declare this duration as a new constant, along with how the date is to be represented, i.e. encoded in the saved game as a string:
# Date manipulation
You can make your life easier by using helper functions that encode and decode the deadline in the storage.
First define a new error:
Now you can add your date helpers. A reasonable location to pick is
Of note in the above is that
nil. This is very convenient.
Add a function that encapsulates the knowledge of how the next deadline is calculated in the same file:
# Updated deadline
Next you need to update this new field with its appropriate value:
At creation in the message handler for game creation:
And after a move in the message handler:
Now confirm that your project still compiles:
Before you can do that there is one other field you need to add. Discover which in the next section.