Modding:SaveGame Data Storage: Difference between revisions

From Vintage Story Wiki
Line 151: Line 151:
If <code>/lfg join</code> was entered, we'll first check if the player is already on the "lfg" list, letting the player know if so. Alternatively, we add the player's unique identifier to the list, and use the <code>Serialize</code> method to turn the updated players <code>List<string></code> back to an array of byte.
If <code>/lfg join</code> was entered, we'll first check if the player is already on the "lfg" list, letting the player know if so. Alternatively, we add the player's unique identifier to the list, and use the <code>Serialize</code> method to turn the updated players <code>List<string></code> back to an array of byte.


After, we use the <code>StoreData</code> method to save our new serialized list under the "lfg" key for later retrieval! Upon completion, we let the player know that he is now in the list.
After, we use the <code>StoreData</code> method to save our new serialized list under the "lfg" key for later retrieval! Upon completion, we let the player know that they are now in the list.


Now let's handle <code>/lfg leave</code>:
Now let's handle <code>/lfg leave</code>: