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的商城背包补充物品等。

背包的种类

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:

{

}
*

*

*

*

*

*

*

*


*

*

*

*

*

*

paraworld.items.Create

Description

创建一个物品

Parameters

Required Name TypeSorted ascending Description
required 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
optional format int 返回的数据格式(0:XML 1:JSON),默认值为0
required Count int  
required PBuyPrice int  
required EBuyPrice int  
required PSellPrice int  
required ESellPrice int  
required sessionKey string 用户凭证。
required AssetKey string 不能大于200个字符
required AssetFile string  
required Category string  
required Icon string  
required Name string  
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 string  
Duration int  
if Type == 2 (app_template)
required URL string  
AppKey string  
if Type == 3 (appcommand_template)
required URL string  
AppKey string  
CommandName string  
Param string  
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)
required Description string  
Author GUID  
IsCustomcharacter bool  
IsSupportcartoonface bool  
Gender byte  
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

Required Name Type Description
required sessionKey string 用户凭证。
GSID int 物品主键ID
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
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:

{

}
*

*

*

*

*

*

*


*

*

*

*

*

*

paraworld.items.Update

Description

更新指定的物品

Parameters

Required Name Type Description
optional format int 返回的数据格式(0:XML 1:JSON),默认值为0
required sessionKey string 用户凭证。
GSID int 被修改的物品的主键ID
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 AssetFile string 不能大于200个字符
Category string  
Count int  
Icon string  
PBuyPrice int  
EBuyPrice int  
PSellPrice int  
ESellPrice int  
Name string  
UpdatePriority byte 依据此值更新版本号,0:第三位版本号revision,1:更新第二位版本号minor,2:更新第一位版本号major,默认值为0
if Type == 1 (item_template)
optional Brand byte  
Brandcode short  
Expiredays short  
Class string  
Quality byte  
InventoryType byte  
AllowableGender byte  
RequiredContribution int  
RequiredTitle string  
MaxCount short  
ContainerSlots short  
Stats string  
Stackable short  
Delay int  
Spellid int  
Spellcooldown int  
Spellcharges int  
Binding byte  
Description string  
Startquest int  
Material byte  
Itemset int  
MaxComfortability int  
BagFamily string  
Duration int  
if Type == 2 (app_template)
optional URL string  
AppKey string  
if Type == 3 (appcommand_template)
required URL string  
AppKey string  
CommandName string  
Param string  
if Type == 4 (model_asset_template)
optional Description string  
IsBcscomponent bool  
Component byte  
if Type == 5 (texture_asset_template)
optional Description string  
if Type == 6 (character_asset_template)
optional Description string  
Author GUID  
IsCustomcharacter bool  
IsSupportcartoonface bool  
Gender byte  
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

将指定的物品标记为已通过审核(只有指定的角色成员才可使用此功能)

Parameters

Required Name Type Description
required sessionKey string 用户凭证。
GSID int 物品主键ID
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:

{

}

*

*

*

*

*

*

*

*


*

*

*

*

*

paraworld.items.Read

Description

取得指定的物品的详细数据

Parameters

Required Name Type Description
required GSID int 物品ID
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
optional format int 返回的数据格式(0:XML 1:JSON),默认值为0

Example Return XML

<msg>
  <GSID type="double">4</GSID> 
  <Type type="byte">5</Type> 
  <AssetKey type="string">http://asset.pala5.cn/Texture/MainMenu_Btn_32bits.png</AssetKey> 
  <AssetFile type="string">http://asset.pala5.cn/Texture/Aquarius/Desktop/MainMenu_Btn_32bits.png</AssetFile> 
  <IsApproved type="boolean">False</IsApproved> 
  <Category type="string">model/char</Category> 
  <Count type="double">0</Count> 
  <Icon type="string">Texture/Aquarius/Desktop/MainMenu_Btn_32bits.png</Icon> 
  <PBuyPrice type="double">123</PBuyPrice> 
  <EBuyPrice type="double">124</EBuyPrice> 
  <PSellPrice type="double">125</PSellPrice> 
  <ESellPrice type="double">126</ESellPrice> 
  <Batched type="double">0</Batched> 
  <Name type="string">test</Name> 
  <Version type="string">1.0.0</Version> 
  <Description type="string">Main menu button</Description> 
  <Author type="string">6ea770c6-92b2-4b2b-86da-6f574641ec11</Author> 
  <UploadDate type="string">2009-2-20 19:56:27</UploadDate> 
  <ModifyDate type="string">2009-2-20 19:56:27</ModifyDate> 
  <ID type="double">2</ID> 
  </msg>

Example Return JSON

{"GSID":4,"Type":5,"AssetKey":"http://asset.pala5.cn/Texture/MainMenu_Btn_32bits.png",
"AssetFile":"http://asset.pala5.cn/Texture/Aquarius/Desktop/MainMenu_Btn_32bits.png",
"IsApproved":false,"Category":"model/char","Count":0,
"Icon":"Texture/Aquarius/Desktop/MainMenu_Btn_32bits.png","PBuyPrice":123,
"EBuyPrice":124,"PSellPrice":125,"ESellPrice":126,"Batched":0,"Name":"test",
"Version":"1.0.0","Description":"Main menu button",
"Author":"6ea770c6-92b2-4b2b-86da-6f574641ec11","UploadDate":"2009-2-20 19:56:27",
"ModifyDate":"2009-2-20 19:56:27","ID":2}

Error Codes

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

查看完整的Error Code

Test Cases

case 1

Input:

{

        

}

Result:

{

}
*

*

*

*

*

*

*


*

*

*

*

*

*

*

paraworld.items.ChangeBag

Description

将指定的物品标记为已通过审核(只有指定的角色成员才可使用此功能)

Parameters

Required Name Type Description
required sessionKey string 用户凭证。
fromBagID int 从哪个包移出
fromPosition byte 被移动的物品所在包中的位置
toBagID int 目标包
toPosition short 负数表示未指定。如果未指定目标位置,则放置在第一个存放相同类型的物品的格子中,如果第一个位置放不下,则将剩余的放入第二个格子,以此类推,如果仍然放不下,则放置在第一个空格子上,如果没有空格子,则失败
cnt int 移动物品的数目,-1表示全部
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: r12 - 2009-03-10 - CaoYF
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback