ParaWorld_Apps
a central place per application for selling and buying tradable items.
| Title |
a central place per application for selling and buying tradable items. |
| Author(s) |
LiXizhi,CYF |
| Date |
2008/1/21 |
| File |
script/kids/3DMapSystemApp/API/paraworld.apps.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemApp/API/ParaworldAPI.lua");
Member Functions
paraworld.apps.GetUserApp
create class
commonlib.setfield("paraworld.apps", {});
syntax
function paraworld.apps.GetUserApp()
paraworld.apps.AddApp
[[
if(operation = "add") //新增一个NPLApp,返回该NPLApp的Key
msg = {
"operation" = ["add"],(*)
"sessionKey" = string,(*)
["appKey"] = string, 指定此应用程序唯一键。如果没有指定此值,则系统会随机分配一个
"nplAppName" = string,(*)
"userID" = string,(*)
"userName" = string,
"desc" = string,
"downloadURL" = string,(*)
"size" = int (*)
}
if(operation = "add")
{
msg =
{
isSuccess = boolean //操作是否成功
appKey = string
[ info ] = string 发生异常时有此节点
}
}
]]
syntax
function paraworld.apps.AddApp()
paraworld.apps.RemoveApp
syntax
function paraworld.apps.RemoveApp()
paraworld.apps.GetDirectory
[[
if(operation = "get") //返回所有已开发完成的应用程序(NPLApp) 或 依主键取得一个应用程序的信息(NPLApp)
msg = {
"operation" = ["get"],(*)
"sessionKey" = string,(*)
"appID" = string //如果有值,表示“依主键取得一个应用程序的信息(NPLApp)”,否则,“返回所有已开发完成的应用程序(NPLApp)”
}
if(operation = "get")
{
if(appID is null)
msg =
{
apps[list]
{
nplAppID(string)
nplAppName(string)
userID(string)
userName(string)
desc(string)
downloadURL(string)
size(int)
approved(boolean)
showInDirectory(boolean)
finished(boolean)
installedCount(int)
}
}
]]
syntax
function paraworld.apps.GetDirectory()
Topic revision: r1 - 2008-02-29 - 15:26:12 -
LiXizhi