---++!! !JGSL_servermode %TOC{title="Contents:"}% %STARTINCLUDE% ---++ server mode of JGSL grid server | *Title* | server mode of JGSL grid server | | *Author(s)* | LiXizhi | | *Date* | 2008.8.6 | | *File* | script/kids/3DMapSystemNetwork/JGSL_servermode.lua | ---+++ Description call the stay alive function periodically to make sure this instance (system service) is alive. Map3DSystem.JGSL.servermode.StayAlive() %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemNetwork/JGSL_servermode.lua"); Map3DSystem.JGSL.servermode.StayAlive() Map3DSystem.JGSL.servermode.EnterServerMode() </verbatim> ---+++ Member Functions ---++++ !servermode.GetJC ----------------------------- public function ----------------------------- get the currently connected client. return nil, if connection is not valid or not authenticated __syntax__ <verbatim>function servermode.GetJC()</verbatim> ---++++ !servermode.GetJID get the JID of this jabber client. __syntax__ <verbatim>function servermode.GetJID()</verbatim> ---++++ !servermode.GetClient Get default jabber client, create if not exist. It will return nil, if jid is not known It does not open a connection immediately. __syntax__ <verbatim>function servermode.GetClient()</verbatim> ---++++ !servermode.StayAlive this function should be called periodically to connect to the JGSL internally it just checks with the remote server every 10 mins if disconnected __syntax__ <verbatim>function servermode.StayAlive()</verbatim> ---++++ !servermode.EnterServerMode enter to server mode, without graphics, but as a system service. __syntax__ <verbatim>function servermode.EnterServerMode()</verbatim> ---++++ !servermode.CheckLastTime this function will return true if nMilliSecondsPassed is passed since last timer of timerName is set * _param_ __timerName__ : such as "ConnectTimer" * _param_ __nMilliSecondsPassed__ : such as 20000 milliseconds * _param_ __bUpdateIfTrue__ : whether it will update last connection time if true. __syntax__ <verbatim>function servermode.CheckLastTime(timerName, nMilliSecondsPassed, bUpdateIfTrue)</verbatim> __parameters__ | *timerName* | such as "ConnectTimer" | | *nMilliSecondsPassed* | | | *bUpdateIfTrue* | whether it will update last connection time if true. | ---++++ !servermode.InitJabber initialize the instant messager client * _param_ __password__ : password __syntax__ <verbatim>function servermode.InitJabber(password)</verbatim> __parameters__ | *password* | password | ---++++ !servermode.JE_OnError --------------------------------- server mode jabber event callback functions --------------------------------- any kinds of error may goes here __syntax__ <verbatim>function servermode.JE_OnError()</verbatim> ---++++ !servermode.JE_OnMessage received a message packet __syntax__ <verbatim>function servermode.JE_OnMessage()</verbatim> ---++++ !servermode.JE_OnConnect connection is established, user is still being authenticated. The connection is connected, but no stream:stream has been sent, yet __syntax__ <verbatim>function servermode.JE_OnConnect()</verbatim> ---++++ !servermode.JE_OnDisconnect gracefully disconnected. The connection is disconnected __syntax__ <verbatim>function servermode.JE_OnDisconnect()</verbatim> ---++++ !servermode.JE_OnAuthError use Jabber_OnError() instead. this function is not called. Authentication failed. The connection is not terminated if there is an auth error and there is at least one event handler for this event. __syntax__ <verbatim>function servermode.JE_OnAuthError()</verbatim> ---++++ !servermode.JE_OnAuthenticate user is authenticated The connection is complete, and the user is authenticated __syntax__ <verbatim>function servermode.JE_OnAuthenticate()</verbatim> %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