JGSL_servermode

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()

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemNetwork/JGSL_servermode.lua");
Map3DSystem.JGSL.servermode.StayAlive()
Map3DSystem.JGSL.servermode.EnterServerMode()

Member Functions

servermode.GetJC


public function

get the currently connected client. return nil, if connection is not valid or not authenticated

syntax

function servermode.GetJC()

servermode.GetJID

get the JID of this jabber client.

syntax

function servermode.GetJID()

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

function servermode.GetClient()

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

function servermode.StayAlive()

servermode.EnterServerMode

enter to server mode, without graphics, but as a system service.

syntax

function servermode.EnterServerMode()

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

function servermode.CheckLastTime(timerName, nMilliSecondsPassed, bUpdateIfTrue)

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

function servermode.InitJabber(password)

parameters

password password

servermode.JE_OnError


server mode jabber event callback functions

any kinds of error may goes here

syntax

function servermode.JE_OnError()

servermode.JE_OnMessage

received a message packet

syntax

function servermode.JE_OnMessage()

servermode.JE_OnConnect

connection is established, user is still being authenticated. The connection is connected, but no stream:stream has been sent, yet

syntax

function servermode.JE_OnConnect()

servermode.JE_OnDisconnect

gracefully disconnected. The connection is disconnected

syntax

function servermode.JE_OnDisconnect()

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

function servermode.JE_OnAuthError()

servermode.JE_OnAuthenticate

user is authenticated The connection is complete, and the user is authenticated

syntax

function servermode.JE_OnAuthenticate()
Topic revision: r1 - 2008-02-29 - LiXizhi
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 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