Skip to content

NetConversation

继承自 EngineObject

用于存储客户端的基础属性。

成员变量

NetConversation.isNew : boolean
(只读)是否是新的NetConversation。
NetConversation.userID : number
(只读)用户ID。
NetConversation.clientID : number
(只读)客户端ID。
NetConversation.server_id : string
(只读)服务器ID。

成员方法

NetConversation.Send ( message : string ) : void
从服务器发送消息给客户端。
NetConversation.Emit ( type : contructor , args : ...params ) : T
提交数据。
NetConversation.FindEntity ( entityID : number ) : NetEntity
根据entityID查找实体。
NetConversation.CreateNewEntity ( prefab_id : string , NetEntity? : callback ) : void
创建新的实体对象。
NetConversation.CurrentConversation ( ) : NetConversation
当前NetConversation对象。
NetConversation.ConnectTo ( token : NetInstanceToken ) : Promise<boolean>
携带一个token,连接服务器。
NetConversation.NewUniqueID ( type : string ) : Promise<number>
生成在网络中唯一标识某个实体、对象或者消息的 ID。
NetConversation.GetCurrencyAmount ( type : string ) : Promise<number>
获取type货币的数量。
NetConversation.ChangeCurrencyAmount ( type : string , diff : number ) : Promise<CurrencyOperationResult>
编辑该 NetConversation 储存的货币的改变量。
NetConversation.GetStoredValue ( key : string ) : Promise<string>
获取当前NetConversation的key中存储的值。
NetConversation.SetStoredValue ( key : string , value : string ) : Promise<void>
设置当前NetConversation的key中存储的值。