r2/game-server/docs/api_chat.txt
lightings f30219ff1f ...
2023-04-13 15:09:31 +08:00

20 lines
938 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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)