客户端类
More...
|
| Client (string appId, string appKey, string userId, bool ssl=true, string gameVersion="0.0.1", string playServer=null) |
| Client 构造方法 More...
|
|
async Task< Client > | Connect () |
| 连接 More...
|
|
async Task | JoinLobby () |
| 加入大厅,会接收到大厅房间列表更新的事件 More...
|
|
async Task | LeaveLobby () |
| 离开大厅 More...
|
|
async Task< Room > | CreateRoom (string roomName=null, RoomOptions roomOptions=null, List< string > expectedUserIds=null) |
| 创建房间 More...
|
|
async Task< Room > | JoinRoom (string roomName, List< string > expectedUserIds=null) |
| 加入房间 More...
|
|
async Task< Room > | RejoinRoom (string roomName) |
| 返回房间 More...
|
|
async Task< Room > | JoinOrCreateRoom (string roomName, RoomOptions roomOptions=null, List< string > expectedUserIds=null) |
| 加入或创建房间,如果房间 Id 存在,则加入;否则根据 roomOptions 和 expectedUserIds 创建新的房间 More...
|
|
async Task< Room > | JoinRandomRoom (PlayObject matchProperties=null, List< string > expectedUserIds=null) |
| 随机加入房间 More...
|
|
async Task< Room > | ReconnectAndRejoin () |
| 重连并返回上一个加入的房间 More...
|
|
async Task< string > | MatchRandom (string piggybackUserId, PlayObject matchProperties=null, List< string > expectedUserIds=null) |
| 匹配房间(不加入) More...
|
|
async Task | LeaveRoom () |
| 离开房间 More...
|
|
async Task< bool > | SetRoomOpen (bool open) |
| 设置房间开启 / 关闭 More...
|
|
async Task< bool > | SetRoomVisible (bool visible) |
| 设置房间可见性 More...
|
|
async Task< int > | SetRoomMaxPlayerCount (int count) |
| 设置房间最大玩家数量 More...
|
|
async Task< List< string > > | SetRoomExpectedUserIds (List< string > expectedUserIds) |
| 设置期望用户 More...
|
|
async Task | ClearRoomExpectedUserIds () |
| 清空期望用户 Id 列表 More...
|
|
async Task< List< string > > | AddRoomExpectedUserIds (List< string > expectedUserIds) |
| 增加期望用户 More...
|
|
async Task< List< string > > | RemoveRoomExpectedUserIds (List< string > expectedUserIds) |
| 删除期望用户 More...
|
|
async Task< Player > | SetMaster (int newMasterId) |
| 设置房主 More...
|
|
async Task | KickPlayer (int actorId, int code=0, string reason=null) |
| 将玩家踢出房间 More...
|
|
Task | SendEvent (byte eventId, PlayObject eventData=null, SendEventOptions options=null) |
| 发送自定义事件 More...
|
|
async Task | SetRoomCustomProperties (PlayObject properties, PlayObject expectedValues=null) |
| 设置房间自定义属性 More...
|
|
async Task | SetPlayerCustomProperties (int actorId, PlayObject properties, PlayObject expectedValues=null) |
| 设置玩家自定义属性 More...
|
|
void | PauseMessageQueue () |
| 暂停消息队列 More...
|
|
void | ResumeMessageQueue () |
| 恢复消息队列 More...
|
|
async Task | Close () |
| 关闭服务 More...
|
|
◆ Client()
LeanCloud.Play.Client.Client |
( |
string |
appId, |
|
|
string |
appKey, |
|
|
string |
userId, |
|
|
bool |
ssl = true , |
|
|
string |
gameVersion = "0.0.1" , |
|
|
string |
playServer = null |
|
) |
| |
|
inline |
Client 构造方法
- Parameters
-
appId | LeanCloud App Id |
appKey | LeanCloud App Key |
userId | 用户唯一 Id |
ssl | 是否启用 SSL |
gameVersion | 游戏版本号 |
playServer | 游戏服务器地址 |
◆ AddRoomExpectedUserIds()
async Task<List<string> > LeanCloud.Play.Client.AddRoomExpectedUserIds |
( |
List< string > |
expectedUserIds | ) |
|
|
inline |
增加期望用户
- Returns
- 房间当前期望加入玩家列表
- Parameters
-
expectedUserIds | 增加的期望用户 Id 列表 |
◆ ClearRoomExpectedUserIds()
async Task LeanCloud.Play.Client.ClearRoomExpectedUserIds |
( |
| ) |
|
|
inline |
◆ Close()
async Task LeanCloud.Play.Client.Close |
( |
| ) |
|
|
inline |
◆ Connect()
async Task<Client> LeanCloud.Play.Client.Connect |
( |
| ) |
|
|
inline |
◆ CreateRoom()
async Task<Room> LeanCloud.Play.Client.CreateRoom |
( |
string |
roomName = null , |
|
|
RoomOptions |
roomOptions = null , |
|
|
List< string > |
expectedUserIds = null |
|
) |
| |
|
inline |
创建房间
- Parameters
-
roomName | 房间唯一 Id |
roomOptions | 创建房间选项 |
expectedUserIds | 期望用户 Id 列表 |
- Returns
- 房间
◆ JoinLobby()
async Task LeanCloud.Play.Client.JoinLobby |
( |
| ) |
|
|
inline |
◆ JoinOrCreateRoom()
async Task<Room> LeanCloud.Play.Client.JoinOrCreateRoom |
( |
string |
roomName, |
|
|
RoomOptions |
roomOptions = null , |
|
|
List< string > |
expectedUserIds = null |
|
) |
| |
|
inline |
加入或创建房间,如果房间 Id 存在,则加入;否则根据 roomOptions 和 expectedUserIds 创建新的房间
- Parameters
-
roomName | 房间 Id |
roomOptions | 创建房间选项 |
expectedUserIds | 期望用户 Id 列表 |
- Returns
- 房间
◆ JoinRandomRoom()
async Task<Room> LeanCloud.Play.Client.JoinRandomRoom |
( |
PlayObject |
matchProperties = null , |
|
|
List< string > |
expectedUserIds = null |
|
) |
| |
|
inline |
随机加入房间
- Parameters
-
matchProperties | 匹配属性 |
expectedUserIds | 期望用户 Id 列表 |
- Returns
- 房间
◆ JoinRoom()
async Task<Room> LeanCloud.Play.Client.JoinRoom |
( |
string |
roomName, |
|
|
List< string > |
expectedUserIds = null |
|
) |
| |
|
inline |
加入房间
- Parameters
-
roomName | 房间 Id |
expectedUserIds | 期望用户 Id 列表 |
- Returns
- 房间
◆ KickPlayer()
async Task LeanCloud.Play.Client.KickPlayer |
( |
int |
actorId, |
|
|
int |
code = 0 , |
|
|
string |
reason = null |
|
) |
| |
|
inline |
将玩家踢出房间
- Parameters
-
actorId | 玩家的 Actor Id |
code | 附加码 |
reason | 附加消息 |
◆ LeaveLobby()
async Task LeanCloud.Play.Client.LeaveLobby |
( |
| ) |
|
|
inline |
◆ LeaveRoom()
async Task LeanCloud.Play.Client.LeaveRoom |
( |
| ) |
|
|
inline |
◆ MatchRandom()
async Task<string> LeanCloud.Play.Client.MatchRandom |
( |
string |
piggybackUserId, |
|
|
PlayObject |
matchProperties = null , |
|
|
List< string > |
expectedUserIds = null |
|
) |
| |
|
inline |
匹配房间(不加入)
- Parameters
-
piggybackUserId | 占位用户 Id |
matchProperties | 匹配属性 |
- Returns
- 房间 Id
◆ PauseMessageQueue()
void LeanCloud.Play.Client.PauseMessageQueue |
( |
| ) |
|
|
inline |
◆ ReconnectAndRejoin()
async Task<Room> LeanCloud.Play.Client.ReconnectAndRejoin |
( |
| ) |
|
|
inline |
◆ RejoinRoom()
async Task<Room> LeanCloud.Play.Client.RejoinRoom |
( |
string |
roomName | ) |
|
|
inline |
返回房间
- Parameters
-
- Returns
- 房间
◆ RemoveRoomExpectedUserIds()
async Task<List<string> > LeanCloud.Play.Client.RemoveRoomExpectedUserIds |
( |
List< string > |
expectedUserIds | ) |
|
|
inline |
删除期望用户
- Returns
- 房间当前期望加入玩家列表
- Parameters
-
expectedUserIds | 删除的期望用户 Id 列表 |
◆ ResumeMessageQueue()
void LeanCloud.Play.Client.ResumeMessageQueue |
( |
| ) |
|
|
inline |
◆ SendEvent()
发送自定义事件
- Parameters
-
eventId | 事件 Id |
eventData | 事件参数 |
options | 事件选项 |
◆ SetMaster()
async Task<Player> LeanCloud.Play.Client.SetMaster |
( |
int |
newMasterId | ) |
|
|
inline |
设置房主
- Returns
- 房主
- Parameters
-
◆ SetPlayerCustomProperties()
async Task LeanCloud.Play.Client.SetPlayerCustomProperties |
( |
int |
actorId, |
|
|
PlayObject |
properties, |
|
|
PlayObject |
expectedValues = null |
|
) |
| |
|
inline |
设置玩家自定义属性
- Parameters
-
actorId | 玩家 Actor Id |
properties | 自定义属性 |
expectedValues | 用于 CAS 的期望属性 |
◆ SetRoomCustomProperties()
async Task LeanCloud.Play.Client.SetRoomCustomProperties |
( |
PlayObject |
properties, |
|
|
PlayObject |
expectedValues = null |
|
) |
| |
|
inline |
设置房间自定义属性
- Parameters
-
properties | 自定义属性 |
expectedValues | 用于 CAS 的期望属性 |
◆ SetRoomExpectedUserIds()
async Task<List<string> > LeanCloud.Play.Client.SetRoomExpectedUserIds |
( |
List< string > |
expectedUserIds | ) |
|
|
inline |
设置期望用户
- Returns
- 房间当前期望加入玩家列表
- Parameters
-
expectedUserIds | 期望用户 Id 列表 |
◆ SetRoomMaxPlayerCount()
async Task<int> LeanCloud.Play.Client.SetRoomMaxPlayerCount |
( |
int |
count | ) |
|
|
inline |
设置房间最大玩家数量
- Returns
- 房间可容纳的最大人数
- Parameters
-
◆ SetRoomOpen()
async Task<bool> LeanCloud.Play.Client.SetRoomOpen |
( |
bool |
open | ) |
|
|
inline |
设置房间开启 / 关闭
- Returns
- 房间是否开启
- Parameters
-
◆ SetRoomVisible()
async Task<bool> LeanCloud.Play.Client.SetRoomVisible |
( |
bool |
visible | ) |
|
|
inline |
设置房间可见性
- Returns
- 房间是否可见
- Parameters
-
◆ OnCustomEvent
Action<byte, PlayObject, int> LeanCloud.Play.Client.OnCustomEvent |
◆ OnDisconnected
Action LeanCloud.Play.Client.OnDisconnected |
◆ OnError
Action<int, string> LeanCloud.Play.Client.OnError |
◆ OnLobbyRoomListUpdated
Action<List<LobbyRoom> > LeanCloud.Play.Client.OnLobbyRoomListUpdated |
◆ OnMasterSwitched
Action<Player> LeanCloud.Play.Client.OnMasterSwitched |
◆ OnPlayerActivityChanged
Action<Player> LeanCloud.Play.Client.OnPlayerActivityChanged |
◆ OnPlayerCustomPropertiesChanged
Action<Player, PlayObject> LeanCloud.Play.Client.OnPlayerCustomPropertiesChanged |
◆ OnPlayerRoomJoined
Action<Player> LeanCloud.Play.Client.OnPlayerRoomJoined |
◆ OnPlayerRoomLeft
Action<Player> LeanCloud.Play.Client.OnPlayerRoomLeft |
◆ OnRoomCustomPropertiesChanged
Action<PlayObject> LeanCloud.Play.Client.OnRoomCustomPropertiesChanged |
◆ OnRoomKicked
Action<int?, string> LeanCloud.Play.Client.OnRoomKicked |
◆ OnRoomSystemPropertiesChanged
Action<PlayObject> LeanCloud.Play.Client.OnRoomSystemPropertiesChanged |
房间系统属性更新事件,目前包括:房间开关,可见性,最大玩家数量,预留玩家 Id 列表
◆ AppId
string LeanCloud.Play.Client.AppId |
|
get |
◆ AppKey
string LeanCloud.Play.Client.AppKey |
|
get |
◆ GameVersion
string LeanCloud.Play.Client.GameVersion |
|
get |
客户端版本号,不同的版本号的玩家不会匹配到相同的房间
游戏版本号
◆ LobbyRoomList
List<LobbyRoom> LeanCloud.Play.Client.LobbyRoomList |
|
get |
◆ Player
Player LeanCloud.Play.Client.Player |
|
get |
◆ PlayServer
string LeanCloud.Play.Client.PlayServer |
|
get |
◆ Room
Room LeanCloud.Play.Client.Room |
|
getset |
◆ Ssl
bool LeanCloud.Play.Client.Ssl |
|
get |
是否启用 SSL
如果开启 SSL,则设为 true;否则设为 false。默认是 true
◆ UserId
string LeanCloud.Play.Client.UserId |
|
get |
The documentation for this class was generated from the following file: