Implementing inventory in the SmartFoxServer
We need to create a table in our virtual world database to store the items. Similar to creating a table player's position in Chapter 6, Walking Around the World, we use PhpMyAdmin
to create the items
table with the following schema. The id
is an auto incremental primary key.
Field |
Type |
Description |
---|---|---|
|
|
Auto incremental ID for reference to a unique item entry. |
|
|
The type ID of the item, specifying which item it is. |
|
|
The owner avatar name of the item. |
|
|
The bag that this item is in. |
|
|
The position of the item inside the bag. |
|
|
The creation time of this item. |
|
|
Some ... |
Get Flash Multiplayer Virtual Worlds now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.