What's New in Director 8.5 > Using the Shockwave Multiuser Server and Xtra > Using databases > A database scenario |
![]() ![]() ![]() |
A database scenario
Suppose you want to create an online casino in which users will play various games, such as poker, blackjack, and roulette. Each game could be a separate movie you create and could contain several different rooms to play in. You could use each of the types of database objects to store information about users, players, games, and the casino environment.
You could create DBUser
objects for each new person who logs in and wants to enter the casino. The attributes you store for each user might include their e-mail address, preferred games, and so on. Your DBPlayer
objects might include a player's current winnings for a particular game.
You could use DBApplication
objects to store the name of the user who has won the most money in each game. You might also have an attribute in each of these DBApplication
objects that is a list of the DBApplicationData
objects you've created for different rooms in each game. You could then use this list to retrieve the data for a particular room in a particular game. The DBApplication
object for the blackjack movie might contain an attribute called #roomList
with room names in a linear list like this one:
["Art Deco", "Western Saloon", "Contemporary", "Egyptian"]
You could then use getApplicationData
to retrieve the list of attributes for each room. The DBApplicationData
object for one room might look like this:
[#roomName: "Art Deco", #dealerName: "Larry", #wallArt: "Mona Lisa", #minimumBet: 50, #music: "Classical"]
By creating DBApplicationData
objects for each room, you can design your movies to display certain graphics and sounds based on which room object is chosen by the user.
![]() ![]() ![]() |