20 lines
938 B
Plaintext
20 lines
938 B
Plaintext
prefix: chat.chatHandler
|
||
|
||
joinWorldChannel(): (code: Code.OK) // 加入世界频道
|
||
leaveWorldChannel(): (code: Code.OK) // 离开世界频道
|
||
joinTeamChannel(teamId: int): (code: 200) // 加入队伍频道
|
||
leaveTeamChannel(teamId: int): (code: 200) // 离开队伍频道
|
||
worldChat(content: string): (code: 200) // 世界聊天
|
||
teamChat(content: string, teamId: int): (code: 200) // 队伍聊天
|
||
|
||
onChat: 当用户在世界频道或队伍频道发送聊天消息时触发。事件携带以下数据:
|
||
from: 发送者的用户名 (string)
|
||
content: 聊天内容 (string)
|
||
type: 聊天类型,'world'或'team' (string)
|
||
teamId (可选): 如果类型为'team',则包含队伍ID (string)
|
||
|
||
onAdd: 当用户加入队伍频道时触发。事件携带以下数据:
|
||
user: 加入队伍频道的用户ID (string)
|
||
|
||
onLeave: 当用户离开队伍频道时触发。事件携带以下数据:
|
||
user: 离开队伍频道的用户ID (string) |