private static void WriteUserDataMessage(ref MessagePackWriter writer, UserDataMessage message) { writer.WriteArrayHeader(3); writer.Write(ServiceProtocolConstants.UserDataMessageType); writer.Write(message.UserId); WritePayloads(ref writer, message.Payloads); }
private static ServiceMessage CreateUserDataMessage(ref MessagePackReader reader, int arrayLength) { var userId = ReadString(ref reader, "userId"); var payloads = ReadPayloads(ref reader); var result = new UserDataMessage(userId, payloads); if (arrayLength >= 4) { result.ReadExtensionMembers(ref reader); } return(result); }