public class ChatKit extends Object
Constructor and Description |
---|
ChatKit() |
Modifier and Type | Method and Description |
---|---|
static ImPacket |
dataInCorrectRespPacket(org.tio.core.ChannelContext channelContext)
聊天数据格式不正确响应包
|
static boolean |
isOnline(String userid)
判断用户是否在线;
|
static ImPacket |
offlineRespPacket(org.tio.core.ChannelContext channelContext)
聊天用户不在线响应包
|
static ChatBody |
parseChatBody(String bodyStr)
判断是否属于指定格式聊天消息;
|
static ImPacket |
sendSuccessRespPacket(org.tio.core.ChannelContext channelContext)
聊天发送成功响应包
|
static String |
sessionId(String from,
String to)
获取双方会话ID(算法,from与to相与的值通过MD5加密得出)
|
static ChatBody |
toChatBody(byte[] body,
org.tio.core.ChannelContext channelContext)
转换为聊天消息结构;
|
public static ChatBody toChatBody(byte[] body, org.tio.core.ChannelContext channelContext)
body
- channelContext
- public static ChatBody parseChatBody(String bodyStr)
packet
- public static ImPacket dataInCorrectRespPacket(org.tio.core.ChannelContext channelContext) throws Exception
chatBody
- channelContext
- Exception
public static ImPacket sendSuccessRespPacket(org.tio.core.ChannelContext channelContext) throws Exception
chatBody
- channelContext
- Exception
public static ImPacket offlineRespPacket(org.tio.core.ChannelContext channelContext) throws Exception
chatBody
- channelContext
- Exception
public static boolean isOnline(String userid)
userid
- Copyright © 2018. All rights reserved.