---++!! !LoginAppDev __description__: 鎻愪緵鍚勭鏍峰紡鐨勭櫥闄嗕笌璁よ瘉绐楀彛銆傛敮鎸佸畼缃戝拰绗笁鏂硅璇佹柟寮忥紝搴旂敤绋嬪簭寮€鍙戝晢鍜岀敤鎴烽兘鍙互浣跨敤銆 %TOC{title="Contents:"}% %STARTINCLUDE% ---++ Login App for Paraworld. Provides different styles of login windows for apps. Login app can be used by any other official | *Title* | Login App for Paraworld. Provides different styles of login windows for apps. Login app can be used by any other official | | *Author(s)* | LiXizhi | | *Date* | 2008/1/24 | | *File* | script/kids/3DMapSystemApp/Login/app_main.lua | ---+++ Description db registration insert script INSERT INTO apps VALUES (NULL, 'Login_GUID', 'Login', '1.0.0', 'http://www.paraengine.com/apps/Login_v1.zip', 'YourCompany', 'enUS', 'script/kids/3DMapSystemApp/Login/IP.xml', '', 'script/kids/3DMapSystemApp/Login/app_main.lua', 'Map3DSystem.App.Login.MSGProc', 1); %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Login/app_main.lua"); </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Login.OnConnection requires create class commonlib.setfield("Map3DSystem.App.Login", {}); ------------------------------------------- event handlers ------------------------------------------- OnConnection method is the obvious point to place your UI (menus, mainbars, tool buttons) through which the user will communicate to the app. This method is also the place to put your validation code if you are licensing the add-in. You would normally do this before putting up the UI. If the user is not a valid user, you would not want to put the UI into the IDE. * _param_ __app__ : the object representing the current application in the IDE. * _param_ __connectMode__ : type of Map3DSystem.App.ConnectMode. __syntax__ <verbatim>function Map3DSystem.App.Login.OnConnection(app, connectMode)</verbatim> __parameters__ | *app* | the object representing the current application in the IDE. | | *connectMode* | | ---++++ !Map3DSystem.App.Login.OnDisconnection Receives notification that the Add-in is being unloaded. __syntax__ <verbatim>function Map3DSystem.App.Login.OnDisconnection(app, disconnectMode)</verbatim> __parameters__ | *app* | | | *disconnectMode* | | ---++++ !Map3DSystem.App.Login.OnQueryStatus This is called when the command's availability is updated When the user clicks a command (menu or mainbar button), the QueryStatus event is fired. The QueryStatus event returns the current status of the specified named command, whether it is enabled, disabled, or hidden in the CommandStatus parameter, which is passed to the msg by reference (or returned in the event handler). * _param_ __commandName__ : The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". * _param_ __statusWanted__ : what status of the command is queried. it is of type Map3DSystem.App.CommandStatusWanted * _return_ ____ : returns according to statusWanted. it may return an integer by adding values in Map3DSystem.App.CommandStatus. __syntax__ <verbatim>function Map3DSystem.App.Login.OnQueryStatus(app, commandName, statusWanted)</verbatim> __parameters__ | *app* | | | *commandName* | The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". | | *statusWanted* | | | *return* | returns according to statusWanted. it may return an integer by adding values in Map3DSystem.App.CommandStatus. | ---++++ !Map3DSystem.App.Login.OnExec This is called when the command is invoked.The Exec is fired after the QueryStatus event is fired, assuming that the return to the statusOption parameter of QueryStatus is supported and enabled. This is the event where you place the actual code for handling the response to the user click on the command. * _param_ __commandName__ : The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". __syntax__ <verbatim>function Map3DSystem.App.Login.OnExec(app, commandName, params)</verbatim> __parameters__ | *app* | | | *commandName* | The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". | | *params* | | ---++++ !Map3DSystem.App.Login.OnRenderBox Change and render the 3D world with mcml data that is usually retrieved from the current user's profile page for this application. __syntax__ <verbatim>function Map3DSystem.App.Login.OnRenderBox(mcmlData)</verbatim> __parameters__ | *mcmlData* | | ---++++ !Map3DSystem.App.Login.Navigate called when the user wants to nagivate to the 3D world location relavent to this application __syntax__ <verbatim>function Map3DSystem.App.Login.Navigate()</verbatim> ---++++ !Map3DSystem.App.Login.GotoHomepage called when user clicks to check out the homepage of this application. Homepage usually includes: developer info, support, developer worlds information, app global news, app updates, all community user rating, active users, trade, currency transfer, etc. __syntax__ <verbatim>function Map3DSystem.App.Login.GotoHomepage()</verbatim> ---++++ !Map3DSystem.App.Login.DoQuickAction called when user clicks the quick action for this application. __syntax__ <verbatim>function Map3DSystem.App.Login.DoQuickAction()</verbatim> ---++++ !Map3DSystem.App.Login.MSGProc ------------------------------------------- client world database function helpers. ------------------------------------------- ------------------------------------------ all related messages ------------------------------------------ ----------------------------------------------------- APPS can be invoked in many ways: Through app Manager mainbar or menu command or buttons Command Line 3D World installed apps ----------------------------------------------------- __syntax__ <verbatim>function Map3DSystem.App.Login.MSGProc(window, msg)</verbatim> __parameters__ | *window* | | | *msg* | | ---++ Application registration page container | *Title* | Application registration page container | | *Author(s)* | LiXizhi | | *Date* | 2008/3/21 | | *File* | script/kids/3DMapSystemApp/Login/AppRegPage.lua | ---+++ Description show registration page for those whose status.RequiredComplete is false. %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Login/AppRegPage.lua"); Map3DSystem.App.Login.AppRegPage.RequiredApps = { {name="CCS", title = "select avatar", {RequiredComplete = false, CompleteProgress=0}}, {name="profiles", title = "edit profile", {RequiredComplete = false, CompleteProgress=0}}, {name="Map", title = "select land", {RequiredComplete = true, CompleteProgress=1}} }; local width, height = 640, 512 Map3DSystem.App.Login.AppRegPage:Create("LoginApp.AppRegPage", nil, "_ct", -width/2, -height/2, width, height); </verbatim> ---+++ Member Functions ---++++ !AppRegPage:OnLoad create class local AppRegPage = Map3DSystem.mcml.PageCtrl:new({url="script/kids/3DMapSystemApp/Login/AppRegPage.html"}); Map3DSystem.App.Login.AppRegPage = AppRegPage; a table describing which apps needs to show registration page AppRegPage.RequiredApps = nil; function to be called when user completed or skipped all app registration steps. AppRegPage.OnFinishedFunc = nil; this function is overridable. it is called before page UI is about to be created. * _param_ __self__ :.mcmlNode: the root pe:mcml node, one can modify it here before the UI is created, such as filling in default data. __syntax__ <verbatim>function AppRegPage:OnLoad()</verbatim> ---++++ !AppRegPage:RefreshTitle call this function to refresh the title step.e.g. 1 avatar, 2 profile, 3 land. * _param_ __currentStep__ : the currently selected index in RequiredApps * _param_ __refreshUI__ : if true, it will refresh UI in title bar, otherwise it will only change the MCML accordingly. __syntax__ <verbatim>function AppRegPage:RefreshTitle(currentStep, refreshUI)</verbatim> __parameters__ | *currentStep* | the currently selected index in RequiredApps | | *refreshUI* | | ---++++ !AppRegPage:OnCreate this function is overridable. it is called after page UI is created. One can perform any processing steps that are set to occur on each page request. You can access view state information. You can also access controls within the page's control hierarchy. In other words, one can have direct access to UI object created in the page control. Note that some UI are lazy created such as treeview item and tab view items. They may not be available here yet. __syntax__ <verbatim>function AppRegPage:OnCreate()</verbatim> ---++++ !AppRegPage.OnNextApp --------------------------------- page event handlers --------------------------------- When clicks the basic info save button in the MCML page: ProfileAppRegPage.html __syntax__ <verbatim>function AppRegPage.OnNextApp(sCtrlName, values)</verbatim> __parameters__ | *sCtrlName* | | | *values* | | ---++++ !AppRegPage.OnSkipAll When clicks the contact info save button in the MCML page: ProfileAppRegPage.html __syntax__ <verbatim>function AppRegPage.OnSkipAll(sCtrlName, values)</verbatim> __parameters__ | *sCtrlName* | | | *values* | | ---++ AutoPatcher | *Title* | AutoPatcher | | *Author(s)* | Leio Zhang | | *Date* | 2008/7/30 | | *File* | script/kids/3DMapSystemApp/Login/AutoPatcher.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Login/AutoPatcher.lua"); </verbatim> ---++ AutoPatcherPage.html code-behind script | *Title* | AutoPatcherPage.html code-behind script | | *Author(s)* | LiXizhi | | *Date* | 2008/7/24 | | *File* | script/kids/3DMapSystemApp/Login/AutoPatcherPage.lua | ---+++ Description ---++ using autopatch to update to laset version Auto Patcher is an mcml application page to auto patch a given list of files to their latest version. One can specify the src patch files url and the destination (local patch file) as below. <verbatim> script/kids/3DMapSystemApp/Login/AutoPatcherPage.html?src=http://files.pala5.com/patchfiles.txt&dest=patchfiles.txt </verbatim> The patchfiles.txt contains a list of patch files and their patch versions. below is an example <verbatim> version=1.0.0.3, "/" version=1.0.0.2, "c:/versions/1.0.0.2/" version=1.0.0.1, "c:/versions/1.0.0.1/" version=1.0.0.0, "c:/versions/1.0.0.0/" defaultserver=http://files.pala5.com files 4 "/patches_1_0_0_3/packages/startup/art_model_char-1.0(3_to_4).patch" "packages/startup/art_model_char-1.0.pkg" 3 "/patches_1_0_0_3/packages/startup/art_model_char-1.0(2_to_3).patch" "packages/startup/art_model_char-1.0.pkg" 2 "/patches_1_0_0_3/packages/startup/art_model_char-1.0(1_to_2).patch" "packages/startup/art_model_char-1.0.pkg" 2 "/patches_1_0_0_3/main(1_to_2).patch" "main.pkg" 2 "/patches_1_0_0_3/paraworld(1_to_2).patch" "paraworld.exe" 1 "" "readme.txt" </verbatim> * version mean that it is able to upgrade from any versions from 1.0.0.0 to 1.0.0.3, the second parameter is the src folder where to locate the src files for that version. * defaultserver is the root directory of remote patch files. * each file line contains file_version_after_patching remote_patch_file_url local_file_to_patch * please note that file_version_after_patching is always an integer and there might be multiple patch files for the same dest file with decreasing file version as in the example. * if file_version_after_patching is 1, it means that it is the original (initial) version and the patch file is always empty. ---++ generate autopatch files one can generate patch files from a previous patch file. It will include all file patches from the previous patch plus their newest versions for example, the initial patch file may contain just a list of files that are tracked for patching. such as <verbatim> version=1.0.0.0, "/" defaultserver=http://files.pala5.com files 1 "" "packages/startup/art_model_char-1.0.pkg" 1 "" "main.pkg" 1 "" "paraworld.exe" 1 "" "readme.txt" </verbatim> <verbatim> version=1.0.0.1, "/" version=1.0.0.0, "c:/versions/1.0.0.0/" defaultserver=http://files.pala5.com files 1 "" "packages/startup/art_model_char-1.0.pkg" 1 "" "main.pkg" 1 "" "paraworld.exe" 1 "" "readme.txt" </verbatim> ---++ patching procedure When the platform start, it first checks the server version to see if the client is up to date. If not, it will download a patch (index) file to a temp location. If the latest patch file can upgrade from the local patch file, then we will apply the patch. Otherwise we will inform the user to download the major installer. %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Login/AutoPatcherPage.lua"); script/kids/3DMapSystemApp/Login/AutoPatcherPage.html?src=http://192.168.0.221:8111/testPatch/patchfiles.xml </verbatim> ---+++ Member Functions ---++++ !AutoPatcherPage.singleFileProgressEvent Creating the patch file(s) Make sure you have the source file (original version) and the target file (version to update to). For example, I have DATA.DTA (currently on user system) and DATA_20.DTA (v2.0 of this data file). Now call GenPat.exe: GENPAT (sourcefile) (targetfile) (patchfile) local GenPat_path = "script/bin/VPatch/GenPat.exe" local VAppend_path = "script/bin/VPatch/VAppend.exe" stand-alone runtime and patch VPATCHPROMPT.EXE (patchfile) (sourcefile) (outputfile) local vpatchprompt_path = "script/bin/VPatch/vpatchprompt.exe" __syntax__ <verbatim>function AutoPatcherPage.singleFileProgressEvent(src,percent)</verbatim> __parameters__ | *src* | | | *percent* | | ---++++ !AutoPatcherPage.GeneratePatchFiles generate patch files * _param_ __patchfile__ : file path of the patch file * _param_ __destfolder__ : to which folder the patch files are generated. __syntax__ <verbatim>function AutoPatcherPage.GeneratePatchFiles(patchfile, destfolder)</verbatim> __parameters__ | *patchfile* | file path of the patch file | | *destfolder* | | ---++++ !AutoPatcherPage.OnClickApplyPatch on click generate patch __syntax__ <verbatim>function AutoPatcherPage.OnClickApplyPatch(btnName, values)</verbatim> __parameters__ | *btnName* | | | *values* | | ---++++ !AutoPatcherPage.ApplyPatchFiles generate patch files * _param_ __patchfile__ : file path of the patch file __syntax__ <verbatim>function AutoPatcherPage.ApplyPatchFiles(patchfile)</verbatim> __parameters__ | *patchfile* | file path of the patch file | ---++ CG page: displaying paraworld CG movie in a panel or window. | *Title* | CG page: displaying paraworld CG movie in a panel or window. | | *Author(s)* | LiXizhi | | *Date* | 2008/1/28 | | *File* | script/kids/3DMapSystemApp/Login/CGPage.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Login/CGPage.lua"); Map3DSystem.App.Login.CGPage.ShowWnd(app); Map3DSystem.App.Login.CGPage.Show(bShow, _parent, parentWindow) </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Login.CGPage.ShowWnd common control library NPL.load("(gl)script/ide/common_control.lua"); commonlib.setfield("Map3DSystem.App.Login.CGPage", {}); local VideoFilePath = "Texture/3DMapSystem/Startup/paraworldCG_320_240.flv"; display the main inventory window for the current user. __syntax__ <verbatim>function Map3DSystem.App.Login.CGPage.ShowWnd(_app)</verbatim> __parameters__ | *app* | | ---++++ !Map3DSystem.App.Login.CGPage.Show * _param_ __bShow__ : boolean to show or hide. if nil, it will toggle current setting. * _param_ ____ :_parent: parent window inside which the content is displayed. it can be nil. __syntax__ <verbatim>function Map3DSystem.App.Login.CGPage.Show(bShow, _parent, parentWindow)</verbatim> __parameters__ | *bShow* | boolean to show or hide. if nil, it will toggle current setting. | | *parent* | | | *parentWindow* | | ---++++ !Map3DSystem.App.Login.CGPage.OnDestory destory the control __syntax__ <verbatim>function Map3DSystem.App.Login.CGPage.OnDestory()</verbatim> ---++ LoggedInHomePage.html code-behind script | *Title* | LoggedInHomePage.html code-behind script | | *Author(s)* | LiXizhi | | *Date* | 2008/5/19 | | *File* | script/kids/3DMapSystemApp/Login/LoggedInHomePage.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Login/LoggedInHomePage.lua"); </verbatim> ---+++ Member Functions ---++++ !LoggedInHomePage.OnInit create class local LoggedInHomePage = {}; Map3DSystem.App.Login.LoggedInHomePage = LoggedInHomePage; __syntax__ <verbatim>function LoggedInHomePage.OnInit()</verbatim> ---++++ !LoggedInHomePage.ClearFeed --------------------------------- page event handlers --------------------------------- category is nil or "" __syntax__ <verbatim>function LoggedInHomePage.ClearFeed(category)</verbatim> __parameters__ | *category* | | ---++ LoginPage.html code-behind script | *Title* | LoginPage.html code-behind script | | *Author(s)* | LiXizhi | | *Date* | 2008/6/8 | | *File* | script/kids/3DMapSystemApp/Login/LoginPage.lua | ---+++ Description %T% __Sample Code__ <verbatim> </verbatim> ---++ The login and registration procedure. | *Title* | The login and registration procedure. | | *Author(s)* | LiXizhi | | *Date* | 2008/3/18 | | *File* | script/kids/3DMapSystemApp/Login/LoginProcedure.lua | ---+++ Description The (Login|Registration)->Download user profile->Require application registration status->Show uncompleted registration steps->CallbackFunc(Show profile) %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Login/LoginProcedure.lua"); Map3DSystem.App.Login.Proc_Authentication(values); </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Login.Proc_Authentication Authenticate user and proceed to Proc_DownloadProfile(). it will assume the normal login procedures. It starts with authentification and ends with callback function or user profile page. * _param_ __values__ : a table containing authentification info {username, password, domain}. username, password should be validated locally before passing them here. * _param_ __funcCallBack__ : this is a callback function to be invoked when login complete. If nil, it will display the profile page for the user. * _param_ __bSkipAppRegistration__ : whether to skip uncompleted application registration. __syntax__ <verbatim>function Map3DSystem.App.Login.Proc_Authentication(values, funcCallBack, bSkipAppRegistration)</verbatim> __parameters__ | *values* | a table containing authentification info {username, password, domain}. username, password should be validated locally before passing them here. | | *funcCallBack* | | | *bSkipAppRegistration* | whether to skip uncompleted application registration. | ---++++ !Map3DSystem.App.Login.Proc_DownloadProfile Download profile and proceed to Proc_AppReg() __syntax__ <verbatim>function Map3DSystem.App.Login.Proc_DownloadProfile()</verbatim> ---++++ !Map3DSystem.App.Login.Proc_AppReg Require application registration status->Show uncompleted registration steps In order for an application to have a registration page with this login application. The app must install and implement a command as below: The command name must be "Registration.AppName", such as "Registration.ProfileApp" The command must recognize input {operation="query|show", callbackFunc = nil, browsername, parent} if operation is "query", the command must immediately return a registration status table, containing about the registration complete progress. see below status = { RequiredComplete=true, -- whether required fields have been completed CompleteProgress=0.2, -- the overall completeness in percentage. } if operation is "show", msg.callbackFunc should be called when the returned. msg.browsername and msg.parent maybe used to display the registration page. If none of them are present, an application display its own windows at the center of the screen. __syntax__ <verbatim>function Map3DSystem.App.Login.Proc_AppReg()</verbatim> ---++++ !Map3DSystem.App.Login.Proc_Complete login procedure completed. __syntax__ <verbatim>function Map3DSystem.App.Login.Proc_Complete()</verbatim> ---++ standard Login window | *Title* | standard Login window | | *Author(s)* | LiXizhi | | *Date* | 2008/1/24 | | *File* | script/kids/3DMapSystemApp/Login/LoginWnd.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Login/LoginWnd.lua"); Map3DSystem.App.Login.ShowLoginWnd(app); </verbatim> ---+++ Member Functions ---++++ !LoginWnd.SwitchTabWindow common control library NPL.load("(gl)script/ide/common_control.lua"); local L = CommonCtrl.Locale("IDE"); NPL.load("(gl)script/kids/3DMapSystemApp/API/ParaworldAPI.lua"); create class local LoginWnd = {}; commonlib.setfield("Map3DSystem.App.Login.LoginWnd", LoginWnd); predefined addresses LoginWnd.CommunitySite = CommonCtrl.Locale("KidsUI")("community.aspx"); LoginWnd.RegistrationPage = CommonCtrl.Locale("KidsUI")("Register.aspx") tab pages LoginWnd.tabpages = {"loginbox_login", "loginbox_alreadylogin", "loginbox_waiting", }; * _param_ __nIndex__ : 1 or 2 or 3 __syntax__ <verbatim>function LoginWnd.SwitchTabWindow(nIndex)</verbatim> __parameters__ | *nIndex* | 1 or 2 or 3 | ---++++ !Map3DSystem.App.Login.LoginWnd.Show * _param_ __bShow__ : boolean to show or hide. if nil, it will toggle current setting. * _param_ ____ :_parent: parent window inside which the content is displayed. it can be nil. __syntax__ <verbatim>function Map3DSystem.App.Login.LoginWnd.Show(bShow, _parent, parentWindow)</verbatim> __parameters__ | *bShow* | boolean to show or hide. if nil, it will toggle current setting. | | *parent* | | | *parentWindow* | | ---++++ !LoginWnd.SetLoginCallBack callback function LoginWnd.OnSignedIn = nil; set the call back function which will be called after user successfully logs in. __syntax__ <verbatim>function LoginWnd.SetLoginCallBack(funcPtr)</verbatim> __parameters__ | *funcPtr* | | ---++++ !LoginWnd.OnClickGotoCommunitySite open the community website __syntax__ <verbatim>function LoginWnd.OnClickGotoCommunitySite()</verbatim> ---++++ !LoginWnd.Close close window __syntax__ <verbatim>function LoginWnd.Close()</verbatim> ---++++ !LoginWnd.OnClickBtnLogin called when user logs in. __syntax__ <verbatim>function LoginWnd.OnClickBtnLogin(sCtrlName)</verbatim> __parameters__ | *sCtrlName* | | ---++++ !LoginWnd.AuthUser_Callback web service call back __syntax__ <verbatim>function LoginWnd.AuthUser_Callback(msg, params)</verbatim> __parameters__ | *msg* | | | *params* | | ---++++ !LoginWnd.CheckVersion check whether the client needs to be updated. __syntax__ <verbatim>function LoginWnd.CheckVersion()</verbatim> ---++++ !LoginWnd.OnClickRegister open our community web site's registration page __syntax__ <verbatim>function LoginWnd.OnClickRegister()</verbatim> ---++++ !Map3DSystem.App.Login.ShowLoginWnd display the main Login window for the current user. __syntax__ <verbatim>function Map3DSystem.App.Login.ShowLoginWnd(_app)</verbatim> __parameters__ | *app* | | ---++ The ParaWorld Start Page | *Title* | The ParaWorld Start Page | | *Author(s)* | LiXizhi | | *Date* | 2008/1/28 | | *File* | script/kids/3DMapSystemApp/Login/ParaworldStartPage.lua | ---+++ Description it contains a user customizable mini scene and a MCML browser window. The browser window will show StartPage.html by default if the command line contains "startpage", it will be used as startup page ---++ Switch front page url. one can call below to navigate the front page to a different url. <verbatim> Map3DSystem.App.Login.GotoPage(url, cachePolicy) </verbatim> %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Login/ParaworldStartPage.lua"); Map3DSystem.App.Login.ParaworldStartPage.ShowWnd(app); Map3DSystem.App.Login.ParaworldStartPage.Show(bShow, _parent, parentWindow) Map3DSystem.App.Login.GotoPage(url, cachePolicy) </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Login.ParaworldStartPage.ShowWnd <verbatim> common control library NPL.load("(gl)script/ide/common_control.lua"); commonlib.setfield("Map3DSystem.App.Login.ParaworldStartPage", {}); attributes: Map3DSystem.App.Login.StartPageUrl = "%WIKI%/Main/ParaWorldStartPageMCML"; Map3DSystem.App.Login.StartPageUrl = "script/kids/3DMapSystemApp/Login/StartPage.html"; Map3DSystem.App.Login.RegPageUrl = "%WIKI%/Main/ParaWorldNewUserRegPageMCML"; Map3DSystem.App.Login.RegPageUrl = "script/kids/3DMapSystemApp/Login/NewUserRegPage.html"; login app browser name. Map3DSystem.App.Login.browsername = "LoginWnd.ActiveDesktopMCML"; ------------------------------------------ app config -- "ShowAddressBar": whether to show address bar, default to false. "StartPageMCML": url of start page default to Map3DSystem.App.Login.StartPageUrl "InitScene": a table of {Text = "缂虹渷鑳屾櫙",FilePath = "worlds/login_world", bRenderNPC = true, bRenderPlayer = nil,} default to Map3DSystem.App.Login.DefaultBGScenes[1] "RecentlyOpenedScenes": a list of table of {Text = "缂虹渷鑳屾櫙",FilePath = "worlds/login_world", bRenderNPC = true, bRenderPlayer = nil,} ------------------------------------------ private: the last bgInfo Map3DSystem.App.Login.ParaworldStartPage.LastBGInfo = nil; system bg files. local DefaultBGScenes = { { -- Display Name Text = L"瀹樻柟缂虹渷鑳屾櫙", -- world path, either zip file or disk folder is supported. *.jpg, *.png, *.dds, *.bmp, *.avi, *.wmv,*.swf, is also supported. FilePath = "worlds/MyWorlds/LoginWorld", -- render to render NPC bRenderNPC = true, -- whether to render the current player at zero position. bRenderPlayer = true, }, { -- Display Name Text = L"鏂版墜鏉戣儗鏅?, -- world path, either zip file or disk folder is supported. *.jpg, *.png, *.dds, *.bmp, *.avi, *.wmv,*.swf, is also supported. FilePath = L"worlds/Official/鏂版墜涔嬭矾", -- render to render NPC bRenderNPC = true, -- whether to render the current player at zero position. bRenderPlayer = true, }, --{ ---- Display Name --Text = "瀹樻柟鏂伴椈", ---- world path, either zip file or disk folder is supported. *.jpg, *.png, *.dds, *.bmp, *.avi, *.wmv,*.swf, is also supported. --FilePath = "Texture/productcover_cn.png", ---- render to render NPC --bRenderNPC = true, ---- whether to render the current player at zero position. --bRenderPlayer = nil, --}, }</verbatim>; Map3DSystem.App.Login.DefaultBGScenes = DefaultBGScenes; show the desktop window __syntax__ <verbatim>function Map3DSystem.App.Login.ParaworldStartPage.ShowWnd(_app)</verbatim> __parameters__ | *app* | | ---++++ !Map3DSystem.App.Login.ParaworldStartPage.Show * _param_ __bShow__ : boolean to show or hide. if nil, it will toggle current setting. * _param_ ____ :_parent: parent window inside which the content is displayed. it can be nil. * _param_ __url__ : if nil, it will show the default startup page. otherwise the url is shown. __syntax__ <verbatim>function Map3DSystem.App.Login.ParaworldStartPage.Show(bShow, _parent, parentWindow, url)</verbatim> __parameters__ | *bShow* | boolean to show or hide. if nil, it will toggle current setting. | | *parent* | | | *parentWindow* | | | *url* | if nil, it will show the default startup page. otherwise the url is shown. | ---++++ !Map3DSystem.App.Login.ParaworldStartPage.OnClickSwitchBG user clicked to change bg __syntax__ <verbatim>function Map3DSystem.App.Login.ParaworldStartPage.OnClickSwitchBG(treeNode)</verbatim> __parameters__ | *treeNode* | | ---++++ !Map3DSystem.App.Login.ParaworldStartPage.OnClickBGFromFile allow the user to open a bg from a world, image file, etc. __syntax__ <verbatim>function Map3DSystem.App.Login.ParaworldStartPage.OnClickBGFromFile()</verbatim> ---++++ !Map3DSystem.App.Login.ParaworldStartPage.SwitchBG <verbatim>[[ switching to the bg * _param_ __bgInfo__ : if nil, an empty bg is used, otherwise { -- Display Name Text = "甯曟媺宸己鐪佽儗鏅?, -- world path, either zip file or disk folder is supported. *.jpg, *.png, *.dds, *.bmp, *.avi, *.wmv,*.swf, is also supported. FilePath = "worlds/login_world", -- render to render NPC bRenderNPC = true, -- whether to render the current player at zero position. bRenderPlayer = nil, }</verbatim> * _return_ ____ : return true if succeed. ]] __syntax__ <verbatim>function Map3DSystem.App.Login.ParaworldStartPage.SwitchBG(bgInfo)</verbatim> __parameters__ | *bgInfo* | if nil, an empty bg is used, otherwise { -- Display Name Text = "甯曟媺宸己鐪佽儗鏅?, -- world path, either zip file or disk folder is supported. *.jpg, *.png, *.dds, *.bmp, *.avi, *.wmv,*.swf, is also supported. FilePath = "worlds/login_world", -- render to render NPC bRenderNPC = true, -- whether to render the current player at zero position. bRenderPlayer = nil, }</verbatim> | ---++++ !Map3DSystem.App.Login.ParaworldStartPage.ShowBGSelectionMenu bring up a context menu for selecting which bg to display. __syntax__ <verbatim>function Map3DSystem.App.Login.ParaworldStartPage.ShowBGSelectionMenu()</verbatim> ---++++ !Map3DSystem.App.Login.ParaworldStartPage.OnDestory destory the control __syntax__ <verbatim>function Map3DSystem.App.Login.ParaworldStartPage.OnDestory()</verbatim> ---++++ !Map3DSystem.App.Login.ParaworldStartPage.OnMCML_UserRegister ---------------------------------- MCML page event handlers ---------------------------------- User filled out the registration form and submitted * _param_ __values__ : username, password, password_confirm, birth_day, birth_month, birth_year, email, gender __syntax__ <verbatim>function Map3DSystem.App.Login.ParaworldStartPage.OnMCML_UserRegister(btnName, values, bindingContext)</verbatim> __parameters__ | *btnName* | | | *values* | username, password, password_confirm, birth_day, birth_month, birth_year, email, gender | | *bindingContext* | | ---++++ !Map3DSystem.App.Login.OnClickNewAccount user clicks to register a new account. __syntax__ <verbatim>function Map3DSystem.App.Login.OnClickNewAccount()</verbatim> ---++++ !Map3DSystem.App.Login.GotoPage go to a given page * _param_ __url__ : url of the page * _param_ __cachePolicy__ : nil or a cache policy. if nil, it defaults to 1 day. __syntax__ <verbatim>function Map3DSystem.App.Login.GotoPage(url, cachePolicy)</verbatim> __parameters__ | *url* | url of the page | | *cachePolicy* | | ---++ settings.html code-behind script | *Title* | settings.html code-behind script | | *Author(s)* | LiXizhi | | *Date* | 2008/4/18 | | *File* | script/kids/3DMapSystemApp/Login/setting.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Login/setting.lua"); Map3DSystem.App.Login.SettingPage:Create("LoginApp.SettingPage", nil, "_ct", -width/2, -height/2, width, height); </verbatim> ---+++ Member Functions ---++++ !SettingPage.OnInit create class local SettingPage = Map3DSystem.mcml.PageCtrl:new({url="script/kids/3DMapSystemApp/Login/SettingPage.html"}); Map3DSystem.App.Login.SettingPage = SettingPage; this function is overridable. it is called before page UI is about to be created. * _param_ __self__ :.mcmlNode: the root pe:mcml node, one can modify it here before the UI is created, such as filling in default data. __syntax__ <verbatim>function SettingPage.OnInit()</verbatim> ---++++ !SettingPage.UseCurrentPageBtn --------------------------------- page event handlers --------------------------------- When clicks the button __syntax__ <verbatim>function SettingPage.UseCurrentPageBtn(sCtrlName, values)</verbatim> __parameters__ | *sCtrlName* | | | *values* | | ---++++ !SettingPage.UseDefaultBtn When clicks the button __syntax__ <verbatim>function SettingPage.UseDefaultBtn(sCtrlName, values)</verbatim> __parameters__ | *sCtrlName* | | | *values* | | ---++++ !SettingPage.UseBlankPageBtn When clicks the button __syntax__ <verbatim>function SettingPage.UseBlankPageBtn(sCtrlName, values)</verbatim> __parameters__ | *sCtrlName* | | | *values* | | ---++++ !SettingPage.UseDefaultSceneBtn When clicks the button __syntax__ <verbatim>function SettingPage.UseDefaultSceneBtn(sCtrlName, values)</verbatim> __parameters__ | *sCtrlName* | | | *values* | | ---++++ !SettingPage.UseBlankSceneBtn When clicks the button __syntax__ <verbatim>function SettingPage.UseBlankSceneBtn(sCtrlName, values)</verbatim> __parameters__ | *sCtrlName* | | | *values* | | ---++++ !SettingPage.Open3DBackgroundBtn allow the user to open a bg from a world, image file, etc. __syntax__ <verbatim>function SettingPage.Open3DBackgroundBtn()</verbatim> ---++++ !SettingPage.SaveCommonBtn saved the common form. __syntax__ <verbatim>function SettingPage.SaveCommonBtn(sCtrlName, values)</verbatim> __parameters__ | *sCtrlName* | | | *values* | | ---++++ !SettingPage.SaveConnectionBtn saved the connection form. __syntax__ <verbatim>function SettingPage.SaveConnectionBtn(sCtrlName, values)</verbatim> __parameters__ | *sCtrlName* | | | *values* | | ---++ TutorialPage.html code-behind script | *Title* | TutorialPage.html code-behind script | | *Author(s)* | LiXizhi | | *Date* | 2008/6/17 | | *File* | script/kids/3DMapSystemApp/Login/TutorialPage.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/Login/TutorialPage.lua"); </verbatim> ---+++ Member Functions ---++++ !TutorialPage.DS_OfflineTutorial_Func <verbatim> template db table TutorialPage.dsOfflineTutorials = { {Title=L"鍩虹绡?, SubTitle=L"鏁欎綘鍩烘湰浜虹墿鎿嶄綔, 浣跨敤宸ュ叿, 鍒涢€?D瀹跺洯, 鎺㈢储3D绀句氦缃戠粶", worldpath=F"worlds/Official/鏂版墜涔嬭矾", preview=F"worlds/Official/鏂版墜涔嬭矾/preview.jpg", }, {Title=L"鍎跨绡?, SubTitle=L"濡傛灉浣犳湁7-12宀佺殑瀛╁瓙, 鍙互闄粬浠竴璧峰垱浣? 鍏ㄩ潰鎻愰珮鍎跨鐨勬兂鍍忓姏, 鍒涢€犲姏, 棰嗗鍔?寤鸿涓?..)", worldpath="worlds/Official/DisneyLand", preview="worlds/Official/DisneyLand/preview.jpg", }, {Title=L"寮€鍙戠瘒", SubTitle=L"浠嬬粛PEDN寮€鍙戠綉, 搴旂敤绋嬪簭鏋舵瀯, 鍒涘缓灞炰簬浣犵殑3D浜掕仈缃戜骇涓?(寤鸿涓?..)", worldpath="worlds/Official/NewUserVillage3", preview="worlds/Official/NewUserVillage3/preview.jpg", }, {Title=L"鎻愰珮绡?, SubTitle=L"鏁欎綘鍒朵綔鏅鸿兘浜虹墿, 鎷嶆憚鐢靛奖, 浠ュ強閮ㄥ垎绀句氦骞冲彴鍔熻兘(寤鸿涓?..)", worldpath="worlds/Official/NewUserVillage2", preview="worlds/Official/NewUserVillage2/preview.jpg", }, }</verbatim>; datasource function for pe:gridview __syntax__ <verbatim>function TutorialPage.DS_OfflineTutorial_Func(index)</verbatim> __parameters__ | *index* | | ---++++ !TutorialPage.DS_OnlineTutorial_Func <verbatim> template db table TutorialPage.dsOnlineTutorials = { {Title=L"鏂版墜鏉?, SubTitle=L"鏁欎綘鍩烘湰浜虹墿鎿嶄綔, 浣跨敤宸ュ叿, 鍒涢€?D瀹跺洯, 鎺㈢储3D绀句氦缃戠粶", worldpath=F"worlds/Official/鏂版墜涔嬭矾", preview=F"worlds/Official/鏂版墜涔嬭矾/preview.jpg", }, {Title=L"鍎跨鏉?, SubTitle=L"濡傛灉浣犳湁7-12宀佺殑瀛╁瓙, 鍙互闄粬浠竴璧峰垱浣? 鍏ㄩ潰鎻愰珮鍎跨鐨勬兂鍍忓姏, 鍒涢€犲姏, 棰嗗鍔?寤鸿涓?..)", worldpath="worlds/Official/DisneyLand", preview="worlds/Official/DisneyLand/preview.jpg", }, {Title=L"寮€鍙戣€呮潙", SubTitle=L"浠嬬粛PEDN寮€鍙戠綉, 搴旂敤绋嬪簭鏋舵瀯, 鍒涘缓灞炰簬浣犵殑3D浜掕仈缃戜骇涓?寤鸿涓?..)", worldpath="worlds/Official/NewUserVillage3", preview="worlds/Official/NewUserVillage3/preview.jpg", }, {Title=L"楂樼骇绡?, SubTitle=L"鏁欎綘鍒朵綔鏅鸿兘浜虹墿, 鎷嶆憚鐢靛奖, 浠ュ強閮ㄥ垎绀句氦骞冲彴鍔熻兘(寤鸿涓?..)", worldpath="worlds/Official/NewUserVillage1", preview="worlds/Official/NewUserVillage1/preview.jpg", }, {Title=L"棰佸宀?, SubTitle=L"鍚勭璇勯€夋椿鍔ㄧ殑棰佸鍦扮偣(寤鸿涓?..)", worldpath="worlds/Official/NewUserVillage2", preview="worlds/Official/NewUserVillage2/preview.jpg", }, {Title=L"鎯呬荆宀?, SubTitle=L"缁撲氦鏂版湅鍙?寤鸿涓?..)", worldpath="worlds/Official/NewUserVillage3", preview="worlds/Official/NewUserVillage3/preview.jpg", }, }</verbatim>; datasource function for pe:gridview __syntax__ <verbatim>function TutorialPage.DS_OnlineTutorial_Func(index)</verbatim> __parameters__ | *index* | | %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