(Gaming/Databases) Consider a database of many thousands of records for a massive multiplayer online game (MMOG). Each record contains data about a player. Whenever someone joins the game, an account is created and assigned a unique record number. This number is used to locate a player record. Because the game is so popular, the MMOG system seldom gets a request to delete an account. As the number of players increased into the thousands, the developers realized they could not keep the entire database in memory. They decided to use an indexing scheme, whereby a player’s name and record number would be stored in memory, but the entire record would be loaded only if the player was logged into the game.
Implement this database system using a list and a hashed dictionary. The list should store each player as an instance of the character class described in Project 13 of the Prelude. Each time a new player account is created, it is added to the end of the list so that its position is also its record number. If an account is deleted, its position in the list should be set to null so the positions of the other entries do not change. The dictionary should use the player’s name as the key. The value of each entry is the record number (list position) of the player’s details in the list. One of the implementation decisions you need to make is the kind of list to use in the database.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here