public bool Receive(string command, object response, long resTime) { if (command.Equals("9201")) { NPCloudReceiveParameter <string> npcloudReceiveParameter = response as NPCloudReceiveParameter <string>; NpMessageParameter obj = new NpMessageParameter(npcloudReceiveParameter.option.roomId, (int)npcloudReceiveParameter.sender, npcloudReceiveParameter.body, NpUtil.MsTimestampToDateTime(npcloudReceiveParameter.resTime)); this.mMessage(obj); return(true); } if (command.Equals("9202")) { NPCloudReceiveParameter <List <RoomMsgLog> > npcloudReceiveParameter2 = response as NPCloudReceiveParameter <List <RoomMsgLog> >; List <NpRoomMsgLog> list = new List <NpRoomMsgLog>(); foreach (RoomMsgLog roomMsgLog in npcloudReceiveParameter2.body) { DateTime sendtime = NpUtil.MsTimestampToDateTime(roomMsgLog.createdat); if (!string.IsNullOrEmpty(roomMsgLog.userid) || !string.IsNullOrEmpty(roomMsgLog.sendedmsg)) { NpRoomMsgLog item = new NpRoomMsgLog(roomMsgLog.userid, sendtime, roomMsgLog.sendedmsg); list.Add(item); } } this.mRoomMsgLog(list); return(true); } return(false); }
public void OnMessage(NpMessageParameter msgData) { }