---++!! !ParaWorld_Users %TOC{title="Contents:"}% %STARTINCLUDE% ---++ user info | *Title* | user info | | *Author(s)* | LiXizhi | | *Date* | 2008/1/21 | | *File* | script/kids/3DMapSystemApp/API/paraworld.users.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/API/ParaworldAPI.lua"); </verbatim> ---+++ Member Functions ---++++ ! create class commonlib.setfield("paraworld.users", {}); [[ <summary> 鑾峰彇涓€缁勬寚瀹氱敤鎴风殑鎸囧畾淇℃伅 </summary> <param name="msg"> msg = { "uids" = string (*) //鐢ㄩ€楀彿锛?锛夊垎闅旂殑澶氫釜鐢ㄦ埛ID "nids" = string // 鐢ㄩ€楀彿锛?锛夊垎闅旂殑澶氫釜鐢ㄦ埛鏁板瓧ID锛屾渶澶氫笉鍙秴杩?0涓? "fields" = string //瑕侀€楀彿锛?锛夊垎闅旂殑澶氫釜瑕佸彇寰楃殑瀛楁锛岃嫢涓嶄紶姝ゅ弬鏁帮紝琛ㄧず鍙栧緱鎵€鏈夊瓧娈点€傚彲鐢ㄧ殑鍙傛暟涓猴細UserName;MoneyE;MoneyEValidUntil;Gender;BirthDate;Occupation;Website;GameServer;SpaceServer;LobbyServer;MapX;MapY;MapLevel;MapMessage;CityID;CityRole;Profession;ProfessionalSkill;EngineeringSkill;Inventories;CCS_info;UserID,ViewCount, MoneyP, Credits, Level, InRoles,FirstName,LastName } <returns> if(operation = "get") { msg = { "users" = list{ userID = string 锛堢敱鍙傛暟fields鍐冲畾鐨勮妭鐐癸級 } [ errorCode ] = int 閿欒鐮併€?锛氭棤寮傚父 500锛氭湭鐭ラ敊璇? 499锛氭彁渚涚殑鏁版嵁涓嶅畬鏁? 498锛氶潪娉曠殑璁块棶 [ info ] = string 鍙戠敓寮傚父鎴栫壒娈婃儏褰笅鏈夋鑺傜偣 } } </returns> paraworld.users.getInfo({nids="001,002,003", fields="userID,NID,UserName"}, "test", function(msg) log(commonlib.serialize(msg)); end); paraworld.users.getInfo({uids="813b07e0-7897-4359-aa1f-4b64dc4f20f0", fields="userID,NID,UserName"}, "test", function(msg) log(commonlib.serialize(msg)); end); ]] getinfo with modified preprocessor and postprocessor and local server cache policy * _note_ ____ : if msg.fields is nil, local server is not used, so always specify fields. * _note2_ ____ : FOR LOCAL SERVER TO WORK PROPERLY, ALWAYS INCLUDE "userID,NID" in msg.fields local getInfo_cache_policy = Map3DSystem.localserver.CachePolicy:new("access plus 1 week"); local getInfo_cache_policy = Map3DSystem.localserver.CachePolicy:new("access plus 1 day"); paraworld.CreateRESTJsonWrapper("paraworld.users.getInfo", "%MAIN%/Users/GetInfo.ashx", PreProcessor __syntax__ <verbatim>function (self, msg, id, callbackFunc, callbackParams, postMsgTranslator)</verbatim> __parameters__ | *self* | | | *msg* | | | *id* | | | *callbackFunc* | | | *callbackParams* | | | *postMsgTranslator* | | ---++++ ! Post Processor __syntax__ <verbatim>function (self, msg, id,callbackFunc, callbackParams, postMsgTranslator, raw_msg, inputMsg)</verbatim> __parameters__ | *self* | | | *msg* | | | *id* | | | *callbackFunc* | | | *callbackParams* | | | *postMsgTranslator* | | | *raw* | | | *msg* | | | *inputMsg* | | %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