示例#1
0
func (user *ChatUser) handle_sendmsg_notify(data *notifySendMsgData) {
	protoRsp := &chat.MsgPush{
		SourceAcc: proto.String(data.acc),
		Msg:       proto.String(data.msg),
	}

	rspData, err := proto.Marshal(protoRsp)
	//编码失败了
	util.CheckError(err, "proto.Marshal MsgPush: ")

	packetData := user.encodePacket(rspData, cmd_msg_push)

	user.sendPacket(packetData)
}
示例#2
0
func (user *ChatUser) handle_exit_notify(data *notifyExitData) {
	protoRsp := &chat.ExitNotify{
		Acc: proto.String(data.acc),
	}

	rspData, err := proto.Marshal(protoRsp)
	//编码失败了
	util.CheckError(err, "proto.Marshal ExitNotify: ")

	packetData := user.encodePacket(rspData, cmd_exit_notify)

	user.sendPacket(packetData)
}