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. |
编辑上传到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的商城背包补充物品等。
背包的种类
: 背包中的物品一般都是从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
Example Return XML
<msg xmlns="">
</msg>
Example Return JSON
Error Codes
当发生异常时,返回数据中会有一个“errorCode”节点,该节点记录了错误码。
查看完整的
Error Code
Test Cases
case 1
Input:
{
}
Result:
{
}
*
*
*
*
*
*
*
*
*
*
*
*
*
*
paraworld.items.Create
Description
创建一个物品
Parameters
Required |
Name |
Type |
Description |
optional |
format |
int |
返回的数据格式(0:XML 1:JSON),默认值为0 |
required |
sessionKey |
string |
用户凭证。 |
AssetKey |
string |
不能大于200个字符 |
AssetFile |
string |
|
Category |
string |
|
Count |
int |
|
Icon |
string |
|
PBuyPrice |
int |
|
EBuyPrice |
int |
|
PSellPrice |
int |
|
ESellPrice |
int |
|
Name |
string |
|
Type |
byte |
1:item_template;2:app_template;3:appcommand_template;4:model_asset_template;5:texture_asset_template;6:character_asset_template;7:animation_asset_template |
if Type == 1 (item_template)
required |
Brand |
byte |
|
Brandcode |
short |
|
Expiredays |
short |
|
Class |
string |
|
Quality |
byte |
|
InventoryType |
byte |
|
AllowableGender |
byte |
|
RequiredContribution |
int |
|
RequiredTitle |
string |
|
MaxCount |
short |
|
ContainerSlots |
short |
|
Stats |
string |
多个stat之间用英文竖线分隔,stat的键与值之间用英文逗号“,”分隔,例如:1,10|2,20|3,30 |
Stackable |
short |
|
Delay |
int |
|
Spellid |
int |
|
Spellcooldown |
int |
|
Spellcharges |
int |
|
Binding |
byte |
0:no bound;1:binds when used;2:binds when equiped;3:binds when picked up;4:quest item |
Description |
string |
|
Startquest |
int |
|
Material |
byte |
|
Itemset |
int |
|
MaxComfortability |
int |
|
BagFamily |
short |
|
Duration |
int |
|
if Type == 2 (app_template)
required |
URL |
string |
|
AppKey |
string |
|
if Type == 3 (appcommand_template)
if Type == 4 (model_asset_template)
required |
Description |
string |
|
Author |
GUID |
|
IsBcscomponent |
bool |
|
Component |
byte |
|
if Type == 5 (texture_asset_template)
required |
Description |
string |
|
Author |
GUID |
|
if Type == 6 (character_asset_template)
if Type == 7 (animation_asset_template)
required |
Description |
string |
|
Author |
GUID |
|
Example Return XML
<msg xmlns="">
</msg>
Example Return JSON
Error Codes
当发生异常时,返回数据中会有一个“errorCode”节点,该节点记录了错误码。
查看完整的
Error Code
Test Cases
case 1
Input:
{
}
Result:
{
}
*
*
*
*
*
*
*
*
*
*
*
*
*
paraworld.items.Delete
Description
依主键删除一个物品
Parameters
Example Return XML
<msg xmlns="">
</msg>
Example Return JSON
Error Codes
当发生异常时,返回数据中会有一个“errorCode”节点,该节点记录了错误码。
查看完整的
Error Code
Test Cases
case 1
Input:
{
}
Result:
{
}
*
*
*
*
*
*
*
*
*
*
*
*
*
paraworld.items.Update
Description
更新指定的物品
Parameters
Required |
Name |
Type |
Description |
optional |
AssetFile |
string |
不能大于200个字符 |
optional |
Category |
string |
|
optional |
Count |
int |
|
optional |
EBuyPrice |
int |
|
optional |
ESellPrice |
int |
|
optional |
format |
int |
返回的数据格式(0:XML 1:JSON),默认值为0 |
required |
GSID |
int |
被修改的物品的主键ID |
optional |
Icon |
string |
|
optional |
Name |
string |
|
optional |
PBuyPrice |
int |
|
optional |
PSellPrice |
int |
|
required |
sessionKey |
string |
用户凭证。 |
required |
Type |
byte |
被修改的物品的Type值,不可修改,1:item_template;2:app_template;3:appcommand_template;4:model_asset_template;5:texture_asset_template;6:character_asset_template;7:animation_asset_template |
optional |
UpdatePriority |
byte |
依据此值更新版本号,0:第三位版本号revision,1:更新第二位版本号minor,2:更新第一位版本号major,默认值为0 |
if Type == 1 (item_template)
if Type == 2 (app_template)
optional |
URL |
string |
|
AppKey |
string |
|
if Type == 3 (appcommand_template)
if Type == 4 (model_asset_template)
if Type == 5 (texture_asset_template)
optional |
Description |
string |
|
if Type == 6 (character_asset_template)
if Type == 7 (animation_asset_template)
optional |
Description |
string |
|
Example Return XML
<msg xmlns="">
</msg>
Example Return JSON
Error Codes
当发生异常时,返回数据中会有一个“errorCode”节点,该节点记录了错误码。
查看完整的
Error Code
Test Cases
case 1
Input:
{
}
Result:
{
}
*
*
*
*
*
*
*
*
*
*
*
*
*
*
paraworld.items.Approve
Description
将指定的物品标记为已通过审核(只有指定的APP才可调用此接口,需要验证APPKEY和IP)
Parameters
Example Return XML
<msg xmlns="">
</msg>
Example Return JSON
Error Codes
当发生异常时,返回数据中会有一个“errorCode”节点,该节点记录了错误码。
查看完整的
Error Code
Test Cases
case 1
Input:
{
}
Result:
{
}