PEDN> Main Web>ParaWorldAPI>ParaWorld_Lobby (2008-02-29, LiXizhi) Change language en zh-cn? EditAttach

ParaWorld_Lobby

lobby services

Title lobby services
Author(s) LiXizhi
Date 2008/1/21
File script/kids/3DMapSystemApp/API/paraworld.lobby.lua

Description

for JGSL

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/API/ParaworldAPI.lua");

Member Functions

paraworld.lobby.CreateRoom

create class commonlib.setfield("paraworld.lobby", {});

[[

创建房间。当一个用户成功创建一个房间后,该用户之前所创建的所有房间都将被删除

msg = {

"sessionKey" (*) //用户凭证

[ "worldID" ] = int //房间所关联的World的ID,worldID与worldPath必须有一个有值,如果worldID有值,则忽略worldPath

[ "worldPath" ] = string //房间所关联的World的Path,worldID与worldPath必须有一个有值,如果worldID有值,则忽略worldPath

[ "joinPassword" ] = string //加入此房间需要的密码。如果不设密码,则不传此参数。

[ "description" ] = string //房间的描述信息

[ "maxClients" ] = int //此房间最多可容纳的人数,默认值为100

}

msg = {

newRoomID = int //若创建房间成功,则返回新创建房间的ID,否则,返回0

[ errorCode ] = int //错误码,当发生异常时会有此节点。0:无异常 500:未知错误 499:提供的数据不完整 498:非法的访问

}

]]

syntax

function paraworld.lobby.CreateRoom() 

paraworld.lobby.GetRoomList

[[

取得指定页的房间数据

msg = {

[ "pageIndex" ] = int //以0开始的页码,默认值为0

[ "pageSize" ] = string //每页的最大数据量,默认值为50

[ "worldID" ] = int //取得与该World相关联的所有房间,若指定了worldID,将忽略worldPath

[ "worldPath" ] = string //取得与该World相关联的所有房间

[ "orderField" ] = int //排序字段。1:RoomID,2:CreateDate,3:ActivityDate, 默认值为2

[ "orderDirection" ] = string //排序方式。1:正序;2:倒序,默认值为2

}

msg = {

pageCount (int) 共有多少页

rooms [list]{

roomID (int) 主键

worldID (int) 该房间关联的World的ID

worldPath (string) 该房间关联的World的Path

hostUID (string) 创建者用户ID

joinPassword (string) 加入房间需要的密码

description (string) 房间描述

maxClients (int) 该房间最多可容纳多少人

createDate (string) 房间创建时间

activityDate (string) 该房间最后一位加入者的时间

}

[ errorCode ] (int) 错误码,发生异常时会有此节点

}

]]

syntax

function paraworld.lobby.GetRoomList() 

paraworld.lobby.JoinRoom

[[ db.clientnumber ++; ]]

syntax

function paraworld.lobby.JoinRoom() 

paraworld.lobby.LeaveRoom

[[ db.clientnumber --; ]]

syntax

function paraworld.lobby.LeaveRoom() 

paraworld.lobby.GetBBS

[[

取得某个频道的某个时间之后的所有消息

msg = {

"sessionKey" = string //用户凭证

"channel" = string //频道名称

[ "afterDate" ] = string //指定时间后的消息,如果为空,则不计

[ "pageIndex" ] = int //以0开始的页码,默认值为0

[ "pageSize" ] = int //每页的最大数据量,默认值为50

}

msg = {

"channel" string //频道名称

"msgs" [list]{

"uid" = string,

"date" = string,

"content" = string,

}

[ errorCode ] int //发生异常时会有此节点

}

]]

syntax

function paraworld.lobby.GetBBS() 

paraworld.lobby.PostBBS

[[

发布MCML String 到某个频道

msg = {

"sessionKey" = string //用户凭证

"channel" = string //频道名称

"content" = string //消息内容

}

msg = {

"isSuccess" boolean //发送是否成功

[ "errorCode" ] int //错误码,发生异常时会有此节点

}

}

]]

syntax

function paraworld.lobby.PostBBS() 
Topic revision: r1 - 2008-02-29 - 15:26:12 - LiXizhi
 

ParaEngine Developer Network

This site is powered by the TWiki collaboration platformCopyright © 2004-2008 ParaEngine Corporation
Ideas, requests, problems regarding ParaEngine platform Send feedback