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

id

int

Auto incremental ID for reference to a unique item entry.

type

int

The type ID of the item, specifying which item it is.

owner

varchar(50)

The owner avatar name of the item.

bag_id

int

The bag that this item is in.

position

int

The position of the item inside the bag.

create_time

datetime

The creation time of this item.

extra_info

varchar(255)

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.