JGSL_history

JGSL Grid (grid server)

Title JGSL Grid (grid server)
Author(s) LiXizhi
Date 2008/8/3
File script/kids/3DMapSystemNetwork/JGSL_history.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemNetwork/JGSL_history.lua");
local history = Map3DSystem.JGSL.history:new();

Member Functions

history:clear

clear all history. call this function when a server restart.

syntax

function history:clear()

history:GetTotalCount

add the total number of creations and env changes.

syntax

function history:GetTotalCount()

history:AddCreations

when the server receives some client updates that contains creations, it will save all clients' creations to an array. At normal update time, the server will broadcast previous creations to the clients.

  • param creations : an array of creation history
  • param fromJID : who added this creations.

syntax

function history:AddCreations(creations, fromJID)

parameters

creations an array of creation history
fromJID  

history:AddEnvs

when the server receives some client updates that contains env updates, it will save all clients' creations to an array. At normal update time, the server will broadcast previous envs to the clients.

  • param env : an array of env history
  • param fromJID : who added this env.

syntax

function history:AddEnvs(env, fromJID)

parameters

env an array of env history
fromJID  

history:GetCreationsForClientAgent

get an array of creations from the server creation history.

  • param agent : the agent for whom creations will be retrieved. In fact, it will return all creations who time is larger than agent.LastCreationHistoryTime, and whose agent.fromJID is different from the one in creation history.
  • param MaxCount : nil or max number of creations to return. This prevents sending too many in a single message.
  • return __ : return nil or an array of creations for sending back to the client agent

syntax

function history:GetCreationsForClientAgent(agent, MaxCount)

parameters

| agent | the agent for whom creations will be retrieved. In fact, it will return all creations who time is larger than agent.LastCreationHistoryTime, and whose agent.fromJID is different from the one in creation history. |

MaxCount  
return return nil or an array of creations for sending back to the client agent

history:GetEnvsForClientAgent

get an array of creations from the server creation history.

  • param agent : the agent for whom creations will be retrieved. In fact, it will return all creations who time is larger than agent.LastEnvHistoryTime, and whose agent.fromJID is different from the one in creation history.
  • param MaxCount : nil or max number of creations to return. This prevents sending too many in a single message.
  • return __ : return nil or an array of creations for sending back to the client agent

syntax

function history:GetEnvsForClientAgent(agent, MaxCount)

parameters

| agent | the agent for whom creations will be retrieved. In fact, it will return all creations who time is larger than agent.LastEnvHistoryTime, and whose agent.fromJID is different from the one in creation history. |

MaxCount  
return return nil or an array of creations for sending back to the client agent
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