Andy, Lorne, Xizhi,

Let us design bag and item system here

Draft thought of Xizhi

Global Store

ID int , Unique Indexed
PrimeKey asset string key like url path Unique Indexed
FileID nil, reference a remote paraworld file where this item can be downloaded safely
type like AppCommand, APP, Model asset, texture asset, character asset, Bag, Item
category virtual folder: like model/char, char/v3/assets. similar to PrimeKey. for human categorization.
Count how many are left in store. nil for infinity.
Author userID who uploaded
UploadDate date
Icon the icon to display. can be local or URL path.

Bag(用户背包)

BagID int 主键,自增
UID uniqueidentifier 背包所有者的用户ID,NOT NULL
BagType int 背包类型,默认值为0
Visibility bit 背包中的物品对于其他用户是否可见,NOT NULL,默认值为1

Bag_Item(背包中的物品)

BagID int 背包ID,Bag表中BagID的外键,级联删除,NOT NULL,与ItemID组成联合主键
ItemID int 物品ID,物品表中物品ID的外键,级联删除,NOT NULL
Pos int 物品在背包中的位置,NOT NULL,默认值为0
Cnt int 该背包中此物品的数量,NOT NULL,默认值为1
IsBound bit 该物品是否已与该背包绑定,若与背包绑定,则该物品只可以被该背包的所有者使用,NOT NULL,默认值为0

编辑上传到Global Store的流程

Disk(Art Model browser) --> Scene --> Global Store (-->bag)

引入了一个Global Store, 好像是Template, 它可以被实例化到某个Bag中最多Count次, 每次实例化要消耗Price元。 背包中的物品,好像是类的实例了。

Andy: my latest concern is the item system should be separated to two catrgories: traditional MMORPG like item system with official functions and model publishing systems that opens the user generated contents.
Xizhi: 我想分成的两部分,是否可以用GlobalStore中的Type来区分呢?

我是这样考虑处理MMO的物品,和UGC的物品的: Global Store 只记录上面写的内容。 没有那些影响人物的属性等等参数。然后通过Type: 每个Type有自己的表来描述各自的属性。 比如MMO是一种表, UGC是一种表。甚至一些Type的属性表,可以每个Server独立维护的。 CentralAPI上只存GlobalStore一张很简单的表。可以满足显示( icon) 和交易(Price)。

注:这里将GlobalStore到官方的背包(商城)的过程也看成一种交易。比如我们在后台为每个Server的商城背包补充物品等。

背包的种类

TIP : 背包中的物品一般都是从GlobalStore中移入的

Global Store --> 某一个背包中

官方的背包 Market Place
个人的背包 Inventory : with hierachy
世界的背包 仓库

Trasactions的种类

paraworld.bag.GetBag
paraworld.bag.BuyItems
paraworld.bag.SwapItems
paraworld.bag.SendItems
paraworld.bag.DestroyItems
paraworld.store.GetItems
paraworld.store.ManageItem


paraworld.bag.GetBag

Description

取得指定用户所拥有的所有背包

Parameters

Required Name Type Description
required sessionKey string 用户凭证。
optional format int 返回的数据格式(0:XML 1:JSON),默认值为0

Example Return XML

<msg xmlns="">
        
</msg>

Example Return JSON


Error Codes

当发生异常时,返回数据中会有一个“errorCode”节点,该节点记录了错误码。

查看完整的Error Code

Test Cases

case 1

Input:

{

        

}

Result:

{

}
Topic revision: r2 - 2009-02-06 - CaoYF
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback