JgslLib
Jabber GSL server and client.
| Title |
Jabber GSL server and client. |
| Author(s) |
LiXizhi |
| Date |
2007/11/6, doc replenished 2008.6.22 by LiXizhi |
| File |
script/kids/3DMapSystemNetwork/JGSL.lua |
Description
Member Functions
JGSL.GetJC
boolean: whether this server is a grid server or not.
JGSL.IsGrid = nil;
dump all msg to log. should always be nil, except u are debugging
JGSL.dump_server_msg = true;
JGSL.dump_client_msg = true;
default neuron files for client and server.
JGSL.DefaultServerFile = "script/kids/3DMapSystemNetwork/JGSL_server.lua";
JGSL.DefaultClientFile = "script/kids/3DMapSystemNetwork/JGSL_client.lua";
TODO: the avatar to be displayed when the appearance is not synchronized in JGSL. Use something simple, such as a stick or a nude avatar.
JGSL.DefaultAvatarFile = "character/v3/Human/Female/HumanFemale.x";
JGSL.DefaultAvatarFile will be used as key to find the ccsstring.
JGSL.DefaultAvatarCCSStrings = {
["character/v3/Human/Female/HumanFemale.x"] = "0#0#0#1#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#0#0#10#12#0#0#0#0#0#0#0#",
["character/v3/Human/Male/HumanMale.x"] = "0#0#4#2#0#@0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#0#F#0#0#0#0#@0#0#0#0#0#11#13#0#0#0#0#0#0#0#",
};
public function
get a connected jabber client. it may return nil if jabber client is invalid.
syntax
function JGSL.GetJC()
JGSL.Reset
when client and server connect, they must exchange their session keys. By regenerating session keys, we
will reject any previous established
JGSL game connections. Usually we need to regenerate session when we load a different world.
- note __ : we will logout currently connected server if any.
syntax
function JGSL.Reset()
JGSL.SendToClient
private functions:
send a message to client
- param JID : the JID of a client. If this is nil. Messages is sent to all active clients.
- param neuronfile : if nil, the DefaultClientFile? is used
syntax
function JGSL.SendToClient(JID, msg, neuronfile)
parameters
| JID |
the JID of a client. If this is nil. Messages is sent to all active clients. |
| msg |
|
| neuronfile |
|
JGSL.SendToServer
send a message to the current server
- param neuronfile : if nil, the DefaultServerFile? is used
syntax
function JGSL.SendToServer(msg, neuronfile)
parameters
| msg |
|
| neuronfile |
if nil, the DefaultServerFile? is used |
JGSL.Log
display text to in-game log panel.
- param text : string
- param level : the level of importance of the message. it can be nil.
syntax
function JGSL.Log(text, level)
parameters
JGSL.SearchRequestGroup
return the index of a value from table Req_group, which equals value. Return nil if not found
e.g
SearchRequestGroup? ({[1] = "lxz@pe"}, "lxz@pe") returns 1
syntax
function JGSL.SearchRequestGroup(Req_group, value)
parameters
JGSL.CompressEnvs
compress environment updates, removing redundent ones.
It will ensure that the following messages will only have one latest copy in env array.
OCEAN_SET_WATER, SKY_SET_Sky
- param env : array of env messages.
syntax
function JGSL.CompressEnvs(env)
parameters
| env |
array of env messages. |