Skip to content

How to Create and Delete Users

MFHolm edited this page Jan 29, 2018 · 2 revisions

The database for the users and worlds has been created using two JSON files: users.json and worlds.json. To create a new user a new user can be added to the users list in users.json. A user consists of and ID, a username, a password, a list of worlds owned and a list of worlds playing. When a new user is created it is important to give the new user a unique ID, a non-empty username and a non-empty password. The two lists should be empty. As an example a new user could be created by adding the following to the list:

{
   "id": 3,
   "username": "user3",
   "password": "111",
   "worlds_owned": [
    ],
   "worlds_playing": [
   ]
}

This would create a new user with username "user3" and the password "111".

To delete a user one must remove the user from the users list. In addition one must remove the worlds that this user owned. To remove a world one simply removes the world from the worlds list in worlds.json.