---++!! !AppRegistration %TOC{title="Contents:"}% %STARTINCLUDE% ---++ Registrations for applications. | *Title* | Registrations for applications. | | *Author(s)* | LiXizhi | | *Date* | 2007/12/28 | | *File* | script/kids/3DMapSystemApp/AppRegistration.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/AppRegistration.lua"); </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Registration.ConnectToAppDB requires NPL.load("(gl)script/kids/3DMapSystemApp/AppKeys.lua"); NPL.load("(gl)script/sqlite/sqlite3.lua"); ---------------------------------------- app client database ---------------------------------------- if(not Map3DSystem.App.Registration) then Map3DSystem.App.Registration={}; end default app database path Map3DSystem.App.Registration._AppDBFilePath = "Database/apps.db"; UNTESTED: connect to the client's application database. It is a database stored at Database/apps.db it is safe to call this function as many times as you like, since it will maintain the database connection. it will return the application database object. __syntax__ <verbatim>function Map3DSystem.App.Registration.ConnectToAppDB()</verbatim> ---++++ !Map3DSystem.App.Registration.CheckApp UNTESTED: check if an application is downloaded and installed on the client's computer's db. * _param_ __app__ :_key: id of the application * _return_ __bInstalled__ :, version: boolean of whether the application is installed, if it is true, the version contains the application version installed; otherwise it is nil. __syntax__ <verbatim>function Map3DSystem.App.Registration.CheckApp(app_key)</verbatim> __parameters__ | *app* | _key: id of the application | | *key* | | ---++++ !Map3DSystem.App.Registration.GetApp get application data from the database. this is faster than parsing IP.xml each time. * _return_ ____ : app table or nil __syntax__ <verbatim>function Map3DSystem.App.Registration.GetApp(app_key)</verbatim> __parameters__ | *app* | | | *key* | | | *return* | app table or nil | ---++++ !Map3DSystem.App.Registration.AddRemoveAppOnStartup NOT tested: add or remove a given app at startup time. Note: it will only remove if app is uninstallable. * _param_ __app__ :_key: app key * _param_ __UserAdded__ : boolean whether to load the app at startup time. * _return_ __true__ : if succeed. __syntax__ <verbatim>function Map3DSystem.App.Registration.AddRemoveAppOnStartup(app_key, UserAdded)</verbatim> __parameters__ | *app* | _key: app key | | *key* | | | *UserAdded* | | | *return* | if succeed. | ---++++ !Map3DSystem.App.Registration.IsAppUninstallable return true if app must not be uninstalled. __syntax__ <verbatim>function Map3DSystem.App.Registration.IsAppUninstallable(app_key)</verbatim> __parameters__ | *app* | | | *key* | | ---++++ !Map3DSystem.App.Registration.UninstallApp uninstall an application permanently from the application registration database. Note: it will only uninstall if app is uninstallable. * _return_ __true__ : if successfully uninstalled. __syntax__ <verbatim>function Map3DSystem.App.Registration.UninstallApp(app_key)</verbatim> __parameters__ | *app* | | | *key* | | | *return* | if successfully uninstalled. | ---++++ !Map3DSystem.App.Registration.InstallApp get application data from the database. this is faster than parsing IP.xml each time. * _param_ __app__ : it should be a table containing {app_key="any GUID"} * _param_ __IP__ :_file: file path of the IP.xml in the file. * _param_ __bSkipInsertDB__ : default to nil. if true, we will not insert it to DB * _return_ ____ : app table or nil __syntax__ <verbatim>function Map3DSystem.App.Registration.InstallApp(app, IP_file, bSkipInsertDB)</verbatim> __parameters__ | *app* | it should be a table containing {app_key="any GUID"} | | *IP* | | | *file* | | | *bSkipInsertDB* | default to nil. if true, we will not insert it to DB | %STOPINCLUDE%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2008-02-29
-
LiXizhi
Home
Site map
CCWeb web
HaqiTeen web
Main web
ParaEngine web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
导航页WebTopMenu
Preferences
开发指南
Getting Started
ParacraftSDK
NPL
MCML
NPL Reference Manual
美术Mod
Account
Log In
English
简体中文
簡體中文
E
dit
A
ttach
Copyright © 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